changeset 1067:a19cdcaa36fe

merge error
author zipi
date Fri, 24 May 2013 09:33:38 +0100
parents 938af16d5b88
children 6cbf4eb0f953
files mm7_2.cpp
diffstat 1 files changed, 74 insertions(+), 197 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_2.cpp	Fri May 24 08:17:50 2013 +0400
+++ b/mm7_2.cpp	Fri May 24 09:33:38 2013 +0100
@@ -5446,7 +5446,7 @@
 
 //----- (00458244) --------------------------------------------------------
 int SkillToMastery( unsigned int skill_value )
-    {
+{
   switch (skill_value & 0x1C0)
   {
     case 0x100: return 4;     // Grandmaster
@@ -6815,13 +6815,7 @@
 
         case 101:  // Quit game
         case 40001:
-        {
-          v38 = 0;
-          v37 = 0;
-          v36 = 2;
-          v35 = ::hWnd;
-          SendMessageA(::hWnd, WM_DESTROY, v37, v38);
-        }
+          SendMessageA(::hWnd, WM_DESTROY, 0, 0);
         return 0;
 
 
@@ -7192,45 +7186,46 @@
     {
       if ( pVideoPlayer->pVideoFrame.pPixels )
         pVideoPlayer->bStopBeforeSchedule = 1;
-      if ( wParam != VK_RETURN )
-      {
-        if ( wParam == VK_CONTROL )
-        {
-          dword_507B98_ctrl_pressed = 1;
-          return 0;
-        }
-        if ( wParam == VK_ESCAPE )
-        {
-          pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0);
-          return 0;
-        }
-        if ( wParam <= VK_HOME )
+      if ( wParam == VK_RETURN )
+      {
+        if ( !viewparams->field_4C )
+          UI_OnKeyDown(wParam);
+        return 0;
+      }
+      if ( wParam == VK_CONTROL )
+      {
+        dword_507B98_ctrl_pressed = 1;
+        return 0;
+      }
+      if ( wParam == VK_ESCAPE )
+      {
+        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0);
+        return 0;
+      }
+      if ( wParam <= VK_HOME )
+        return 0;
+      if ( wParam > VK_DOWN )
+      {
+        if ( wParam != VK_F4 || pVideoPlayer->AnyMovieLoaded() )
           return 0;
-        if ( wParam > VK_DOWN )
-        {
-          if ( wParam != VK_F4 || pVideoPlayer->AnyMovieLoaded() )
-            return 0;
-          v38 = 0;
-          v37 = 104;
-//LABEL_126:
-          v36 = 273;
-          v35 = hWnd;
-          SendMessageA(hWnd, WM_COMMAND, v37, v38);
+        SendMessageA(hWnd, WM_COMMAND, 104, 0);
+        return 0;
+      }
+      if ( wParam >= VK_LEFT && wParam <= VK_DOWN )
+      {
+        if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE )
+        {
+          if ( !viewparams->field_4C )
+            UI_OnKeyDown(wParam);
           return 0;
         }
-        if ( pCurrentScreen != SCREEN_GAME
-          && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE )
-          return 0;
-      }
-      if ( !viewparams->field_4C )
-        UI_OnKeyDown(wParam);
-      return 0;
+      }
+      if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE )
+        return 0;
     }
     pArcomageGame->stru1.field_0 = 1;
     if ( (unsigned __int16)GetAsyncKeyState(VK_SHIFT) >> 8 >= 0 )
-    {
       v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u);
-    }
     else
     {
       v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u);
@@ -7238,8 +7233,7 @@
       {
         if ( v13 > 61 )
         {
-          v24 = v13 - 91;
-          if ( !v24 )
+          if ( v13 == 91 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 123;
             //goto LABEL_181;
@@ -7259,16 +7253,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v25 = v24 - 1;
-          if ( !v25 )
+          if ( v13 == 92 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 124;
             //goto LABEL_181;
@@ -7288,16 +7276,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v26 = v25 - 1;
-          if ( !v26 )
+          if ( v13 == 93 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 125;
             //goto LABEL_181;
@@ -7317,15 +7299,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          if ( v26 == 3 )
+          if ( v13 == 96 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 126;
             //goto LABEL_181;
@@ -7345,12 +7322,7 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
         }
@@ -7376,16 +7348,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v21 = v13 - 55;
-          if ( !v21 )
+          if ( v13 == 55 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 38;
             //goto LABEL_181;
@@ -7405,16 +7371,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v22 = v21 - 1;
-          if ( !v22 )
+          if ( v13 == 56 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 42;
             //goto LABEL_181;
@@ -7434,16 +7394,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v23 = v22 - 1;
-          if ( !v23 )
+          if ( v13 == 57 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 40;
             //goto LABEL_181;
@@ -7463,15 +7417,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          if ( v23 == 2 )
+          if ( v13 == 59 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 58;
             //goto LABEL_181;
@@ -7491,12 +7440,7 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
         }
@@ -7523,18 +7467,12 @@
             //goto _def_wnd_proc;
             return DefWindowProcA(hWnd, Msg, wParam, lParam);
           }
-          v38 = 0;
-          v37 = 103;
-          //goto LABEL_126;
-          v36 = 273;
-          v35 = hWnd;
-          SendMessageA(hWnd, WM_COMMAND, v37, v38);
+          SendMessageA(hWnd, WM_COMMAND, 103, 0);
           return 0;
         }
         if ( v13 > 49 )
         {
-          v18 = v13 - 50;
-          if ( !v18 )
+          if ( v13 == 50 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 64;
             //goto LABEL_181;
@@ -7554,16 +7492,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v19 = v18 - 1;
-          if ( !v19 )
+          if ( v13 == 51 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 35;
             //goto LABEL_181;
@@ -7583,16 +7515,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v20 = v19 - 1;
-          if ( !v20 )
+          if ( v13 == 52 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 36;
             //goto LABEL_181;
@@ -7612,15 +7538,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          if ( v20 == 1 )
+          if ( v13 == 53 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 37;
             //goto LABEL_181;
@@ -7640,12 +7561,7 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
         }
@@ -7671,16 +7587,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v14 = v13 - 39;
-          if ( !v14 )
+          if ( v13 == 39 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 34;
             //goto LABEL_181;
@@ -7700,16 +7610,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v15 = v14 - 5;
-          if ( !v15 )
+          if ( v13 == 44 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 60;
             //goto LABEL_181;
@@ -7729,16 +7633,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v16 = v15 - 2;
-          if ( !v16 )
+          if ( v13 == 46 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 62;
             //goto LABEL_181;
@@ -7758,16 +7656,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          v17 = v16 - 1;
-          if ( !v17 )
+          if ( v13 == 47 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 63;
             //goto LABEL_181;
@@ -7787,15 +7679,10 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
-          if ( v17 == 1 )
+          if ( v13 == 48 )
           {
             LOBYTE(pArcomageGame->stru1.field_8) = 41;
 //LABEL_181:
@@ -7815,12 +7702,7 @@
               //goto _def_wnd_proc;
               return DefWindowProcA(hWnd, Msg, wParam, lParam);
             }
-            v38 = 0;
-            v37 = 103;
-            //goto LABEL_126;
-            v36 = 273;
-            v35 = hWnd;
-            SendMessageA(hWnd, WM_COMMAND, v37, v38);
+            SendMessageA(hWnd, WM_COMMAND, 103, 0);
             return 0;
           }
         }
@@ -7845,12 +7727,7 @@
       //goto _def_wnd_proc;
       return DefWindowProcA(hWnd, Msg, wParam, lParam);
     }
-    v38 = 0;
-    v37 = 103;
-    //goto LABEL_126;
-    v36 = 273;
-    v35 = hWnd;
-    SendMessageA(hWnd, WM_COMMAND, v37, v38);
+    SendMessageA(hWnd, WM_COMMAND, 103, 0);
     return 0;
   }
   if ( Msg == WM_ACTIVATEAPP )
@@ -9040,7 +8917,7 @@
     switch ( uTurnSpeed )
     {
       case 0: // undefined turn option
-        //__debugbreak(); // really shouldn't use this mode
+        __debugbreak(); // really shouldn't use this mode
         uTurnSpeed = (unsigned int)uCPUSpeed < 199 ? 128 : 64; // adjust turn speed to estimated fps
       break;