Skip to content

Commit

Permalink
DM: Reorder MenuMan::f392_buildSpellAreaLine, add MenuMan::_gK73_bitm…
Browse files Browse the repository at this point in the history
…apSpellAreaLines
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 1f99dab commit 256c2c1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions engines/dm/TODOs/todo.txt
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions engines/dm/dm.cpp
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
29 changes: 13 additions & 16 deletions engines/dm/menus.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -367,32 +368,28 @@ void MenuMan::f393_drawSpellAreaControls(ChampionIndex champIndex) {
#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) {
Expand Down
1 change: 1 addition & 0 deletions engines/dm/menus.h
Expand Up @@ -79,6 +79,7 @@ class MenuMan {
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

Expand Down

0 comments on commit 256c2c1

Please sign in to comment.