Mercurial > mm7
changeset 2426:22ac062b40f7
Слияние
author | Ritor1 |
---|---|
date | Wed, 23 Jul 2014 16:06:33 +0600 |
parents | d922225a6081 (current diff) 255168c31655 (diff) |
children | c99c99439f6c 1e1b2728b3d3 |
files | 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 Wed Jul 23 16:06:17 2014 +0600 +++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Wed Jul 23 16:06:33 2014 +0600 @@ -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 Wed Jul 23 16:06:17 2014 +0600 +++ b/Build/init_win.bat Wed Jul 23 16:06:33 2014 +0600 @@ -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 Wed Jul 23 16:06:17 2014 +0600 +++ b/Render.cpp Wed Jul 23 16:06:33 2014 +0600 @@ -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) --------------------------------------------------------