DXGL r548 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r547‎ | r548 | r549 >
Date:22:31, 11 October 2014
Author:admin
Status:new
Tags:
Comment:
Fill in texture size caps when creating a DDraw object.
Fill in D3D z compare caps.
Modified paths:
  • /ddraw/glDirect3D.cpp (modified) (history)
  • /ddraw/glDirectDraw.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirect3D.cpp
@@ -40,7 +40,8 @@
4141 D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLNONE, // dwMiscCaps
4242 D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_FOGTABLE |
4343 D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_WFOG, //dwRasterCaps
44 - D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
 44+ D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL |
 45+ D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL, //dwZCmpCaps
4546 D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
4647 D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
4748 D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
Index: ddraw/glDirectDraw.cpp
@@ -1403,6 +1403,29 @@
14041404 }
14051405 d3ddesc = d3ddesc_default;
14061406 d3ddesc3 = d3ddesc3_default;
 1407+ if (!renderer)
 1408+ {
 1409+ HWND hGLWnd = CreateWindow(_T("Test"), NULL, WS_POPUP, 0, 0, 16, 16, NULL, NULL, NULL, NULL);
 1410+ glRenderer *tmprenderer = (glRenderer*)malloc(sizeof(glRenderer));
 1411+ DEVMODE mode;
 1412+ mode.dmSize = sizeof(DEVMODE);
 1413+ EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &mode);
 1414+ glRenderer_Init(tmprenderer, 16, 16, mode.dmBitsPerPel, false, mode.dmDisplayFrequency, hGLWnd, NULL, FALSE);
 1415+ d3ddesc.dwMaxTextureWidth = d3ddesc.dwMaxTextureHeight =
 1416+ d3ddesc.dwMaxTextureRepeat = d3ddesc.dwMaxTextureAspectRatio = tmprenderer->gl_caps.TextureMax;
 1417+ d3ddesc3.dwMaxTextureWidth = d3ddesc3.dwMaxTextureHeight =
 1418+ d3ddesc3.dwMaxTextureRepeat = d3ddesc3.dwMaxTextureAspectRatio = tmprenderer->gl_caps.TextureMax;
 1419+ glRenderer_Delete(tmprenderer);
 1420+ free(tmprenderer);
 1421+ }
 1422+ else
 1423+ {
 1424+ d3ddesc.dwMaxTextureWidth = d3ddesc.dwMaxTextureHeight =
 1425+ d3ddesc.dwMaxTextureRepeat = d3ddesc.dwMaxTextureAspectRatio = renderer->gl_caps.TextureMax;
 1426+ d3ddesc3.dwMaxTextureWidth = d3ddesc3.dwMaxTextureHeight =
 1427+ d3ddesc3.dwMaxTextureRepeat = d3ddesc3.dwMaxTextureAspectRatio = renderer->gl_caps.TextureMax;
 1428+ }
 1429+
14071430 memcpy(stored_devices, d3ddevices, 3 * sizeof(D3DDevice));
14081431 winstyle = winstyleex = 0;
14091432 initialized = true;