DXGL r62 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r61‎ | r62 | r63 >
Date:21:44, 31 December 2011
Author:admin
Status:new
Tags:
Comment:
Add depth buffer surfaces
Modified paths:
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawSurface.cpp
@@ -299,15 +299,44 @@
300300 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);
301301 if(ddsd.dwFlags & DDSD_PIXELFORMAT)
302302 {
303 - if(ddsd.dwFlags & DDPF_ZBUFFER)
 303+ if(ddsd.ddpfPixelFormat.dwFlags & DDPF_ZBUFFER)
304304 {
305305 switch(ddsd.ddpfPixelFormat.dwZBufferBitDepth)
306306 {
307307 case 16:
308308 default:
 309+ texformat = GL_DEPTH_COMPONENT;
 310+ texformat2 = GL_UNSIGNED_BYTE;
 311+ texformat3 = GL_DEPTH_COMPONENT16;
 312+ break;
309313 case 24:
 314+ texformat = GL_DEPTH_COMPONENT;
 315+ texformat2 = GL_UNSIGNED_BYTE;
 316+ texformat3 = GL_DEPTH_COMPONENT24;
 317+ break;
310318 case 32:
311 - __asm nop
 319+ if((ddsd.ddpfPixelFormat.dwRGBZBitMask == 0x00ffffff) &&
 320+ !(ddsd.ddpfPixelFormat.dwFlags & DDPF_STENCILBUFFER))
 321+ {
 322+ texformat = GL_DEPTH_COMPONENT;
 323+ texformat2 = GL_UNSIGNED_INT;
 324+ texformat3 = GL_DEPTH_COMPONENT24;
 325+ break;
 326+ }
 327+ else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_STENCILBUFFER)
 328+ {
 329+ texformat = GL_DEPTH_STENCIL;
 330+ texformat2 = GL_UNSIGNED_INT_24_8;
 331+ texformat3 = GL_DEPTH24_STENCIL8;
 332+ break;
 333+ }
 334+ else
 335+ {
 336+ texformat = GL_DEPTH_COMPONENT;
 337+ texformat2 = GL_UNSIGNED_INT;
 338+ texformat3 = GL_DEPTH_COMPONENT32;
 339+ break;
 340+ }
312341 }
313342 }
314343 }