comparison 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
comparison
equal deleted inserted replaced
1249:bbde4964e9b7 1250:c515e406df4a
5637 5637
5638 5638
5639 //----- (004637EB) -------------------------------------------------------- 5639 //----- (004637EB) --------------------------------------------------------
5640 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam) 5640 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam)
5641 { 5641 {
5642 //unsigned int v4; // esi@1
5643 Render *v5; // ecx@14
5644 HANDLE v6; // eax@32 5642 HANDLE v6; // eax@32
5645 Keyboard *v7; // eax@33
5646 //HDC v9; // edi@41
5647 HDC v10; // edi@50 5643 HDC v10; // edi@50
5648 int v11; // esi@50 5644 int v11; // esi@50
5649 //char v12; // zf@132
5650 signed int v13; // eax@135 5645 signed int v13; // eax@135
5651 int v14; // eax@139
5652 int v15; // eax@140
5653 int v16; // eax@141
5654 int v17; // eax@142
5655 int v18; // eax@150
5656 int v19; // eax@151
5657 int v20; // eax@152
5658 int v21; // eax@161
5659 int v22; // eax@162
5660 int v23; // eax@163
5661 int v24; // eax@170
5662 int v25; // eax@171
5663 int v26; // eax@172
5664 char v27; // al@174
5665 //bool v28; // ebx@201
5666 char v29; // dl@209 5646 char v29; // dl@209
5667 char v30; // cl@210
5668 bool v31; // ebx@211 5647 bool v31; // ebx@211
5669 void *v32; // ebx@214
5670 float v33; // ST04_4@246 5648 float v33; // ST04_4@246
5671 float v34; // ST04_4@254 5649 float v34; // ST04_4@254
5672 HWND v35; // [sp+8h] [bp-64h]@103
5673 UINT v36; // [sp+Ch] [bp-60h]@103
5674 WPARAM v37; // [sp+10h] [bp-5Ch]@103
5675 LPARAM v38; // [sp+14h] [bp-58h]@103
5676 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13 5650 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13
5677 int pXY[2]; // [sp+64h] [bp-8h]@261 5651 int pXY[2]; // [sp+64h] [bp-8h]@261
5678 int a2; // [sp+7Ch] [bp+10h]@50 5652 int a2; // [sp+7Ch] [bp+10h]@50
5679 5653
5680 switch (Msg) 5654 switch (Msg)
5908 5882
5909 pArcomageGame->stru1.field_0 = 8; 5883 pArcomageGame->stru1.field_0 = 8;
5910 ArcomageGame::OnMouseClick(1, 1); 5884 ArcomageGame::OnMouseClick(1, 1);
5911 return DefWindowProcA(hWnd, Msg, wParam, lParam); 5885 return DefWindowProcA(hWnd, Msg, wParam, lParam);
5912 case WM_LBUTTONUP: 5886 case WM_LBUTTONUP:
5913 v32 = 0;
5914 if ( !pArcomageGame->bGameInProgress ) 5887 if ( !pArcomageGame->bGameInProgress )
5915 //goto LABEL_218; 5888 //goto LABEL_218;
5916 { 5889 {
5917 back_to_game(); 5890 back_to_game();
5918 return DefWindowProcA(hWnd, Msg, wParam, lParam); 5891 return DefWindowProcA(hWnd, Msg, wParam, lParam);
5919 } 5892 }
5920 pArcomageGame->stru1.field_0 = 3; 5893 pArcomageGame->stru1.field_0 = 3;
5921 ArcomageGame::OnMouseClick(0, 0); 5894 ArcomageGame::OnMouseClick(0, 0);
5922 return DefWindowProcA(hWnd, Msg, wParam, lParam); 5895 return DefWindowProcA(hWnd, Msg, wParam, lParam);
5923 case WM_RBUTTONUP: 5896 case WM_RBUTTONUP:
5924 v32 = 0;
5925 if ( !pArcomageGame->bGameInProgress ) 5897 if ( !pArcomageGame->bGameInProgress )
5926 { 5898 {
5927 //LABEL_218: 5899 //LABEL_218:
5928 5900
5929 back_to_game(); 5901 back_to_game();
5930 return DefWindowProcA(hWnd, Msg, wParam, lParam); 5902 return DefWindowProcA(hWnd, Msg, wParam, lParam);
5931 } 5903 }
5932 pArcomageGame->stru1.field_0 = 4; 5904 pArcomageGame->stru1.field_0 = 4;
5933 v29 = 0; 5905 ArcomageGame::OnMouseClick(1, false);
5934 //goto LABEL_262;
5935 v30 = 1;
5936 ArcomageGame::OnMouseClick(v30, v29 != 0);
5937 return DefWindowProcA(hWnd, Msg, wParam, lParam); 5906 return DefWindowProcA(hWnd, Msg, wParam, lParam);
5938 5907
5939 case WM_LBUTTONDBLCLK: 5908 case WM_LBUTTONDBLCLK:
5940 if ( pArcomageGame->bGameInProgress ) 5909 if ( pArcomageGame->bGameInProgress )
5941 { 5910 {
6030 } 5999 }
6031 if ( Msg > WM_ACTIVATEAPP ) 6000 if ( Msg > WM_ACTIVATEAPP )
6032 { 6001 {
6033 if ( Msg == WM_WINDOWPOSCHANGED ) 6002 if ( Msg == WM_WINDOWPOSCHANGED )
6034 { 6003 {
6035 if (pVideoPlayer) 6004 if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
6036 { 6005 {
6037 if (pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer) 6006 BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
6038 { 6007 }
6039 BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
6040 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6041 }
6042 }
6043 //goto _def_wnd_proc;
6044 return DefWindowProcA(hWnd, Msg, wParam, lParam); 6008 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6045 } 6009 }
6046 if ( Msg != WM_KEYFIRST ) 6010 if ( Msg != WM_KEYFIRST )
6047 { 6011 {
6048 if ( Msg == WM_KEYUP ) 6012 if ( Msg == WM_KEYUP && wParam == VK_CONTROL )
6049 { 6013 {
6050 if ( wParam == VK_CONTROL ) 6014 dword_507B98_ctrl_pressed = 0;
6051 { 6015 }
6052 dword_507B98_ctrl_pressed = 0; 6016 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6053 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6054 }
6055 //goto _def_wnd_proc;
6056 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6057 }
6058 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6059 } 6017 }
6060 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 ) 6018 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
6061 { 6019 {
6062 pKeyActionMap->_459F10(wParam); 6020 pKeyActionMap->_459F10(wParam);
6063 return DefWindowProcA(hWnd, Msg, wParam, lParam); 6021 return DefWindowProcA(hWnd, Msg, wParam, lParam);
6246 return 0; 6204 return 0;
6247 BeginPaint(hWnd, &Paint); 6205 BeginPaint(hWnd, &Paint);
6248 if ( pArcomageGame->bGameInProgress ) 6206 if ( pArcomageGame->bGameInProgress )
6249 { 6207 {
6250 pArcomageGame->field_F9 = 1; 6208 pArcomageGame->field_F9 = 1;
6251 v5 = pRenderer;
6252 } 6209 }
6253 else 6210 else
6254 { 6211 {
6255 if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() ) 6212 if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() )
6256 //goto LABEL_20; 6213 //goto LABEL_20;
6257 { 6214 {
6258 EndPaint(hWnd, &Paint); 6215 EndPaint(hWnd, &Paint);
6259 return 0; 6216 return 0;
6260 } 6217 }
6261 v5 = pRenderer;
6262 } 6218 }
6263 pRenderer->Present(); 6219 pRenderer->Present();
6264 //LABEL_20: 6220 //LABEL_20:
6265 EndPaint(hWnd, &Paint); 6221 EndPaint(hWnd, &Paint);
6266 return 0; 6222 return 0;