DXGL r62 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
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 @@
300
300
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);
301
301
if(ddsd.dwFlags & DDSD_PIXELFORMAT)
302
302
{
303
- if(ddsd.dwFlags & DDPF_ZBUFFER)
303
+ if(ddsd.ddpfPixelFormat.dwFlags & DDPF_ZBUFFER)
304
304
{
305
305
switch(ddsd.ddpfPixelFormat.dwZBufferBitDepth)
306
306
{
307
307
case 16:
308
308
default:
309
+ texformat = GL_DEPTH_COMPONENT;
310
+ texformat2 = GL_UNSIGNED_BYTE;
311
+ texformat3 = GL_DEPTH_COMPONENT16;
312
+ break;
309
313
case 24:
314
+ texformat = GL_DEPTH_COMPONENT;
315
+ texformat2 = GL_UNSIGNED_BYTE;
316
+ texformat3 = GL_DEPTH_COMPONENT24;
317
+ break;
310
318
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
+ }
312
341
}
313
342
}
314
343
}
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version