DXGL r180 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r179‎ | r180 | r181 >
Date:17:51, 24 June 2012
Author:admin
Status:new
Tags:
Comment:
Fix another mistake and add depth write state.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/glutil.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -1315,6 +1315,8 @@
13161316 device->SetDepthComp();
13171317 if(device->renderstate[D3DRENDERSTATE_ZENABLE]) DepthTest(true);
13181318 else DepthTest(false);
 1319+ if(device->renderstate[D3DRENDERSTATE_ZWRITEENABLE]) DepthWrite(true);
 1320+ else DepthWrite(false);
13191321 _GENSHADER prog = genshaders[current_genshader].shader;
13201322 glEnableVertexAttribArray(prog.attribs[0]);
13211323 glVertexAttribPointer(prog.attribs[0],3,GL_FLOAT,false,vertices[0].stride,vertices[0].data);
@@ -1475,6 +1477,7 @@
14761478 if(device->glDDS7->zbuffer) SetFBO(device->glDDS7->texture,device->glDDS7->zbuffer->texture,device->glDDS7->zbuffer->hasstencil);
14771479 else SetFBO(device->glDDS7->texture,0,false);
14781480 glViewport(device->viewport.dwX,device->viewport.dwY,device->viewport.dwWidth,device->viewport.dwHeight);
 1481+ glDepthRange(device->viewport.dvMinZ,device->viewport.dvMaxZ);
14791482 if(indices) glDrawElements(mode,indexcount,GL_UNSIGNED_SHORT,indices);
14801483 else glDrawArrays(mode,0,count);
14811484 if(device->glDDS7->zbuffer) device->glDDS7->zbuffer->dirty |= 2;
Index: ddraw/glutil.cpp
@@ -177,8 +177,8 @@
178178 if(enabled != depthtest)
179179 {
180180 depthtest = enabled;
181 - if(depthtest) glEnable(
182 - else glDepthMask(GL_FALSE);
 181+ if(depthtest) glEnable(GL_DEPTH_TEST);
 182+ else glDisable(GL_DEPTH_TEST);
183183 }
184184 }
185185 void SetDepthComp(GLenum comp)