diff options
author | Bendegúz Nagy | 2016-06-25 21:05:29 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | fc6837b9648797df5bc48cdde1b38e714b86187b (patch) | |
tree | edbeb40cb645ee2b9074d1b6be4082501b538f5d | |
parent | 5893dc7c981a3131882f705a5058a5e4e6af660f (diff) | |
download | scummvm-rg350-fc6837b9648797df5bc48cdde1b38e714b86187b.tar.gz scummvm-rg350-fc6837b9648797df5bc48cdde1b38e714b86187b.tar.bz2 scummvm-rg350-fc6837b9648797df5bc48cdde1b38e714b86187b.zip |
DM: Add F0392_MENUS_BuildSpellAreaLine
-rw-r--r-- | engines/dm/gfx.cpp | 7 | ||||
-rw-r--r-- | engines/dm/gfx.h | 5 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 39 | ||||
-rw-r--r-- | engines/dm/menus.h | 3 |
4 files changed, 52 insertions, 2 deletions
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index f1a93a1c5f..7466cb424a 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -817,7 +817,12 @@ void DisplayMan::blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uin } } -void DisplayMan::blitToScreen(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, + void DisplayMan::blitToBitmap(byte* srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, byte* destBitmap, uint16 destWidth, Box& box, Color transparent, Viewport& viewport) + { + blitToBitmap(srcBitmap, srcWidth, srcX, srcY, destBitmap, destWidth, box._x1, box._x2, box._y1, box._y2, transparent, viewport); + } + + void DisplayMan::blitToScreen(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY, Color transparent, Viewport &viewport) { blitToBitmap(srcBitmap, srcWidth, srcX, srcY, diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index d3e19479d8..209559b827 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -72,7 +72,8 @@ enum GraphicIndice { kFontGraphicIndice = 557, // @ C557_GRAPHIC_FONT kSlotBoxActingHandIndice = 35, // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND kPanelRenameChampionIndice = 27, // @ C027_GRAPHIC_PANEL_RENAME_CHAMPION - kMenuActionAreaIndice = 10 // @ C010_GRAPHIC_MENU_ACTION_AREA + kMenuActionAreaIndice = 10, // @ C010_GRAPHIC_MENU_ACTION_AREA + kMenuSpellAreLinesIndice = 11 // @ C011_GRAPHIC_MENU_SPELL_AREA_LINES }; extern uint16 gPalSwoosh[16]; @@ -336,6 +337,8 @@ public: byte *destBitmap, uint16 destWidth, uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY, Color transparent = kColorNoTransparency, Viewport &viewport = gDefultViewPort); + void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, + byte *destBitmap, uint16 destWidth, Box &box, Color transparent = kColorNoTransparency, Viewport &viewport = gDefultViewPort); void blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHight, byte *destBitmap, int16 destWidth, int16 destHeight, byte *palChange); // @ F0129_VIDEO_BlitShrinkWithPaletteChanges diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 8014a82cca..02a6689292 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -42,10 +42,19 @@ Box gBoxActionArea1ActionMenu = Box(224, 319, 77, 97); // @ G0501_s_Graphic560_ Box gBoxActionArea = Box(224, 319, 77, 121); // @ G0001_s_Graphic562_Box_ActionArea
byte gPalChangesActionAreaObjectIcon[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0}; // @ G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon
+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
+
MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
_refreshActionArea = false;
_actionAreaContainsIcons = false;
_actionDamage = 0;
+ _bitmapSpellAreaLine = new byte[96 * 12];
+}
+
+MenuMan::~MenuMan() {
+ delete[] _bitmapSpellAreaLine;
}
void MenuMan::drawMovementArrows() {
@@ -294,4 +303,34 @@ labelChamp3: warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}
+#define kSpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
+#define kSpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
+
+void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
+ DisplayMan &dispMan = *_vm->_displayMan;
+
+ Champion &champ = _vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex];
+ if (spellAreaBitmapLine == kSpellAreaAvailableSymbols) {
+ dispMan._useByteBoxCoordinates = false;
+ dispMan.blitToBitmap(dispMan.getBitmap(kMenuSpellAreLinesIndice), 96, 0, 12, _bitmapSpellAreaLine, 96, gBoxSpellAreaLine, kColorNoTransparency);
+ int16 x = 1;
+ char c = 96 + (6 * champ._symbolStep);
+ char spellSymbolString[2] = {'\0', '\0'};
+ for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) {
+ spellSymbolString[0] = c++;
+ _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 96, x += 14, 8, kColorCyan, kColorBlack, spellSymbolString, 12);
+ }
+ } 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'};
+ for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) {
+ if ((spellSymbolString[0] = champ._symbols[symbolIndex]) == '\0')
+ break;
+ _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 96, x += 9, 8, kColorCyan, kColorBlack, spellSymbolString, 12);
+ }
+ }
+}
+
}
diff --git a/engines/dm/menus.h b/engines/dm/menus.h index ac2f462bdf..b4006e17b0 100644 --- a/engines/dm/menus.h +++ b/engines/dm/menus.h @@ -51,11 +51,13 @@ class MenuMan { DMEngine *_vm; public: explicit MenuMan(DMEngine *vm); + ~MenuMan(); bool _refreshActionArea; // @ G0508_B_RefreshActionArea bool _actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons int16 _actionDamage; // @ G0513_i_ActionDamage ActionList _actionList; // @ G0713_s_ActionList + byte *_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine void clearActingChampion(); // @ F0388_MENUS_ClearActingChampion void drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon @@ -66,6 +68,7 @@ public: void drawActionArea(); // @ F0387_MENUS_DrawActionArea const char* getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName void drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls + void buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine }; } |