1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Fix copy from RDRAM in widescreen mode.

This commit is contained in:
Sergey Lipskiy 2016-02-14 12:45:25 +06:00
parent 2a01d47df4
commit c4b0e9999e
4 changed files with 10 additions and 7 deletions

View File

@ -900,7 +900,7 @@ void FrameBufferList::renderBuffer(u32 _address)
glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0);
OGLRender::TexturedRectParams params(0.0f, 0.0f, width, height, 0.0f, 0.0f, width - 1.0f, height - 1.0f, false, pBuffer); OGLRender::TexturedRectParams params(0.0f, 0.0f, width, height, 0.0f, 0.0f, width - 1.0f, height - 1.0f, false, false, pBuffer);
ogl.getRender().drawTexturedRect(params); ogl.getRender().drawTexturedRect(params);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
@ -1741,7 +1741,7 @@ void RDRAMtoFrameBuffer::CopyFromRDRAM(u32 _address, bool _bCFB)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_pCurBuffer->m_FBO); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_pCurBuffer->m_FBO);
OGLRender::TexturedRectParams params((float)x0, (float)y0, (float)width, (float)height, OGLRender::TexturedRectParams params((float)x0, (float)y0, (float)width, (float)height,
0.0f, 0.0f, width - 1.0f, height - 1.0f, 0.0f, 0.0f, width - 1.0f, height - 1.0f,
false, m_pCurBuffer); false, true, m_pCurBuffer);
video().getRender().drawTexturedRect(params); video().getRender().drawTexturedRect(params);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);

View File

@ -1181,7 +1181,10 @@ void OGLRender::drawTexturedRect(const TexturedRectParams & _params)
m_rect[2].t1 = texST[1].t1; m_rect[2].t1 = texST[1].t1;
} }
if (ogl.isAdjustScreen() && (gDP.colorImage.width > VI.width * 98 / 100) && (_params.lrx - _params.ulx < VI.width * 9 / 10)) { if (ogl.isAdjustScreen() &&
(_params.forceAjustScale ||
((gDP.colorImage.width > VI.width * 98 / 100) && (_params.lrx - _params.ulx < VI.width * 9 / 10))))
{
const float scale = ogl.getAdjustScale(); const float scale = ogl.getAdjustScale();
for (u32 i = 0; i < 4; ++i) for (u32 i = 0; i < 4; ++i)
m_rect[i].x *= scale; m_rect[i].x *= scale;

View File

@ -86,14 +86,14 @@ public:
{ {
float ulx, uly, lrx, lry; float ulx, uly, lrx, lry;
float uls, ult, lrs, lrt; float uls, ult, lrs, lrt;
bool flip; bool flip, forceAjustScale;
const FrameBuffer * pBuffer; const FrameBuffer * pBuffer;
TexturedRectParams(float _ulx, float _uly, float _lrx, float _lry, TexturedRectParams(float _ulx, float _uly, float _lrx, float _lry,
float _uls, float _ult, float _lrs, float _lrt, float _uls, float _ult, float _lrs, float _lrt,
bool _flip, const FrameBuffer * _pBuffer) : bool _flip, bool _forceAjustScale, const FrameBuffer * _pBuffer) :
ulx(_ulx), uly(_uly), lrx(_lrx), lry(_lry), ulx(_ulx), uly(_uly), lrx(_lrx), lry(_lry),
uls(_uls), ult(_ult), lrs(_lrs), lrt(_lrt), uls(_uls), ult(_ult), lrs(_lrs), lrt(_lrt),
flip(_flip), pBuffer(_pBuffer) flip(_flip), forceAjustScale(_forceAjustScale), pBuffer(_pBuffer)
{} {}
}; };
void drawTexturedRect(const TexturedRectParams & _params); void drawTexturedRect(const TexturedRectParams & _params);

View File

@ -848,7 +848,7 @@ void gDPTextureRectangle( f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, f32 s, f
lrt = t + (lry - uly - 1) * dtdy; lrt = t + (lry - uly - 1) * dtdy;
} }
OGLRender::TexturedRectParams params(ulx, uly, lrx, lry, s, t, lrs, lrt, (RSP.cmd == G_TEXRECTFLIP), frameBufferList().getCurrent()); OGLRender::TexturedRectParams params(ulx, uly, lrx, lry, s, t, lrs, lrt, (RSP.cmd == G_TEXRECTFLIP), false, frameBufferList().getCurrent());
video().getRender().drawTexturedRect(params); video().getRender().drawTexturedRect(params);
gSP.textureTile[0] = textureTileOrg[0]; gSP.textureTile[0] = textureTileOrg[0];