diff mm7_2.cpp @ 1250:c515e406df4a

aWinProc cleanup - removing unused vars, unnesting conditions, removeing a few DefWindowProcA calls
author Grumpy7
date Mon, 10 Jun 2013 04:16:49 +0200
parents bbde4964e9b7
children b9747d9e9b4e
line wrap: on
line diff
--- a/mm7_2.cpp	Mon Jun 10 03:57:16 2013 +0200
+++ b/mm7_2.cpp	Mon Jun 10 04:16:49 2013 +0200
@@ -5639,40 +5639,14 @@
 //----- (004637EB) --------------------------------------------------------
 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam)
 {
-  //unsigned int v4; // esi@1
-  Render *v5; // ecx@14
   HANDLE v6; // eax@32
-  Keyboard *v7; // eax@33
-  //HDC v9; // edi@41
   HDC v10; // edi@50
   int v11; // esi@50
-  //char v12; // zf@132
   signed int v13; // eax@135
-  int v14; // eax@139
-  int v15; // eax@140
-  int v16; // eax@141
-  int v17; // eax@142
-  int v18; // eax@150
-  int v19; // eax@151
-  int v20; // eax@152
-  int v21; // eax@161
-  int v22; // eax@162
-  int v23; // eax@163
-  int v24; // eax@170
-  int v25; // eax@171
-  int v26; // eax@172
-  char v27; // al@174
-  //bool v28; // ebx@201
   char v29; // dl@209
-  char v30; // cl@210
   bool v31; // ebx@211
-  void *v32; // ebx@214
   float v33; // ST04_4@246
   float v34; // ST04_4@254
-  HWND v35; // [sp+8h] [bp-64h]@103
-  UINT v36; // [sp+Ch] [bp-60h]@103
-  WPARAM v37; // [sp+10h] [bp-5Ch]@103
-  LPARAM v38; // [sp+14h] [bp-58h]@103
   struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13
   int pXY[2]; // [sp+64h] [bp-8h]@261
   int a2; // [sp+7Ch] [bp+10h]@50
@@ -5910,7 +5884,6 @@
         ArcomageGame::OnMouseClick(1, 1);
         return DefWindowProcA(hWnd, Msg, wParam, lParam);
       case WM_LBUTTONUP:
-        v32 = 0;
         if ( !pArcomageGame->bGameInProgress )
           //goto LABEL_218;
         {
@@ -5921,7 +5894,6 @@
         ArcomageGame::OnMouseClick(0, 0);
         return DefWindowProcA(hWnd, Msg, wParam, lParam);
       case WM_RBUTTONUP:
-        v32 = 0;
         if ( !pArcomageGame->bGameInProgress )
         {
 //LABEL_218:
@@ -5930,10 +5902,7 @@
           return DefWindowProcA(hWnd, Msg, wParam, lParam);
         }
         pArcomageGame->stru1.field_0 = 4;
-        v29 = 0;
-        //goto LABEL_262;
-        v30 = 1;
-        ArcomageGame::OnMouseClick(v30, v29 != 0);
+        ArcomageGame::OnMouseClick(1, false);
         return DefWindowProcA(hWnd, Msg, wParam, lParam);
 
       case WM_LBUTTONDBLCLK:
@@ -6032,30 +6001,19 @@
   {
     if ( Msg == WM_WINDOWPOSCHANGED )
     {
-      if (pVideoPlayer)
-      {
-        if (pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
-        {
-          BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
-          return DefWindowProcA(hWnd, Msg, wParam, lParam);
-        }
-      }
-      //goto _def_wnd_proc;
+      if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
+      {
+        BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
+      }
       return DefWindowProcA(hWnd, Msg, wParam, lParam);
     }
     if ( Msg != WM_KEYFIRST )
     {
-      if ( Msg == WM_KEYUP )
-      {
-        if ( wParam == VK_CONTROL )
-        {
-          dword_507B98_ctrl_pressed = 0;
-          return DefWindowProcA(hWnd, Msg, wParam, lParam);
-        }
-        //goto _def_wnd_proc;
-        return DefWindowProcA(hWnd, Msg, wParam, lParam);
-      }
-        return DefWindowProcA(hWnd, Msg, wParam, lParam);
+      if ( Msg == WM_KEYUP && wParam == VK_CONTROL )
+      {
+        dword_507B98_ctrl_pressed = 0;
+      }
+      return DefWindowProcA(hWnd, Msg, wParam, lParam);
     }
     if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
     {
@@ -6248,7 +6206,6 @@
       if ( pArcomageGame->bGameInProgress )
       {
         pArcomageGame->field_F9 = 1;
-        v5 = pRenderer;
       }
       else
       {
@@ -6258,7 +6215,6 @@
           EndPaint(hWnd, &Paint);
           return 0;
         }
-        v5 = pRenderer;
       }
       pRenderer->Present();
 //LABEL_20: