Mercurial > mm7
diff Render.cpp @ 2424:255168c31655
* Added win 8.1 support to builds
* Removed strict requirement so that display/os should support 16 bit resolutions (even if they aren't really used)
author | a.parshin |
---|---|
date | Wed, 23 Jul 2014 12:58:30 +0300 |
parents | bb1273b1b9b6 |
children | 22ac062b40f7 |
line wrap: on
line diff
--- a/Render.cpp Tue Jul 22 23:07:24 2014 +0200 +++ b/Render.cpp Wed Jul 23 12:58:30 2014 +0300 @@ -740,7 +740,7 @@ unsigned int uFreeVideoMem; // [sp+4B8h] [bp-44h]@14 RenderD3D_aux aux; // [sp+4BCh] [bp-40h]@19 IDirect3D3 *pDirect3D3; // [sp+4C4h] [bp-38h]@18 - int v19; // [sp+4C8h] [bp-34h]@16 + int is_there_a_compatible_screen_mode; // [sp+4C8h] [bp-34h]@16 RenderD3D_D3DDevDesc v20; // [sp+4CCh] [bp-30h]@1 LPDIRECTDRAW pDirectDraw; // [sp+4F4h] [bp-8h]@4 IDirectDraw4 *pDirectDraw4; // [sp+4F8h] [bp-4h]@7 @@ -795,9 +795,9 @@ v10.dwWidth = window->GetHeight(); v10.ddpfPixelFormat.dwSize = 32; - v19 = 0; - if ( FAILED(pDirectDraw4->EnumDisplayModes(0, 0, &v19, (LPDDENUMMODESCALLBACK2)DDrawDisplayModesEnumerator)) - || !v19 + is_there_a_compatible_screen_mode = false; + if ( FAILED(pDirectDraw4->EnumDisplayModes(0, 0, &is_there_a_compatible_screen_mode, (LPDDENUMMODESCALLBACK2)DDrawDisplayModesEnumerator)) + || !is_there_a_compatible_screen_mode || FAILED(pDirectDraw4->QueryInterface(IID_IDirect3D3, (LPVOID *)&pDirect3D3))) { delete [] v20.pDriverName; @@ -905,18 +905,14 @@ } //----- (0049D75C) -------------------------------------------------------- -HRESULT __stdcall DDrawDisplayModesEnumerator(DDSURFACEDESC2 *pSurfaceDesc, __int16 *a2) -{ - HRESULT result; // eax@3 - - if ( pSurfaceDesc->ddsCaps.dwCaps | 0x2000 && pSurfaceDesc->ddpfPixelFormat.dwRGBBitCount == 16 ) - { - *a2 = 1; - result = 0; - } - else - result = 1; - return result; +HRESULT __stdcall DDrawDisplayModesEnumerator(DDSURFACEDESC2 *pSurfaceDesc, __int16 *found_compatible_mode) +{ + if ( pSurfaceDesc->ddsCaps.dwCaps | 0x2000 /*&& pSurfaceDesc->ddpfPixelFormat.dwRGBBitCount == 16*/ ) + { + *found_compatible_mode = 1; + return S_OK; + } + return 1; } //----- (0047A95E) --------------------------------------------------------