From 2e0b12061b932009818bcb7d373ae481728ec927 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 17 Aug 2015 23:44:38 +0800 Subject: Bug fixes (again). Further more fixes for smAnmFile. There could be more bugs... Fix Z Buffer blackening the whole screen in 2D mode. --- smelt/sdl/gfx_sdl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'smelt') diff --git a/smelt/sdl/gfx_sdl.cpp b/smelt/sdl/gfx_sdl.cpp index 3fd3b46..c0e9305 100644 --- a/smelt/sdl/gfx_sdl.cpp +++ b/smelt/sdl/gfx_sdl.cpp @@ -101,7 +101,8 @@ void SMELT_IMPL::smClrscr(DWORD color) GLfloat g=(GLfloat)(GETG(color))/255.f; GLfloat b=(GLfloat)(GETB(color))/255.f; pOpenGLDevice->glClearColor(r,g,b,a); - if(zbufenabled||tdmode)pOpenGLDevice->glClearDepth(1); + if(tdmode)pOpenGLDevice->glClearDepth(1); + else if(zbufenabled)pOpenGLDevice->glClearDepth(0); pOpenGLDevice->glClear(GL_COLOR_BUFFER_BIT|((zbufenabled||tdmode)?GL_DEPTH_BUFFER_BIT:0)); } void SMELT_IMPL::sm3DCamera6f2v(float *pos,float *rot) -- cgit v1.2.3