DXGL r901 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r900‎ | r901 | r902 >
Date:23:11, 9 March 2019
Author:admin
Status:new
Tags:
Comment:
Draw 32-bit Z buffer to full range in DXGL Test.
Modified paths:
  • /dxglcfg/surfacegen.cpp (modified) (history)

Diff [purge]

Index: dxglcfg/surfacegen.cpp
@@ -313,13 +313,26 @@
314314 }
315315 return;
316316 case 32:
317 - for(y = 0; y < ddsd.dwHeight; y++)
 317+ if ((ddsd.ddpfPixelFormat.dwFlags & DDPF_ZBUFFER) && (ddsd.ddpfPixelFormat.dwZBitMask == 0xFFFFFFFF))
318318 {
319 - for(x = 0; x < ddsd.dwWidth; x++)
 319+ for (y = 0; y < ddsd.dwHeight; y++)
320320 {
321 - buffer32[x+((ddsd.lPitch/4)*y)] = (unsigned long)((x/(ddsd.dwWidth/4096.)) + 4096*floor((y/(ddsd.dwHeight/4096.))));
 321+ for (x = 0; x < ddsd.dwWidth; x++)
 322+ {
 323+ buffer32[x + ((ddsd.lPitch / 4) * y)] = (unsigned long)((x / (ddsd.dwWidth / 65536.)) + 65536 * floor((y / (ddsd.dwHeight / 65536.))));
 324+ }
322325 }
323326 }
 327+ else
 328+ {
 329+ for (y = 0; y < ddsd.dwHeight; y++)
 330+ {
 331+ for (x = 0; x < ddsd.dwWidth; x++)
 332+ {
 333+ buffer32[x + ((ddsd.lPitch / 4) * y)] = (unsigned long)((x / (ddsd.dwWidth / 4096.)) + 4096 * floor((y / (ddsd.dwHeight / 4096.))));
 334+ }
 335+ }
 336+ }
324337 return;
325338 default:
326339 return;