From 256c2c10f8ba77fd217a974919ae4c896b80277f Mon Sep 17 00:00:00 2001 From: Bendegúz Nagy Date: Tue, 9 Aug 2016 13:46:12 +0200 Subject: DM: Reorder MenuMan::f392_buildSpellAreaLine, add MenuMan::_gK73_bitmapSpellAreaLines --- engines/dm/TODOs/todo.txt | 1 + engines/dm/dm.cpp | 7 +++++-- engines/dm/menus.cpp | 29 +++++++++++++---------------- engines/dm/menus.h | 1 + 4 files changed, 20 insertions(+), 18 deletions(-) (limited to 'engines') diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt index 5017e48671..721507c26c 100644 --- a/engines/dm/TODOs/todo.txt +++ b/engines/dm/TODOs/todo.txt @@ -8,6 +8,7 @@ Bugs: Logic: F0444_STARTEND_Endgame is broken Items thrown on the right side end up on the left side + I'm not sure, but the cooldown between champion actions when fighting monsters seems too muh Possible bugs: diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 3eb323125a..2e53490622 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -241,7 +241,9 @@ void DMEngine::f463_initializeGame() { _displayMan->loadPalette(g21_PalDungeonView[0]); _displayMan->f94_loadFloorSet(k0_FloorSetStone); _displayMan->f95_loadWallSet(k0_WallSetStone); - f503_loadSounds(); + + f503_loadSounds(); // @ F0506_AMIGA_AllocateData + f437_STARTEND_drawTittle(); _textMan->f54_textInitialize(); _objectMan->loadObjectNames(); @@ -251,7 +253,8 @@ void DMEngine::f463_initializeGame() { if (_engineShouldQuit) return; } while (f435_loadgame(1) != k1_LoadgameSuccess); - //F0396_MENUS_LoadSpellAreaLinesBitmap() is not needed, every bitmap has been loaded + + _displayMan->f466_loadIntoBitmap(k11_MenuSpellAreLinesIndice, _menuMan->_gK73_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap // There was some memory wizardy for the Amiga platform, I skipped that part _displayMan->f461_allocateFlippedWallBitmaps(); diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index b69780d2dd..d3c1185217 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -105,6 +105,7 @@ MenuMan::MenuMan(DMEngine *vm) : _vm(vm) { _g513_actionDamage = 0; _g713_actionList.resetToZero(); _gK72_bitmapSpellAreaLine = new byte[96 * 12]; + _gK73_bitmapSpellAreaLines = new byte[3 * 96 * 12]; _g517_actionTargetGroupThing = Thing(0); _g507_actionCount = 0; } @@ -367,32 +368,28 @@ labelChamp3: #define k3_SpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS void MenuMan::f392_buildSpellAreaLine(int16 spellAreaBitmapLine) { - DisplayMan &dispMan = *_vm->_displayMan; - - Champion &champ = _vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex]; + char L1204_ac_SpellSymbolString[2] = {'\0', '\0'}; + Champion *L1203_ps_Champion = &_vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex]; if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) { - dispMan._g578_useByteBoxCoordinates = false; - dispMan.f132_blitToBitmap(dispMan.f489_getNativeBitmapOrGraphic(k11_MenuSpellAreLinesIndice), _gK72_bitmapSpellAreaLine, - gK74_BoxSpellAreaLine, 0, 12, 48, 48, kM1_ColorNoTransparency); + _vm->_displayMan->_g578_useByteBoxCoordinates = false; + _vm->_displayMan->f132_blitToBitmap(_gK73_bitmapSpellAreaLines, _gK72_bitmapSpellAreaLine, gK74_BoxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12); int16 x = 1; - byte c = 96 + (6 * champ._symbolStep); - char spellSymbolString[2] = {'\0', '\0'}; + char character = 96 + (6 * L1203_ps_Champion->_symbolStep); for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) { - spellSymbolString[0] = c++; - _vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 48, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); + L1204_ac_SpellSymbolString[0] = character++; + _vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 48, x += 14, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12); } } else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) { - dispMan._g578_useByteBoxCoordinates = false; - dispMan.f132_blitToBitmap(dispMan.f489_getNativeBitmapOrGraphic(k11_MenuSpellAreLinesIndice), _gK72_bitmapSpellAreaLine, - gK74_BoxSpellAreaLine, 0, 24, 48, 48, kM1_ColorNoTransparency); - char spellSymbolString[2] = {'\0', '\0'}; + _vm->_displayMan->_g578_useByteBoxCoordinates = false; + _vm->_displayMan->f132_blitToBitmap(_gK73_bitmapSpellAreaLines, _gK72_bitmapSpellAreaLine, gK74_BoxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12); int16 x = 8; for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) { - if ((spellSymbolString[0] = champ._symbols[symbolIndex]) == '\0') + if ((L1204_ac_SpellSymbolString[0] = L1203_ps_Champion->_symbols[symbolIndex]) == '\0') break; - _vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 48, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); + _vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 48, x += 9, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12); } } + } void MenuMan::f394_setMagicCasterAndDrawSpellArea(int16 champIndex) { diff --git a/engines/dm/menus.h b/engines/dm/menus.h index 6652fdc291..40bcfbf689 100644 --- a/engines/dm/menus.h +++ b/engines/dm/menus.h @@ -79,6 +79,7 @@ public: int16 _g513_actionDamage; // @ G0513_i_ActionDamage ActionList _g713_actionList; // @ G0713_s_ActionList byte *_gK72_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine + byte *_gK73_bitmapSpellAreaLines; // @ K0073_puc_Bitmap_SpellAreaLines Thing _g517_actionTargetGroupThing; // @ G0517_T_ActionTargetGroupThing uint16 _g507_actionCount; // @ G0507_ui_ActionCount -- cgit v1.2.3