mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Pass destination frame buffer to OGLRender::drawTexturedRect.
Fixed RDRAMtoFrameBuffer::CopyFromRDRAM, when FBWrite writes to a buffer, which is not current displayed buffer. Example: JFG crosshair.
This commit is contained in:
parent
e8d76d21f0
commit
8b3d53f4e5
|
@ -900,11 +900,8 @@ void FrameBufferList::renderBuffer(u32 _address)
|
|||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
||||
FrameBuffer * pCurrent = m_pCurrent;
|
||||
m_pCurrent = pBuffer;
|
||||
OGLRender::TexturedRectParams params(0.0f, 0.0f, width, height, 0.0f, 0.0f, width - 1.0f, height - 1.0f, false);
|
||||
OGLRender::TexturedRectParams params(0.0f, 0.0f, width, height, 0.0f, 0.0f, width - 1.0f, height - 1.0f, false, pBuffer);
|
||||
ogl.getRender().drawTexturedRect(params);
|
||||
m_pCurrent = pCurrent;
|
||||
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
if (m_pCurrent != NULL)
|
||||
|
@ -1734,7 +1731,9 @@ void RDRAMtoFrameBuffer::CopyFromRDRAM(u32 _address, bool _bCFB)
|
|||
gSP.changed = gDP.changed = 0;
|
||||
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_pCurBuffer->m_FBO);
|
||||
OGLRender::TexturedRectParams params((float)x0, (float)y0, (float)width, (float)height, 0.0f, 0.0f, width - 1.0f, height - 1.0f, false);
|
||||
OGLRender::TexturedRectParams params((float)x0, (float)y0, (float)width, (float)height,
|
||||
0.0f, 0.0f, width - 1.0f, height - 1.0f,
|
||||
false, m_pCurBuffer);
|
||||
video().getRender().drawTexturedRect(params);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||
|
||||
|
|
|
@ -1066,7 +1066,7 @@ void OGLRender::drawTexturedRect(const TexturedRectParams & _params)
|
|||
if (!_canDraw())
|
||||
return;
|
||||
|
||||
FrameBuffer * pCurrentBuffer = frameBufferList().getCurrent();
|
||||
const FrameBuffer * pCurrentBuffer = _params.pBuffer;
|
||||
OGLVideo & ogl = video();
|
||||
if (pCurrentBuffer == NULL)
|
||||
glViewport( 0, ogl.getHeightOffset(), ogl.getScreenWidth(), ogl.getScreenHeight());
|
||||
|
|
|
@ -87,8 +87,13 @@ public:
|
|||
float ulx, uly, lrx, lry;
|
||||
float uls, ult, lrs, lrt;
|
||||
bool flip;
|
||||
TexturedRectParams(float _ulx, float _uly, float _lrx, float _lry, float _uls, float _ult, float _lrs, float _lrt, bool _flip) :
|
||||
ulx(_ulx), uly(_uly), lrx(_lrx), lry(_lry), uls(_uls), ult(_ult), lrs(_lrs), lrt(_lrt), flip(_flip)
|
||||
const FrameBuffer * pBuffer;
|
||||
TexturedRectParams(float _ulx, float _uly, float _lrx, float _lry,
|
||||
float _uls, float _ult, float _lrs, float _lrt,
|
||||
bool _flip, const FrameBuffer * _pBuffer) :
|
||||
ulx(_ulx), uly(_uly), lrx(_lrx), lry(_lry),
|
||||
uls(_uls), ult(_ult), lrs(_lrs), lrt(_lrt),
|
||||
flip(_flip), pBuffer(_pBuffer)
|
||||
{}
|
||||
};
|
||||
void drawTexturedRect(const TexturedRectParams & _params);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
OGLRender::TexturedRectParams params(ulx, uly, lrx, lry, s, t, lrs, lrt, (RSP.cmd == G_TEXRECTFLIP));
|
||||
OGLRender::TexturedRectParams params(ulx, uly, lrx, lry, s, t, lrs, lrt, (RSP.cmd == G_TEXRECTFLIP), frameBufferList().getCurrent());
|
||||
video().getRender().drawTexturedRect(params);
|
||||
|
||||
gSP.textureTile[0] = textureTileOrg[0];
|
||||
|
|
Loading…
Reference in New Issue
Block a user