diff options
-rw-r--r-- | engines/dm/champion.cpp | 78 | ||||
-rw-r--r-- | engines/dm/champion.h | 8 | ||||
-rw-r--r-- | engines/dm/dialog.h | 2 | ||||
-rw-r--r-- | engines/dm/dm.h | 4 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 114 | ||||
-rw-r--r-- | engines/dm/group.cpp | 1 | ||||
-rw-r--r-- | engines/dm/sounds.h | 2 |
7 files changed, 108 insertions, 101 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 94d20465e6..9651db678c 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -41,16 +41,6 @@ namespace DM { - -Box gBoxMouth = Box(55, 72, 12, 29); // @ G0048_s_Graphic562_Box_Mouth -Box gBoxEye = Box(11, 28, 12, 29); // @ G0049_s_Graphic562_Box_Eye -Box g54_BoxChampionIcons[4] = { - Box(281, 299, 0, 13), - Box(301, 319, 0, 13), - Box(301, 319, 15, 28), - Box(281, 299, 15, 28)}; -Color g46_ChampionColor[4] = {(Color)7, (Color)11, (Color)8, (Color)14}; - int16 g39_LightPowerToLightAmount[16] = {0, 5, 12, 24, 33, 40, 46, 51, 59, 68, 76, 82, 89, 94, 97, 100}; uint16 gSlotMasks[38] = { // @ G0038_ai_Graphic562_SlotMasks @@ -99,20 +89,37 @@ Box gBoxChampionPortrait = Box(0, 31, 0, 28); // @ G0047_s_Graphic562_Box_Champi const char *g417_baseSkillName[4]; void ChampionMan::initConstants() { - { - static const char *g417_baseSkillName_EN_ANY[4] = {"FIGHTER", "NINJA", "PRIEST", "WIZARD"}; - static const char *g417_baseSkillName_DE_DEU[4] = {"KAEMPFER", "NINJA", "PRIESTER", "MAGIER"}; - static const char *g417_baseSkillName_FR_FRA[4] = {"GUERRIER", "NINJA", "PRETRE", "SORCIER"}; + static const char *g417_baseSkillName_EN_ANY[4] = {"FIGHTER", "NINJA", "PRIEST", "WIZARD"}; + static const char *g417_baseSkillName_DE_DEU[4] = {"KAEMPFER", "NINJA", "PRIESTER", "MAGIER"}; + static const char *g417_baseSkillName_FR_FRA[4] = {"GUERRIER", "NINJA", "PRETRE", "SORCIER"}; + static Box boxChampionIcons[4] = { + Box(281, 299, 0, 13), + Box(301, 319, 0, 13), + Box(301, 319, 15, 28), + Box(281, 299, 15, 28) + }; - const char **g417_byLanguage; - switch (_vm->getGameLanguage()) { // localized - default: - case Common::EN_ANY: g417_byLanguage = g417_baseSkillName_EN_ANY; break; - case Common::DE_DEU: g417_byLanguage = g417_baseSkillName_DE_DEU; break; - case Common::FR_FRA: g417_byLanguage = g417_baseSkillName_FR_FRA; break; - } - for (int i = 0; i < 4; ++i) - g417_baseSkillName[i] = g417_byLanguage[i]; + static Color championColor[4] = {(Color)7, (Color)11, (Color)8, (Color)14}; + + const char **g417_byLanguage; + switch (_vm->getGameLanguage()) { // localized + case Common::EN_ANY: + g417_byLanguage = g417_baseSkillName_EN_ANY; + break; + case Common::DE_DEU: + g417_byLanguage = g417_baseSkillName_DE_DEU; + break; + case Common::FR_FRA: + g417_byLanguage = g417_baseSkillName_FR_FRA; + break; + default: + error("Unexpected language used"); + } + + for (int i = 0; i < 4; ++i) { + g417_baseSkillName[i] = g417_byLanguage[i]; + _championColor[i] = championColor[i]; + _boxChampionIcons[i] = boxChampionIcons[i]; } } @@ -139,9 +146,9 @@ ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) { } bool ChampionMan::f329_isLeaderHandObjectThrown(int16 side) { - if (_g411_leaderIndex == kM1_ChampionNone) { + if (_g411_leaderIndex == kM1_ChampionNone) return false; - } + return f328_isObjectThrown(_g411_leaderIndex, kM1_ChampionSlotLeaderHand, side); } @@ -459,7 +466,7 @@ void ChampionMan::f296_drawChangedObjectIcons() { } } - if (invMan._g424_panelContent = k4_PanelContentChest) { + if (invMan._g424_panelContent == k4_PanelContentChest) { thing = invMan._g425_chestSlots; for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) { drawViewport |= (f295_hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0); @@ -512,7 +519,7 @@ void ChampionMan::f301_addObjectInSlot(ChampionIndex champIndex, Thing thing, Ch } } - if (iconIndex = k4_IconIndiceWeaponTorchUnlit) { + if (iconIndex == k4_IconIndiceWeaponTorchUnlit) { ((Weapon *)rawObjPtr)->setLit(true); _vm->_inventoryMan->f337_setDungeonViewPalette(); f296_drawChangedObjectIcons(); @@ -988,7 +995,7 @@ void ChampionMan::f304_addSkillExperience(uint16 champIndex, uint16 skillIndex, setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics); f292_drawChampionState((ChampionIndex)champIndex); _vm->_textMan->f51_messageAreaPrintLineFeed(); - Color curChampionColor = g46_ChampionColor[champIndex]; + Color curChampionColor = _championColor[champIndex]; _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, curChampion->_name); switch (_vm->getGameLanguage()) { // localized @@ -1449,7 +1456,7 @@ void ChampionMan::f319_championKill(uint16 champIndex) { f323_unpoison(champIndex); _vm->_displayMan->_g578_useByteBoxCoordinates = false; - _vm->_displayMan->D24_fillScreenBox(g54_BoxChampionIcons[curChampionIconIndex], k0_ColorBlack); + _vm->_displayMan->D24_fillScreenBox(_boxChampionIcons[curChampionIconIndex], k0_ColorBlack); f292_drawChampionState((ChampionIndex)champIndex); int16 aliveChampionIndex; @@ -2032,7 +2039,7 @@ void ChampionMan::f287_drawChampionBarGraphs(ChampionIndex champIndex) { if (barGraphHeight) { box._y1 = 27 - barGraphHeight; box._y2 = 26; - _vm->_displayMan->D24_fillScreenBox(box, g46_ChampionColor[champIndex]); + _vm->_displayMan->D24_fillScreenBox(box, _championColor[champIndex]); } box._x1 += 7; box._x2 += 7; @@ -2068,6 +2075,9 @@ uint16 ChampionMan::f309_getMaximumLoad(Champion *champ) { } void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) { + static Box boxMouth = Box(55, 72, 12, 29); // @ G0048_s_Graphic562_Box_Mouth + static Box boxEye = Box(11, 28, 12, 29); // @ G0049_s_Graphic562_Box_Eye + int16 championStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing; Champion *curChampion = &_gK71_champions[champIndex]; uint16 championAttributes = curChampion->_attributes; @@ -2155,7 +2165,7 @@ void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) { else nativeBitmapIndex = k33_SlotBoxNormalIndice; - _vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(nativeBitmapIndex), gBoxMouth, k16_byteWidth, k12_ColorDarkestGray, 18); + _vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(nativeBitmapIndex), boxMouth, k16_byteWidth, k12_ColorDarkestGray, 18); nativeBitmapIndex = k33_SlotBoxNormalIndice; for (int i = k1_ChampionStatStrength; i <= k6_ChampionStatAntifire; i++) { if ((curChampion->_statistics[i][k1_ChampionStatCurrent] < curChampion->_statistics[i][k0_ChampionStatMaximum])) { @@ -2163,7 +2173,7 @@ void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) { break; } } - _vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(nativeBitmapIndex), gBoxEye, k16_byteWidth, k12_ColorDarkestGray, 18); + _vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(nativeBitmapIndex), boxEye, k16_byteWidth, k12_ColorDarkestGray, 18); setFlag(championAttributes, k0x4000_ChampionAttributeViewport); } } @@ -2213,8 +2223,8 @@ void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) { } uint16 championIconIndex = M26_championIconIndex(curChampion->_cell, _vm->_dungeonMan->_g308_partyDir); if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->M0_indexToOrdinal(championIconIndex))) { - _vm->_displayMan->D24_fillScreenBox(g54_BoxChampionIcons[championIconIndex], g46_ChampionColor[champIndex]); - _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_g348_bitmapScreen, g54_BoxChampionIcons[championIconIndex], M26_championIconIndex(curChampion->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen); + _vm->_displayMan->D24_fillScreenBox(_boxChampionIcons[championIconIndex], _championColor[champIndex]); + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_g348_bitmapScreen, _boxChampionIcons[championIconIndex], M26_championIconIndex(curChampion->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen); } if (getFlag(championAttributes, k0x0800_ChampionAttributePanel) && isInventoryChampion) { if (_vm->_g333_pressingMouth) diff --git a/engines/dm/champion.h b/engines/dm/champion.h index 7f726b6fcd..33e2c62e17 100644 --- a/engines/dm/champion.h +++ b/engines/dm/champion.h @@ -38,9 +38,6 @@ namespace DM { #define k0x4000_IgnoreObjectModifiers 0x4000 // @ MASK0x4000_IGNORE_OBJECT_MODIFIERS #define k0x8000_IgnoreTemporaryExperience 0x8000 // @ MASK0x8000_IGNORE_TEMPORARY_EXPERIENCE -extern Box g54_BoxChampionIcons[4]; // @ G0054_ai_Graphic562_Box_ChampionIcons -extern Color g46_ChampionColor[4]; // @ G0046_auc_Graphic562_ChampionColor - extern int16 g39_LightPowerToLightAmount[16]; // @ G0039_ai_Graphic562_LightPowerToLightAmount class Scent { @@ -590,9 +587,12 @@ public: void f331_applyTimeEffects(); // @ F0331_CHAMPION_ApplyTimeEffects_CPSF void save2_PartyPart(Common::OutSaveFile *file); void load2_PartyPart(Common::InSaveFile* file); -}; + Box _boxChampionIcons[4]; + Color _championColor[4]; +}; + } #endif diff --git a/engines/dm/dialog.h b/engines/dm/dialog.h index 2aec5e9735..48a1accb1c 100644 --- a/engines/dm/dialog.h +++ b/engines/dm/dialog.h @@ -54,4 +54,4 @@ public: int16 f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driveType, int16 automaticChoiceIfFlopyInDrive); // @ F0424_DIALOG_GetChoice }; -}
\ No newline at end of file +} diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 9bf2c1521c..d30727b071 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -141,11 +141,7 @@ bool isOrientedWestEast(Direction dir); // @ M16_IS_ORIENTED_WEST_EAST #define setFlag(val, mask) ((val) |= (mask)) - - #define getFlag(val, mask) ((val) & (mask)) - - #define clearFlag(val, mask) ((val) &= (~(mask))) // @ M09_CLEAR uint16 toggleFlag(uint16 &val, uint16 mask); // @ M10_TOGGLE diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 9f0b387bff..f6b9b077b7 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -43,53 +43,6 @@ namespace DM { -unsigned char g42_bitmapArrowPointer[288] = { // @ G0042_auc_Graphic562_Bitmap_ArrowPointer - 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, - 0x78, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, - 0x7F, 0x80, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, - 0x7E, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, - 0x6C, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC0, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, - 0x84, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x40, 0x00, 0x00, 0x83, 0xC0, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0xA9, 0x00, 0x00, 0x00, - 0xC9, 0x00, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, - 0xF0, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, - 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00, - 0xFE, 0x00, 0x00, 0x00, 0xEF, 0x00, 0x00, 0x00, 0xCF, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, - 0x07, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -unsigned char g43_bitmapHanPointer[288] = { // @ G0043_auc_Graphic562_Bitmap_HandPointer - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x6A, 0x00, 0x00, 0x00, - 0x35, 0x40, 0x00, 0x00, 0x1A, 0xA0, 0x00, 0x00, 0x0D, 0x50, 0x00, 0x00, 0x0E, 0xA8, 0x00, 0x00, - 0x07, 0xF8, 0x00, 0x00, 0xC7, 0xFC, 0x00, 0x00, 0x67, 0xFC, 0x00, 0x00, 0x77, 0xFC, 0x00, 0x00, - 0x3F, 0xFC, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x00, - 0x01, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x4A, 0xA0, 0x00, 0x00, 0x25, 0x50, 0x00, 0x00, - 0x12, 0xA8, 0x00, 0x00, 0x11, 0x54, 0x00, 0x00, 0xC8, 0x04, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, - 0x98, 0x02, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, - 0x20, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, - 0x7F, 0xE0, 0x00, 0x00, 0x3F, 0xF0, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x1F, 0xFC, 0x00, 0x00, - 0xCF, 0xFC, 0x00, 0x00, 0xEF, 0xFE, 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x00, - 0x7F, 0xFE, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x1F, 0xFF, 0x00, 0x00, - 0x07, 0xFF, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -Box g462_BoxObjectPiles[4] = { // @ G0462_as_Graphic561_Box_ObjectPiles - /* { X1, X2, Y1, Y2 } */ - Box(24, 111, 148, 168), /* Front left */ - Box(112, 199, 148, 168), /* Front right */ - Box(112, 183, 122, 147), /* Back right */ - Box(40, 111, 122, 147)}; /* Back left */ - - KeyboardInput g458_primaryKeyboardInput_interface[7] = { // @ G0458_as_Graphic561_PrimaryKeyboardInput_Interface /* { Command, Code } */ KeyboardInput(k7_CommandToggleInventoryChampion_0, Common::KEYCODE_F1, 0), /* F1 (<CSI>1~) Atari ST: Code = 0x3B00 */ @@ -445,12 +398,53 @@ void EventManager::f71_mouseDropChampionIcon() { _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->M0_indexToOrdinal(kM1_ChampionNone); _g598_mousePointerBitmapUpdated = true; bool useByteBoxCoordinatesBackup = _vm->_displayMan->_g578_useByteBoxCoordinates; - _vm->_displayMan->f21_blitToScreen(_g613_mousePointerOriginalColorsChampionIcon, &g54_BoxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18); + _vm->_displayMan->f21_blitToScreen(_g613_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18); _vm->_displayMan->_g578_useByteBoxCoordinates = useByteBoxCoordinatesBackup; _gK100_preventBuildPointerScreenArea = false; } void EventManager::f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY) { + static unsigned char bitmapArrowPointer[288] = { // @ G0042_auc_Graphic562_Bitmap_ArrowPointer + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, + 0x7F, 0x80, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, + 0x7E, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, + 0x6C, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xC0, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, + 0x84, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + 0x80, 0x40, 0x00, 0x00, 0x83, 0xC0, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0xA9, 0x00, 0x00, 0x00, + 0xC9, 0x00, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00, + 0xFE, 0x00, 0x00, 0x00, 0xEF, 0x00, 0x00, 0x00, 0xCF, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, + 0x07, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + static unsigned char bitmapHanPointer[288] = { // @ G0043_auc_Graphic562_Bitmap_HandPointer + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x6A, 0x00, 0x00, 0x00, + 0x35, 0x40, 0x00, 0x00, 0x1A, 0xA0, 0x00, 0x00, 0x0D, 0x50, 0x00, 0x00, 0x0E, 0xA8, 0x00, 0x00, + 0x07, 0xF8, 0x00, 0x00, 0xC7, 0xFC, 0x00, 0x00, 0x67, 0xFC, 0x00, 0x00, 0x77, 0xFC, 0x00, 0x00, + 0x3F, 0xFC, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x00, + 0x01, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x4A, 0xA0, 0x00, 0x00, 0x25, 0x50, 0x00, 0x00, + 0x12, 0xA8, 0x00, 0x00, 0x11, 0x54, 0x00, 0x00, 0xC8, 0x04, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, + 0x98, 0x02, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, + 0x20, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x7F, 0xE0, 0x00, 0x00, 0x3F, 0xF0, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x1F, 0xFC, 0x00, 0x00, + 0xCF, 0xFC, 0x00, 0x00, 0xEF, 0xFE, 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x00, + 0x7F, 0xFE, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x1F, 0xFF, 0x00, 0x00, + 0x07, 0xFF, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + // if (_gK100_preventBuildPointerScreenArea) // return; @@ -493,7 +487,7 @@ void EventManager::f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY) _g598_mousePointerBitmapUpdated = false; switch (_gK104_mousePointerType) { case k0_pointerTypeArrow: - setMousePointerFromSpriteData(g42_bitmapArrowPointer); + setMousePointerFromSpriteData(bitmapArrowPointer); break; case k1_pointerTypeObjectIcon: CursorMan.replaceCursor(_g615_mousePointerOriginalColorsObject, 32, 18, 0, 0, 0); @@ -502,7 +496,7 @@ void EventManager::f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY) CursorMan.replaceCursor(_g613_mousePointerOriginalColorsChampionIcon, 32, 18, 0, 0, 0); break; case k3_pointerTypeHand: - setMousePointerFromSpriteData(g43_bitmapHanPointer); + setMousePointerFromSpriteData(bitmapHanPointer); break; } } @@ -1065,6 +1059,14 @@ void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() { } void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY) { + Box boxObjectPiles[4] = { // @ G0462_as_Graphic561_Box_ObjectPiles + /* { X1, X2, Y1, Y2 } */ + Box(24, 111, 148, 168), /* Front left */ + Box(112, 199, 148, 168), /* Front right */ + Box(112, 183, 122, 147), /* Back right */ + Box(40, 111, 122, 147) /* Back left */ + }; + if (_vm->_dungeonMan->_g285_squareAheadElement == k17_DoorFrontElemType) { if (_vm->_championMan->_g411_leaderIndex == kM1_ChampionNone) return; @@ -1101,7 +1103,7 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 Junk *junkPtr = (Junk*)_vm->_dungeonMan->f156_getThingData(thingHandObject); if (_vm->_dungeonMan->_g285_squareAheadElement == k0_ElementTypeWall) { for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k1_ViewCellFrontRight + 1; currViewCell++) { - if (g462_BoxObjectPiles[currViewCell].isPointInside(posX, posY)) { + if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) { f374_processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); return; } @@ -1132,7 +1134,7 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 return; for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k3_ViewCellBackLeft + 1; currViewCell++) { - if (g462_BoxObjectPiles[currViewCell].isPointInside(posX, posY)) { + if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) { f374_processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); return; } @@ -1163,7 +1165,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat box._x2 = box._x1 + 66; dispMan._g578_useByteBoxCoordinates = false; dispMan.D24_fillScreenBox(box, k0_ColorBlack); - dispMan.D24_fillScreenBox(g54_BoxChampionIcons[champMan.M26_championIconIndex(champ->_cell, dunMan._g308_partyDir) * 2], k0_ColorBlack); + dispMan.D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.M26_championIconIndex(champ->_cell, dunMan._g308_partyDir) * 2], k0_ColorBlack); _vm->_menuMan->f457_drawEnabledMenus(); f78_showMouse(); return; @@ -1209,7 +1211,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat _vm->_menuMan->f393_drawSpellAreaControls(champMan._g514_magicCasterChampionIndex); _vm->_textMan->f51_messageAreaPrintLineFeed(); - Color champColor = g46_ChampionColor[championIndex]; + Color champColor = _vm->_championMan->_championColor[championIndex]; _vm->_textMan->f47_messageAreaPrintMessage(champColor, champ->_name); switch (_vm->getGameLanguage()) { // localized @@ -1379,7 +1381,7 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c _vm->_displayMan->_g578_useByteBoxCoordinates = false; byte *tmpBitmap = _gK190_mousePointerTempBuffer; memset(tmpBitmap, 0, 32 * 18); - Box *curChampionIconBox = &g54_BoxChampionIcons[champIconIndex]; + Box *curChampionIconBox = &_vm->_championMan->_boxChampionIcons[champIconIndex]; _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g348_bitmapScreen, tmpBitmap, championIconShadowBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18); _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(tmpBitmap, _g613_mousePointerOriginalColorsChampionIcon, 32, 18, 32, 18, mousePointerIconShadowBox); @@ -1401,7 +1403,7 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c setFlag(_vm->_championMan->_gK71_champions[championIndex]._attributes, k0x0400_ChampionAttributeIcon); _vm->_championMan->f292_drawChampionState((ChampionIndex)championIndex); } else - _vm->_displayMan->D24_fillScreenBox(g54_BoxChampionIcons[championIconIndex], k0_ColorBlack); + _vm->_displayMan->D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[championIconIndex], k0_ColorBlack); _vm->_championMan->_gK71_champions[championCellIndex]._cell = (ViewCell)M21_normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir); setFlag(_vm->_championMan->_gK71_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon); diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 118eea7a02..a66ca0528f 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -292,7 +292,6 @@ int16 GroupMan::f228_getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 sr #define AP0483_i_PrimaryDirection srcMapX int16 L0556_i_Direction; - if (srcMapX == destMapX) { _vm->_projexpl->_g363_secondaryDirToOrFromParty = (_vm->getRandomNumber(65536) & 0x0002) + 1; /* Resulting direction may be 1 or 3 (East or West) */ if (srcMapY > destMapY) { diff --git a/engines/dm/sounds.h b/engines/dm/sounds.h index 6377835a66..8dfb3afa6c 100644 --- a/engines/dm/sounds.h +++ b/engines/dm/sounds.h @@ -90,4 +90,4 @@ public: void f060_SOUND_Play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol) override {} // @ F0060_SOUND_Play }; -}
\ No newline at end of file +} |