changeset 163:a0e7ad5425d4

14.02.13
author Ritor1
date Thu, 14 Feb 2013 09:27:09 +0600
parents 3a8e7802f241
children 4b61b82a0bf7
files Keyboard.cpp mm7_3.cpp mm7_5.cpp mm7_6.cpp mm7_data.h
diffstat 5 files changed, 112 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/Keyboard.cpp	Wed Feb 13 09:52:42 2013 +0600
+++ b/Keyboard.cpp	Thu Feb 14 09:27:09 2013 +0600
@@ -816,12 +816,12 @@
   }
   if ( a1 == VK_LEFT )
   {
-    v3 = ascii_4E2D48;
+    v3 = "LEFT";
     goto LABEL_53;
   }
   if ( a1 == VK_RIGHT )
   {
-    v3 = ascii_4E2D40;
+    v3 = "RIGHT";
     goto LABEL_53;
   }
   if ( a1 == VK_RETURN )
@@ -970,6 +970,7 @@
 {
   void *v2; // esi@2
   char v3; // bl@2
+  bool result;
 
   if (bUsingAsynKeyboard)
   {
@@ -982,7 +983,9 @@
     return v3;*/
   }
   else
-    return (GetAsyncKeyState(vKey) & 0x8001) != 0;
+    //return (GetAsyncKeyState(vKey) & 0x8001) != 0;
+    result = GetAsyncKeyState(vKey);
+  return result;
 }
 
 //----- (0045B0CE) --------------------------------------------------------
@@ -992,7 +995,7 @@
   char v3; // bl@2
   bool result; // eax@2
 
-  if ( LOBYTE(this->bUsingAsynKeyboard) )
+  if ( this->bUsingAsynKeyboard )
   {
     __debugbreak();
     /*v2 = pAsyncKeyboard;
@@ -1003,8 +1006,8 @@
   }
   else
   {
-    LOWORD(result) = GetAsyncKeyState(vKey);
-    LOBYTE(result) = result & 1;
+    result = GetAsyncKeyState(vKey);
+    //LOBYTE(result) = result & 1;
   }
   return result;
 }
--- a/mm7_3.cpp	Wed Feb 13 09:52:42 2013 +0600
+++ b/mm7_3.cpp	Thu Feb 14 09:27:09 2013 +0600
@@ -14028,7 +14028,7 @@
 
 
 //----- (00442955) --------------------------------------------------------
-int __fastcall DrawSpellbook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074)
+int __fastcall DrawBook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074)
 {
   int v5; // ebx@1
   int v6; // edi@1
--- a/mm7_5.cpp	Wed Feb 13 09:52:42 2013 +0600
+++ b/mm7_5.cpp	Thu Feb 14 09:27:09 2013 +0600
@@ -14136,7 +14136,7 @@
   dword_506538 = 0;
   dword_50653C = 0;
   dword_506540 = 0;
-  DrawSpellbook_Map_sub(97, 49, 361, 313, 0);
+  DrawBook_Map_sub(97, 49, 361, 313, 0);
   pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr);
   v22.uFrameWidth = 460;
   v22.uFrameHeight = 344;
--- a/mm7_6.cpp	Wed Feb 13 09:52:42 2013 +0600
+++ b/mm7_6.cpp	Thu Feb 14 09:27:09 2013 +0600
@@ -8943,17 +8943,29 @@
             if ( pCurrentScreen )
               break;
             if (!pParty->bTurnBasedModeOn)
-              goto _do_move_forward;
-            if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+              //goto _do_move_forward;
             {
-              pTurnEngine->uActionPointsLeft -= 26;
-_do_move_forward:
               v5 = pActionQueue;
               if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
                 partyAction = PARTY_RunForward;
               else
                 partyAction = PARTY_WalkForward;
-              goto _add_action_and_continue;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
+            }
+            if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
+            {
+              pTurnEngine->uActionPointsLeft -= 26;
+//_do_move_forward:
+              v5 = pActionQueue;
+              if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
+                partyAction = PARTY_RunForward;
+              else
+                partyAction = PARTY_WalkForward;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
             }
             break;
           case INPUT_MoveBackwards:
@@ -8968,7 +8980,9 @@
                 partyAction = PARTY_RunBackward;
               else
                 partyAction = PARTY_WalkBackward;
-              goto _add_action_and_continue;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
             }
             if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
             {
@@ -8979,7 +8993,9 @@
                 partyAction = PARTY_RunBackward;
               else
                 partyAction = PARTY_WalkBackward;
-              goto _add_action_and_continue;
+              //goto _add_action_and_continue;
+              v5->Add(partyAction);
+              break;
             }
             break;
           case INPUT_StrafeLeft:
@@ -8990,14 +9006,20 @@
               //goto _do_strafe_left;
             {
               partyAction = PARTY_StrafeLeft;
-              goto _add_action_and_continue_;
+              //goto _add_action_and_continue_;
+              v5 = pActionQueue;
+              v5->Add(partyAction);
+              break;
             }
             if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
               break;
             pTurnEngine->uActionPointsLeft -= 26;
 //_do_strafe_left:
             partyAction = PARTY_StrafeLeft;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+              v5 = pActionQueue;
+              v5->Add(partyAction);
+              break;
           case INPUT_StrafeRight:
             //__debugbreak();
             if ( pCurrentScreen )
@@ -9006,14 +9028,20 @@
               //goto _do_strafe_right;
             {
               partyAction = PARTY_StrafeRight;
-              goto _add_action_and_continue_;
+              //goto _add_action_and_continue_;
+              v5 = pActionQueue;
+              v5->Add(partyAction);
+              break;
             }
             if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
               break;
             pTurnEngine->uActionPointsLeft -= 26;
 //_do_strafe_right:
             partyAction = PARTY_StrafeRight;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_TurnLeft:
             if ( pCurrentScreen )
               break;
@@ -9038,7 +9066,9 @@
             if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = 10;
-              goto LABEL_75;
+              //goto LABEL_75;
+              pWeather->_4C2F0B(v20);
+              break;
             }
             break;
           case INPUT_TurnRight:
@@ -9065,7 +9095,7 @@
             if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
             {
               v20 = -10;
-LABEL_75:
+//LABEL_75:
               pWeather->_4C2F0B(v20);
             }
             break;
@@ -9075,7 +9105,10 @@
               || pParty->bTurnBasedModeOn)
               break;
             partyAction = (PartyAction)12;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_Yell:
             //__debugbreak();
             if ( !pCurrentScreen
@@ -9152,7 +9185,11 @@
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
               {
                 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23;
-                goto _send_message;
+                //goto _send_message;
+                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+                *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+                ++pMessageQueue_50CBD0->uNumMessages;
+                break;
               }
             }
             else
@@ -9182,7 +9219,11 @@
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
                 break;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404;
-              goto _send_message;
+              //goto _send_message;
+              pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+              *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+              ++pMessageQueue_50CBD0->uNumMessages;
+              break;
             }
             if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
             {
@@ -9193,9 +9234,9 @@
                 {
                   v11 = 1;
                   pMessageQueue_50CBD0->uNumMessages = 1;
-LABEL_132:
+//LABEL_132:
                   pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113;
-_send_message:
+//_send_message:
                   pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
                   *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                   ++pMessageQueue_50CBD0->uNumMessages;
@@ -9205,7 +9246,14 @@
                 pMessageQueue_50CBD0->uNumMessages = 0;
               }
               if ( (signed int)v11 < 40 )
-                goto LABEL_132;
+                //goto LABEL_132;
+              {
+                pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113;
+                pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
+                *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
+                ++pMessageQueue_50CBD0->uNumMessages;
+                break;
+              }
             }
             break;
           case INPUT_CharCycle:
@@ -9214,48 +9262,67 @@
               || dword_50C9E8 >= 40 )
               break;
             dword_50C9EC[3 * dword_50C9E8] = 176;
-            goto LABEL_155;
+            //goto LABEL_155;
+            dword_50C9F0[3 * dword_50C9E8] = 0;
+            *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
+            ++dword_50C9E8;
+            break;
           case INPUT_LookUp:
             //__debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)7;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_CenterView:
             //__debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)9;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_LookDown:
             //__debugbreak();
             if ( pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)8;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_FlyUp:
             //__debugbreak();
             if ( pCurrentScreen
               || pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)13;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_Land:
             //__debugbreak();
             if ( pCurrentScreen
               || pEventTimer->bPaused )
               break;
             partyAction = (PartyAction)15;
-            goto _add_action_and_continue_;
+            //goto _add_action_and_continue_;
+            v5 = pActionQueue;
+            v5->Add(partyAction);
+            break;
           case INPUT_FlyDown:
             //__debugbreak();
             if ( !pCurrentScreen
               && !pEventTimer->bPaused )
             {
               partyAction = (PartyAction)14;
-_add_action_and_continue_:
+//_add_action_and_continue_:
               v5 = pActionQueue;
-_add_action_and_continue:
+//_add_action_and_continue:
               v5->Add(partyAction);
             }
             break;
@@ -9264,13 +9331,17 @@
             if ( dword_50C9E8 >= 40 )
               break;
             dword_50C9EC[3 * dword_50C9E8] = 367;
-            goto LABEL_155;
+            //goto LABEL_155;
+            dword_50C9F0[3 * dword_50C9E8] = 0;
+            *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
+            ++dword_50C9E8;
+            break;
           case INPUT_ZoomOut:
             //__debugbreak();
             if ( dword_50C9E8 < 40 )
             {
               dword_50C9EC[3 * dword_50C9E8] = 368;
-LABEL_155:
+//LABEL_155:
               dword_50C9F0[3 * dword_50C9E8] = 0;
               *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
               ++dword_50C9E8;
--- a/mm7_data.h	Wed Feb 13 09:52:42 2013 +0600
+++ b/mm7_data.h	Thu Feb 14 09:27:09 2013 +0600
@@ -2001,7 +2001,7 @@
 void GameUI_DrawPartySpells();
 __int16 __fastcall sub_441A4E(int a1);
 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap);
-int __fastcall DrawSpellbook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074); // idb
+int __fastcall DrawBook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074); // idb
 int __cdecl Initialize2DA();
 unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize);
 void __cdecl Initialize_GlobalEVT();