diff mm7_6.cpp @ 45:bcc051713d20

BLV render & seffects
author Nomad
date Mon, 22 Oct 2012 20:45:14 +0200
parents e62134245ab0
children 79a30ee1ecdb
line wrap: on
line diff
--- a/mm7_6.cpp	Sun Oct 21 23:26:23 2012 +0600
+++ b/mm7_6.cpp	Mon Oct 22 20:45:14 2012 +0200
@@ -8862,8 +8862,6 @@
 //----- (0042FC4E) --------------------------------------------------------
 void __cdecl ProcessInputActions()
 {
-  Keyboard *v0; // ecx@1
-  signed int _1; // ebx@7
   ActionQueue *pActionQueue; // esi@7
   Keyboard *v3; // ecx@8
   char v4; // al@9
@@ -8889,24 +8887,27 @@
   int v24; // [sp+4h] [bp-4h]@87
 
   pGame->pKeyboardInstance->EnterCriticalSection();
-  v0 = pGame->pKeyboardInstance;
-  if ( !bAlwaysRun )
+  auto pKeyboard = pGame->pKeyboardInstance;
+  if (!bAlwaysRun)
   {
-    if ( v0->IsShiftHeld() )
-      goto _set_running;
-_set_not_running:
-    pParty->uFlags2 &= 0xFFFFFFFDu;
-    goto LABEL_6;
+    if (pKeyboard->IsShiftHeld())
+      pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
+    else
+      pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
+   }
+  else
+  {
+    if (pKeyboard->IsShiftHeld())
+      pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
+    else
+      pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
   }
-  if ( v0->IsShiftHeld() )
-    goto _set_not_running;
-_set_running:
+
   pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
 LABEL_6:
   if ( !pEventTimer->bPaused )
   {
     inputAction = (InputAction)0;
-    _1 = 1;
     pActionQueue = pPartyActionQueue;
     while ( 1 )
     {
@@ -8923,9 +8924,9 @@
           case INPUT_MoveForward:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_move_forward;
-            if ( pTurnEngine->field_4 != _1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+            if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
             {
               pTurnEngine->uActionPointsLeft -= 26;
 _do_move_forward:
@@ -8940,9 +8941,9 @@
           case INPUT_MoveBackwards:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_move_backwards;
-            if ( pTurnEngine->field_4 != _1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+            if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
             {
               pTurnEngine->uActionPointsLeft -= 26;
 _do_move_backwards:
@@ -8957,9 +8958,9 @@
           case INPUT_StrafeLeft:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_strafe_left;
-            if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+            if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
               break;
             pTurnEngine->uActionPointsLeft -= 26;
 _do_strafe_left:
@@ -8968,9 +8969,9 @@
           case INPUT_StrafeRight:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 )
+            if (!pParty->bTurnBasedModeOn)
               goto _do_strafe_right;
-            if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+            if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
               break;
             pTurnEngine->uActionPointsLeft -= 26;
 _do_strafe_right:
@@ -8981,9 +8982,9 @@
               break;
             if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
             {
-              if ( pParty->bTurnBasedModeOn == _1 )
+              if (pParty->bTurnBasedModeOn)
               {
-                if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+                if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
                   break;
                 pTurnEngine->uActionPointsLeft -= 26;
               }
@@ -8994,10 +8995,10 @@
               if ( pParty->uFlags2 & 2 )
                 partyAction_ = PARTY_FastTurnLeft;
               else
-                partyAction_ = (PartyAction)_1;
+                partyAction_ = PARTY_TurnLeft;
             }
             pActionQueue->Add(partyAction_);
-            if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow == _1 )
+            if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = 10;
               goto LABEL_75;
@@ -9008,9 +9009,9 @@
               break;
             if ( GetAsyncKeyState(17) )         // strafing
             {
-              if ( pParty->bTurnBasedModeOn == _1 )
+              if (pParty->bTurnBasedModeOn)
               {
-                if ( pTurnEngine->field_4 == _1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
+                if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
                   break;
                 pTurnEngine->uActionPointsLeft -= 26;
               }
@@ -9024,7 +9025,7 @@
                 v21 = 2;
             }
             pActionQueue->Add((PartyAction)v21);
-            if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow == _1 )
+            if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = -10;
 LABEL_75:
@@ -9033,7 +9034,7 @@
             break;
           case INPUT_Jump:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions
-              || pParty->bTurnBasedModeOn == _1 )
+              || pParty->bTurnBasedModeOn)
               break;
             partyAction = (PartyAction)12;
             goto _add_action_and_continue_;
@@ -9048,7 +9049,7 @@
           case INPUT_Pass:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn == _1 && pTurnEngine->field_4 == 3 )
+            if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
               goto LABEL_118;
             if ( uActiveCharacter )
             {
@@ -9067,25 +9068,25 @@
           case INPUT_Combat:
             if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
             {
-              if ( pParty->bTurnBasedModeOn == _1 )
+              if (pParty->bTurnBasedModeOn)
               {
                 if ( pTurnEngine->field_4 == 3 || (pTurnEngine->pQueue[0].uPackedID & 7) == 4 )
                 {
                   pParty->bTurnBasedModeOn = 0;
-                  pTurnEngine->End(_1);
+                  pTurnEngine->End(true);
                 }
               }
               else
               {
                 pTurnEngine->Start();
-                pParty->bTurnBasedModeOn = _1;
+                pParty->bTurnBasedModeOn = true;
               }
             }
             break;
           case INPUT_CastReady:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn == _1 && pTurnEngine->field_4 == 3 )
+            if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
               goto LABEL_118;
             if ( !uActiveCharacter )
               break;
@@ -9097,7 +9098,6 @@
                   v10 > v7->sMana) )
             {
               pActionQueue = pPartyActionQueue;
-              _1 = 1;
 LABEL_120:
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
               {
@@ -9115,7 +9115,6 @@
                 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
                 ++dword_50C9E8;
               }
-              _1 = 1;
             }
             break;
           default:
@@ -9123,7 +9122,7 @@
           case INPUT_Attack:
             if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
               break;
-            if ( pParty->bTurnBasedModeOn != _1 || pTurnEngine->field_4 != 3 )
+            if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3)
               goto LABEL_120;
 LABEL_118:
             pTurnEngine->field_18 |= 8u;
@@ -9143,8 +9142,8 @@
               {
                 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
                 {
-                  v11 = _1;
-                  pMessageQueue_50CBD0->uNumMessages = _1;
+                  v11 = 1;
+                  pMessageQueue_50CBD0->uNumMessages = 1;
 LABEL_132:
                   pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113;
 _send_message: