diff --git a/desmume/src/windows/OGLRender.c b/desmume/src/windows/OGLRender.c index e9dc163d8..ca510ecc8 100644 --- a/desmume/src/windows/OGLRender.c +++ b/desmume/src/windows/OGLRender.c @@ -272,11 +272,11 @@ void NDS_glClDepth() void NDS_glClearDepth(unsigned long v) { + u32 depth24b; + if(beginCalled) glEnd(); - u32 depth24b; - v &= 0x7FFFF; depth24b = (v*0x200)+((v+1)/0x8000);