# HG changeset patch # User Ritor1 # Date 1360812439 -21600 # Node ID 4b61b82a0bf7422df2d1cc0d499d317bbeff97fe # Parent a0e7ad5425d432fb4dd75d800c56846f66530bbe# Parent 3235bc4cf78e8d647a8910ec978d47d209a82670 Слияние diff -r 3235bc4cf78e -r 4b61b82a0bf7 Keyboard.cpp --- a/Keyboard.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/Keyboard.cpp Thu Feb 14 09:27:19 2013 +0600 @@ -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; } diff -r 3235bc4cf78e -r 4b61b82a0bf7 Outdoor.cpp --- a/Outdoor.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/Outdoor.cpp Thu Feb 14 09:27:19 2013 +0600 @@ -141,7 +141,7 @@ pRenderer->PrepareDecorationsRenderList_ODM(); pRenderer->DrawLayingItems_Shooting_Magic_ODM(); - pRenderer->TransformBillboardsAndSetPalettesODM();//Ritor1: do comment to test + pRenderer->TransformBillboardsAndSetPalettesODM(); sub_485F53((Vec2_int_ *)unnamed_6BE060); } diff -r 3235bc4cf78e -r 4b61b82a0bf7 Render.cpp --- a/Render.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/Render.cpp Thu Feb 14 09:27:19 2013 +0600 @@ -7172,7 +7172,7 @@ if (pRenderD3D) { pGame->draw_debug_outlines(); - DoRenderBillboards_D3D(); //Ritor1: it's temporarily + DoRenderBillboards_D3D(); pGame->pStru6Instance->RenderSpecialEffects(); pRenderD3D->pDevice->EndScene(); } diff -r 3235bc4cf78e -r 4b61b82a0bf7 mm7_2.cpp --- a/mm7_2.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/mm7_2.cpp Thu Feb 14 09:27:19 2013 +0600 @@ -16344,7 +16344,7 @@ UI_CreateTravelDialogue(); } } - UpdateActors_ODM();//Ritor1: it's temporarily + UpdateActors_ODM(); _46CC4B_check_event_triggers(); } diff -r 3235bc4cf78e -r 4b61b82a0bf7 mm7_3.cpp --- a/mm7_3.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/mm7_3.cpp Thu Feb 14 09:27:19 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 diff -r 3235bc4cf78e -r 4b61b82a0bf7 mm7_5.cpp --- a/mm7_5.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/mm7_5.cpp Thu Feb 14 09:27:19 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; diff -r 3235bc4cf78e -r 4b61b82a0bf7 mm7_6.cpp --- a/mm7_6.cpp Thu Feb 14 01:13:46 2013 +0600 +++ b/mm7_6.cpp Thu Feb 14 09:27:19 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; diff -r 3235bc4cf78e -r 4b61b82a0bf7 mm7_data.h --- a/mm7_data.h Thu Feb 14 01:13:46 2013 +0600 +++ b/mm7_data.h Thu Feb 14 09:27:19 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();