Mercurial > mm7
changeset 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 | 1b6bf88f561b |
children | 22ac062b40f7 94393b73d333 |
files | Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Build/init_win.bat Render.cpp |
diffstat | 3 files changed, 29 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Tue Jul 22 23:07:24 2014 +0200 +++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Wed Jul 23 12:58:30 2014 +0300 @@ -4,6 +4,6 @@ <LocalDebuggerCommand>$(OutDir)$(TargetName)$(TargetExt)</LocalDebuggerCommand> <LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> - <LocalDebuggerCommandArguments>-nomarg,</LocalDebuggerCommandArguments> + <LocalDebuggerCommandArguments>-nomarg -window -nointro -nologo</LocalDebuggerCommandArguments> </PropertyGroup> </Project> \ No newline at end of file
--- a/Build/init_win.bat Tue Jul 22 23:07:24 2014 +0200 +++ b/Build/init_win.bat Wed Jul 23 12:58:30 2014 +0300 @@ -1,5 +1,5 @@ @echo off -set _mm7_install_dir=C:\Program Files\Buka\MMCollection\MM_VII +set _mm7_install_dir=D:\g\mm collection\MM_VII @@ -20,13 +20,27 @@ ver | findstr /i "6\.1\." > nul IF %ERRORLEVEL% EQU 0 goto win_7 +ver | findstr /i "6\.2\." > nul +IF %ERRORLEVEL% EQU 0 goto win_8 + +ver | findstr /i "6\.3\." > nul +IF %ERRORLEVEL% EQU 0 goto win_8_1 + echo Machine OS cannot be determined. goto end +:win_8_1 +echo Win 8.1 +goto win7_init + +:win_8 +echo Win 8 +goto end + :win_7 echo Win 7 +:win7_init reg add HKCU\Environment /f /v "WoMM_MM7_INSTALL_DIR" /t REG_SZ /d "%_mm7_install_dir%" - reg query HKCU\Environment /v "WoMM_MM7_INSTALL_DIR" goto end @@ -37,8 +51,6 @@ :win_xp echo Win XP reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v "WoMM_MM7_INSTALL_DIR" /t REG_SZ /d "%_mm7_install_dir%" - - reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "WoMM_MM7_INSTALL_DIR" goto end
--- 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) --------------------------------------------------------