diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index b82bfbf5b..f224e4b6b 100755 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -3693,10 +3693,10 @@ Render3DError OpenGLRenderer_1_2::RenderGeometry(const GFX3D_State &renderState, const POLY &firstPoly = polyList->list[indexList->list[0]]; u32 lastPolyAttr = firstPoly.polyAttr; - this->SetupPolygon(firstPoly, false, true); if (polyList->opaqueCount > 0) { + this->SetupPolygon(firstPoly, false, true); this->DrawPolygonsForIndexRange(polyList, indexList, 0, polyList->opaqueCount - 1, indexOffset, lastPolyAttr); } @@ -3704,6 +3704,11 @@ Render3DError OpenGLRenderer_1_2::RenderGeometry(const GFX3D_State &renderState, { if (this->_needsZeroDstAlphaPass) { + if (polyList->opaqueCount == 0) + { + this->SetupPolygon(firstPoly, true, false); + } + this->ZeroDstAlphaPass(polyList, indexList, renderState.enableAlphaBlending, indexOffset, lastPolyAttr); if (polyList->opaqueCount > 0) @@ -3712,7 +3717,11 @@ Render3DError OpenGLRenderer_1_2::RenderGeometry(const GFX3D_State &renderState, lastPolyAttr = lastOpaquePoly.polyAttr; this->SetupPolygon(lastOpaquePoly, false, true); } - + } + + if (polyList->opaqueCount == 0) + { + this->SetupPolygon(firstPoly, true, true); } this->DrawPolygonsForIndexRange(polyList, indexList, polyList->opaqueCount, polyList->count - 1, indexOffset, lastPolyAttr);