# HG changeset patch # User a.parshin # Date 1406111310 -10800 # Node ID 94393b73d333dba6ab2210eaeb098dbe901a9b9d # Parent 255168c31655a1497edc1bb05e5bb8aa0214819c * Some initialization stuff diff -r 255168c31655 -r 94393b73d333 MMT.cpp --- a/MMT.cpp Wed Jul 23 12:58:30 2014 +0300 +++ b/MMT.cpp Wed Jul 23 13:28:30 2014 +0300 @@ -182,8 +182,8 @@ pGUIWindow2 = 0; pAudioPlayer->StopChannels(-1, -1);//остановить/подготовить канал - if (!bNoSound ) - PlayAudio(L"Sounds\\New_Sounds/Stronghold_Theme.mp3");//воспроизводим мп3 + //if (!bNoSound ) + // PlayAudio(L"Sounds\\New_Sounds/Stronghold_Theme.mp3");//воспроизводим мп3 //if (!bNoVideo ) //pVideoPlayer->PlayMovie(L"Anims\\New_Video/3DOLOGO.smk"); @@ -215,7 +215,9 @@ pTexture_PCX.Release(); sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx");//загружаем pcx из папки - pTexture_PCX.LoadPCXFile(pContainerName, 0); + if (pTexture_PCX.LoadPCXFile(pContainerName, 0) == 1) + Error("File not found: %s", pContainerName); + SetCurrentMenuID(MENU_MMT_MAIN_MENU);//Добавлено в enum MENU_STATE в GUIWindows.h SetForegroundWindow(window->GetApiHandle()); SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); diff -r 255168c31655 -r 94393b73d333 Registry.cpp --- a/Registry.cpp Wed Jul 23 12:58:30 2014 +0300 +++ b/Registry.cpp Wed Jul 23 13:28:30 2014 +0300 @@ -8,11 +8,11 @@ #include #include "Registry.h" +#include "ErrorHandling.h" //----- (004649EF) -------------------------------------------------------- int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue) { - int v3; // [sp+4h] [bp-24h]@1 DWORD cbData; // [sp+8h] [bp-20h]@1 LPCSTR lpValueName; // [sp+Ch] [bp-1Ch]@1 DWORD dwDisposition; // [sp+10h] [bp-18h]@2 @@ -22,7 +22,6 @@ HKEY v10; // [sp+20h] [bp-8h]@1 HKEY v11; // [sp+24h] [bp-4h]@1 - v3 = uDefValue; lpValueName = pKey; v11 = 0; v10 = 0; @@ -37,9 +36,13 @@ { if ( !RegCreateKeyExA(v10, "1.0", 0, "", 0, 0xF003Fu, 0, &v11, &dwDisposition) ) { - if ( RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) ) + LSTATUS status; + if ( status = RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) ) { - *(int *)Data = v3; + status; + GetLastError(); + + *(int *)Data = uDefValue; RegSetValueExA(v11, lpValueName, 0, 4u, Data, 4u); } RegCloseKey(v11); diff -r 255168c31655 -r 94393b73d333 mm7_2.cpp --- a/mm7_2.cpp Wed Jul 23 12:58:30 2014 +0300 +++ b/mm7_2.cpp Wed Jul 23 13:28:30 2014 +0300 @@ -1719,7 +1719,7 @@ else pGame->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS; - uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0); + uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 3); if (!bNoSound) pAudioPlayer->Initialize();