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

Correct scissor for TexrectDrawer.

This commit is contained in:
Sergey Lipskiy 2015-11-20 15:02:51 +06:00
parent 00b9de68e0
commit 638e8791fc
3 changed files with 12 additions and 5 deletions

View File

@ -442,6 +442,7 @@ void OGLRender::TexrectDrawer::add()
m_pBuffer = frameBufferList().getCurrent(); m_pBuffer = frameBufferList().getCurrent();
m_otherMode = gDP.otherMode._u64; m_otherMode = gDP.otherMode._u64;
m_Z = (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : gSP.viewport.nearz; m_Z = (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : gSP.viewport.nearz;
m_scissor = gDP.scissor;
m_ulx = pRect[0].x; m_ulx = pRect[0].x;
m_uly = pRect[0].y; m_uly = pRect[0].y;
@ -481,6 +482,8 @@ bool OGLRender::TexrectDrawer::draw()
return false; return false;
const u64 otherMode = gDP.otherMode._u64; const u64 otherMode = gDP.otherMode._u64;
const gDPScissor scissor = gDP.scissor;
gDP.scissor = m_scissor;
gDP.otherMode._u64 = m_otherMode; gDP.otherMode._u64 = m_otherMode;
OGLVideo & ogl = video(); OGLVideo & ogl = video();
OGLRender & render = ogl.getRender(); OGLRender & render = ogl.getRender();
@ -583,6 +586,7 @@ bool OGLRender::TexrectDrawer::draw()
m_numRects = 0; m_numRects = 0;
gDP.otherMode._u64 = otherMode; gDP.otherMode._u64 = otherMode;
gDP.scissor = scissor;
gDP.changed |= CHANGED_COMBINE | CHANGED_SCISSOR | CHANGED_RENDERMODE; gDP.changed |= CHANGED_COMBINE | CHANGED_SCISSOR | CHANGED_RENDERMODE;
textureCache().activateTexture(0, pCurTex0); textureCache().activateTexture(0, pCurTex0);
CombinerInfo::get().update(); CombinerInfo::get().update();

View File

@ -217,6 +217,7 @@ private:
GLint m_enableAlphaTestLoc; GLint m_enableAlphaTestLoc;
GLint m_textureFilterModeLoc; GLint m_textureFilterModeLoc;
GLint m_textureBoundsLoc; GLint m_textureBoundsLoc;
gDPScissor m_scissor;
CachedTexture * m_pTexture; CachedTexture * m_pTexture;
FrameBuffer * m_pBuffer; FrameBuffer * m_pBuffer;
}; };

View File

@ -108,6 +108,12 @@ struct gDPLoadTileInfo {
u32 dxt; u32 dxt;
}; };
struct gDPScissor
{
u32 mode;
f32 ulx, uly, lrx, lry;
};
struct gDPInfo struct gDPInfo
{ {
struct struct
@ -218,11 +224,7 @@ struct gDPInfo
u32 depthImageAddress; u32 depthImageAddress;
struct gDPScissor scissor;
{
u32 mode;
f32 ulx, uly, lrx, lry;
} scissor;
struct struct
{ {