diff options
| author | Bendegúz Nagy | 2016-06-26 00:39:44 +0200 |
|---|---|---|
| committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
| commit | 72506aebba96dec6e709a6efc8577ebee40407f9 (patch) | |
| tree | ab9a7a96c2bb3351eff51687383316e91edf0f9b | |
| parent | fc6837b9648797df5bc48cdde1b38e714b86187b (diff) | |
| download | scummvm-rg350-72506aebba96dec6e709a6efc8577ebee40407f9.tar.gz scummvm-rg350-72506aebba96dec6e709a6efc8577ebee40407f9.tar.bz2 scummvm-rg350-72506aebba96dec6e709a6efc8577ebee40407f9.zip | |
DM: Add MenuMan::setMagicCasterAndDrawSpellArea
| -rw-r--r-- | engines/dm/eventman.cpp | 2 | ||||
| -rw-r--r-- | engines/dm/gfx.h | 3 | ||||
| -rw-r--r-- | engines/dm/menus.cpp | 32 | ||||
| -rw-r--r-- | engines/dm/menus.h | 4 |
4 files changed, 38 insertions, 3 deletions
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 9ebda0fbb0..4e5a59cb91 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -673,7 +673,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane if (champMan._partyChampionCount == 1) { warning("MISSING CODE: setting time, G0362_l_LastPartyMovementTime , G0313_ul_GameTime"); commandSetLeader(kChampionFirst); - warning("MISSING CODE: F0394_MENUS_SetMagicCasterAndDrawSpellArea"); + _vm->_menuMan->setMagicCasterAndDrawSpellArea(kChampionFirst); } else { _vm->_menuMan->drawSpellAreaControls(champMan._magicCasterChampionIndex); } diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index 209559b827..9354b99de3 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -73,7 +73,8 @@ enum GraphicIndice { kSlotBoxActingHandIndice = 35, // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND kPanelRenameChampionIndice = 27, // @ C027_GRAPHIC_PANEL_RENAME_CHAMPION kMenuActionAreaIndice = 10, // @ C010_GRAPHIC_MENU_ACTION_AREA - kMenuSpellAreLinesIndice = 11 // @ C011_GRAPHIC_MENU_SPELL_AREA_LINES + kMenuSpellAreLinesIndice = 11, // @ C011_GRAPHIC_MENU_SPELL_AREA_LINES + kMenuSpellAreaBackground = 9 // @ C009_GRAPHIC_MENU_SPELL_AREA_BACKGROUND }; extern uint16 gPalSwoosh[16]; diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 02a6689292..47c35b926d 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -45,6 +45,7 @@ byte gPalChangesActionAreaObjectIcon[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Box gBoxSpellAreaLine = Box(0, 95, 0, 11); // @ K0074_s_Box_SpellAreaLine
Box gBoxSpellAreaLine2 = Box(224, 319, 50, 61); // @ K0075_s_Box_SpellAreaLine2
Box gBoxSpellAreaLine3 = Box(224, 319, 62, 73); // @ K0076_s_Box_SpellAreaLine3
+Box gBoxSpellArea = Box(224, 319, 77, 121);
MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
_refreshActionArea = false;
@@ -333,4 +334,35 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) { }
}
+ void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex)
+ {
+ ChampionMan &champMan = *_vm->_championMan;
+ DisplayMan &dispMan = *_vm->_displayMan;
+
+ if((champIndex == champMan._magicCasterChampionIndex)
+ || ((champIndex != kChampionNone) && !champMan._champions[champIndex]._currHealth))
+ return;
+ if (champMan._magicCasterChampionIndex == kChampionNone) {
+ warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
+ dispMan.blitToScreen(dispMan.getBitmap(kMenuSpellAreaBackground), 96, 0, 0, gBoxSpellArea);
+ warning("MISSING CODE: F0078_MOUSE_ShowPointer");
+ }
+ if (champIndex == kChampionNone) {
+ champMan._magicCasterChampionIndex = kChampionNone;
+ warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
+ dispMan._useByteBoxCoordinates = false;
+ dispMan.clearScreenBox(kColorBlack, gBoxSpellArea);
+ warning("MISSING CODE: F0078_MOUSE_ShowPointer");
+ return;
+ }
+
+ champMan._magicCasterChampionIndex = champIndex;
+ buildSpellAreaLine(kSpellAreaAvailableSymbols);
+ warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
+ drawSpellAreaControls((ChampionIndex)champIndex);
+ dispMan.blitToScreen(_bitmapSpellAreaLine, 96, 0, 0, gBoxSpellAreaLine2);
+ buildSpellAreaLine(kSpellAreaChampionSymbols);
+ dispMan.blitToScreen(_bitmapSpellAreaLine, 96, 0, 0, gBoxSpellAreaLine3);
+ warning("MISSING CODE: F0078_MOUSE_ShowPointer");
+ }
}
diff --git a/engines/dm/menus.h b/engines/dm/menus.h index b4006e17b0..a8df73531f 100644 --- a/engines/dm/menus.h +++ b/engines/dm/menus.h @@ -33,7 +33,8 @@ namespace DM { -extern Box gBoxActionArea; +extern Box gBoxActionArea; // @ G0001_s_Graphic562_Box_ActionArea +extern Box gBoxSpellArea; // @ G0000_s_Graphic562_Box_SpellArea class ActionList { public: @@ -69,6 +70,7 @@ public: const char* getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName void drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls void buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine + void setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea }; } |
