# HG changeset patch # User Ritor1 # Date 1406109993 -21600 # Node ID 22ac062b40f7fd33e382e739c109cd4e1c712181 # Parent d922225a608117289af808d1ab8baa4a60735026# Parent 255168c31655a1497edc1bb05e5bb8aa0214819c Слияние diff -r d922225a6081 -r 22ac062b40f7 Build/Visual Studio 2012/World of Might and Magic.vcxproj.user --- 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 @@ $(OutDir)$(TargetName)$(TargetExt) $(OutDir) WindowsLocalDebugger - -nomarg, + -nomarg -window -nointro -nologo \ No newline at end of file diff -r d922225a6081 -r 22ac062b40f7 Build/init_win.bat --- 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 diff -r d922225a6081 -r 22ac062b40f7 Render.cpp --- 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) --------------------------------------------------------