From 800100e2bc0a325f81bebc8993e95ded17c6fb76 Mon Sep 17 00:00:00 2001 From: Bendegúz Nagy Date: Tue, 12 Jul 2016 08:36:53 +0200 Subject: DM: Add f260_timelineRefreshAllChampionStatusBoxes --- engines/dm/champion.cpp | 7 +++++++ engines/dm/champion.h | 1 + engines/dm/timeline.cpp | 11 ++++++++++- engines/dm/timeline.h | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index a84ccb811d..1fd31eaa43 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -1189,6 +1189,13 @@ bool ChampionMan::f294_isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint1 return ((L0878_T_Thing.getType() == k5_WeaponThingType) && (L0875_ps_WeaponInfo->_class == L0879_i_WeaponClass)); } +void ChampionMan::f293_drawAllChampionStates() { + int16 L0873_i_ChampionIndex; + for (L0873_i_ChampionIndex = k0_ChampionFirst; L0873_i_ChampionIndex < _vm->_championMan->_g305_partyChampionCount; L0873_i_ChampionIndex++) { + _vm->_championMan->f292_drawChampionState((ChampionIndex)L0873_i_ChampionIndex); + } +} + ChampionIndex ChampionMan::f285_getIndexInCell(int16 cell) { for (uint16 i = 0; i < _g305_partyChampionCount; ++i) { if ((_gK71_champions[i]._cell == cell) && _gK71_champions[i]._currHealth) diff --git a/engines/dm/champion.h b/engines/dm/champion.h index 17686f91f9..35aaff6d6b 100644 --- a/engines/dm/champion.h +++ b/engines/dm/champion.h @@ -523,6 +523,7 @@ public: int16 f310_getMovementTicks(Champion *champ); // @ F0310_CHAMPION_GetMovementTicks bool f294_isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 weaponSlotIndex, uint16 ammunitionSlotIndex); // @ F0294_CHAMPION_IsAmmunitionCompatibleWithWeapon + void f293_drawAllChampionStates(); // @ F0293_CHAMPION_DrawAllChampionStates diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 8141280f63..717870f704 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -355,7 +355,7 @@ T0261048: case k74_TMEventTypePartyShield: _vm->_championMan->_g407_party._shieldDefense -= L0682_s_Event._B._defense; T0261053: - //F0260_TIMELINE_RefreshAllChampionStatusBoxes(); + f260_timelineRefreshAllChampionStatusBoxes(); break; case k77_TMEventTypeSpellShield: _vm->_championMan->_g407_party._spellShieldDefense -= L0682_s_Event._B._defense; @@ -1029,4 +1029,13 @@ void Timeline::f257_timelineProcessEvent70_light(TimelineEvent* event) { _vm->_timeline->f238_addEventGetEventIndex(&L0676_s_Event); } } + +void Timeline::f260_timelineRefreshAllChampionStatusBoxes() { + uint16 L0679_ui_ChampionIndex; + + for (L0679_ui_ChampionIndex = k0_ChampionFirst; L0679_ui_ChampionIndex < _vm->_championMan->_g305_partyChampionCount; L0679_ui_ChampionIndex++) { + setFlag(_vm->_championMan->_gK71_champions[L0679_ui_ChampionIndex]._attributes, k0x1000_ChampionAttributeStatusBox); + } + _vm->_championMan->f293_drawAllChampionStates(); +} } diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h index ed0a5abce3..253bf812ec 100644 --- a/engines/dm/timeline.h +++ b/engines/dm/timeline.h @@ -185,6 +185,7 @@ public: uint16 sourceSlotIndex, int16 destSlotIndex); // @ F0258_TIMELINE_HasWeaponMovedToSlot void f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex); // @ F0254_TIMELINE_ProcessEvent12_HideDamageReceived void f257_timelineProcessEvent70_light(TimelineEvent *event); // @ F0257_TIMELINE_ProcessEvent70_Light + void f260_timelineRefreshAllChampionStatusBoxes(); // @ F0260_TIMELINE_RefreshAllChampionStatusBoxes }; -- cgit v1.2.3