diff options
author | Bendegúz Nagy | 2016-06-27 19:40:13 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | bcd7c1d763e9ad8e5455808bcb7a6d5614035914 (patch) | |
tree | bfc19e8ef307990b0bc7af3a8194cd328d373a37 /engines | |
parent | 72506aebba96dec6e709a6efc8577ebee40407f9 (diff) | |
download | scummvm-rg350-bcd7c1d763e9ad8e5455808bcb7a6d5614035914.tar.gz scummvm-rg350-bcd7c1d763e9ad8e5455808bcb7a6d5614035914.tar.bz2 scummvm-rg350-bcd7c1d763e9ad8e5455808bcb7a6d5614035914.zip |
DM: Fix possible bug in MenuMan::setMagicCasterAndDrawSpellArea
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dm/menus.cpp | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 47c35b926d..dfbe5b564e 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -45,7 +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);
+Box gBoxSpellArea = Box(224, 319, 77, 121);
MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
_refreshActionArea = false;
@@ -315,7 +315,7 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) { dispMan._useByteBoxCoordinates = false;
dispMan.blitToBitmap(dispMan.getBitmap(kMenuSpellAreLinesIndice), 96, 0, 12, _bitmapSpellAreaLine, 96, gBoxSpellAreaLine, kColorNoTransparency);
int16 x = 1;
- char c = 96 + (6 * champ._symbolStep);
+ byte c = 96 + (6 * champ._symbolStep);
char spellSymbolString[2] = {'\0', '\0'};
for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) {
spellSymbolString[0] = c++;
@@ -324,8 +324,8 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) { } else if (spellAreaBitmapLine == kSpellAreaChampionSymbols) {
dispMan._useByteBoxCoordinates = false;
dispMan.blitToBitmap(dispMan.getBitmap(kMenuSpellAreLinesIndice), 96, 0, 24, _bitmapSpellAreaLine, 96, gBoxSpellAreaLine, kColorNoTransparency);
- int16 x = 8;
char spellSymbolString[2] = {'\0', '\0'};
+ int16 x = 8;
for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) {
if ((spellSymbolString[0] = champ._symbols[symbolIndex]) == '\0')
break;
@@ -334,35 +334,34 @@ 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;
- }
+void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) {
+ ChampionMan &champMan = *_vm->_championMan;
+ DisplayMan &dispMan = *_vm->_displayMan;
- champMan._magicCasterChampionIndex = champIndex;
- buildSpellAreaLine(kSpellAreaAvailableSymbols);
+ if ((champIndex == champMan._magicCasterChampionIndex)
+ || ((champIndex != kChampionNone) && !champMan._champions[champIndex]._currHealth))
+ return;
+ if (champMan._magicCasterChampionIndex == kChampionNone) {
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);
+ 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 = (ChampionIndex)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");
+}
}
|