changeset 2444:c59a8fddb5e8

Слияние
author Ritor1
date Wed, 23 Jul 2014 17:36:56 +0600
parents 1e1b2728b3d3 (current diff) c99c99439f6c (diff)
children 063d194e0881
files mm7_2.cpp
diffstat 3 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MMT.cpp	Wed Jul 23 17:34:47 2014 +0600
+++ b/MMT.cpp	Wed Jul 23 17:36:56 2014 +0600
@@ -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);
--- a/Registry.cpp	Wed Jul 23 17:34:47 2014 +0600
+++ b/Registry.cpp	Wed Jul 23 17:36:56 2014 +0600
@@ -8,11 +8,11 @@
 #include <windows.h>
 
 #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);
--- a/mm7_2.cpp	Wed Jul 23 17:34:47 2014 +0600
+++ b/mm7_2.cpp	Wed Jul 23 17:36:56 2014 +0600
@@ -1719,7 +1719,7 @@
   else
     pGame->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS;
 
-  uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0);
+  uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 3);
 
   if (!bNoSound)
     pAudioPlayer->Initialize();