diff --git a/engines/dm/champion.h b/engines/dm/champion.h index 2428308c3ebb..4e9e29d9c74e 100644 --- a/engines/dm/champion.h +++ b/engines/dm/champion.h @@ -9,7 +9,7 @@ namespace DM { class Scent { uint16 _scent; public: - Scent(uint16 scent = 0): _scent(scent) {} + explicit Scent(uint16 scent = 0): _scent(scent) {} uint16 getMapX() { return _scent & 0x1F; } uint16 getMapY() { return (_scent >> 5) & 0x1F; } @@ -403,7 +403,7 @@ class ChampionMan { bool _leaderEmptyHanded; // @ G0415_B_LeaderEmptyHanded Party _party; // @ G0407_s_Party - ChampionMan(DMEngine *vm); + explicit ChampionMan(DMEngine *vm); void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame void addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty void drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs diff --git a/engines/dm/dm.h b/engines/dm/dm.h index f2d14c942290..61583a39c1e9 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -62,7 +62,7 @@ class Thing { static const Thing _thingEndOfList; Thing() : _data(0) {} - Thing(uint16 d) { set(d); } + explicit Thing(uint16 d) { set(d); } void set(uint16 d) { _data = d; @@ -88,7 +88,7 @@ class DMEngine : public Engine { void initializeGame(); // @ F0463_START_InitializeGame_CPSADEF void gameloop(); // @ F0002_MAIN_GameLoop_CPSDF public: - DMEngine(OSystem *syst); + explicit DMEngine(OSystem *syst); ~DMEngine(); virtual Common::Error run(); // @ main @@ -120,7 +120,7 @@ class DMEngine : public Engine { class Console : public GUI::Debugger { public: - Console(DMEngine *vm) {} + explicit Console(DMEngine *vm) {} virtual ~Console(void) {} }; diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index 7f6e9666ba79..c5c356e8885e 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -157,7 +157,7 @@ class Door { Thing _nextThing; uint16 _attributes; public: - Door(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} + explicit Door(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} Thing getNextThing() { return _nextThing; } bool isMeleeDestructible() { return (_attributes >> 8) & 1; } bool isMagicDestructible() { return (_attributes >> 7) & 1; } @@ -178,7 +178,7 @@ class Teleporter { uint16 _attributes; uint16 _destMapIndex; public: - Teleporter(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]), _destMapIndex(rawDat[2]) {} + explicit Teleporter(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]), _destMapIndex(rawDat[2]) {} Thing getNextThing() { return _nextThing; } bool makesSound() { return (_attributes >> 15) & 1; } TeleporterScope getScope() { return (TeleporterScope)((_attributes >> 13) & 1); } @@ -195,7 +195,7 @@ class TextString { Thing _nextThing; uint16 _textDataRef; public: - TextString(uint16 *rawDat) : _nextThing(rawDat[0]), _textDataRef(rawDat[1]) {} + explicit TextString(uint16 *rawDat) : _nextThing(rawDat[0]), _textDataRef(rawDat[1]) {} Thing getNextThing() { return _nextThing; } uint16 getWordOffset() { return _textDataRef >> 3; } @@ -249,7 +249,7 @@ class Sensor { uint16 _attributes; uint16 _action; public: - Sensor(uint16 *rawDat) : _nextThing(rawDat[0]), _datAndType(rawDat[1]), _attributes(rawDat[2]), _action(rawDat[3]) {} + explicit Sensor(uint16 *rawDat) : _nextThing(rawDat[0]), _datAndType(rawDat[1]), _attributes(rawDat[2]), _action(rawDat[3]) {} Thing getNextThing() { return _nextThing; } SensorType getType() { return (SensorType)(_datAndType & 0x7F); } // @ M39_TYPE @@ -280,7 +280,7 @@ class Group { uint16 _health[4]; uint16 _attributes; public: - Group(uint16 *rawDat) : _nextThing(rawDat[0]), _possessionID(rawDat[1]), _type(rawDat[2]), + explicit Group(uint16 *rawDat) : _nextThing(rawDat[0]), _possessionID(rawDat[1]), _type(rawDat[2]), _position(rawDat[3]), _attributes(rawDat[8]) { _health[0] = rawDat[4]; _health[1] = rawDat[5]; @@ -307,7 +307,7 @@ class Weapon { Thing _nextThing; uint16 _desc; public: - Weapon(uint16 *rawDat) : _nextThing(rawDat[0]), _desc(rawDat[1]) {} + explicit Weapon(uint16 *rawDat) : _nextThing(rawDat[0]), _desc(rawDat[1]) {} WeaponType getType() { return (WeaponType)(_desc & 0x7F); } bool isLit() { return (_desc >> 15) & 1; } @@ -326,7 +326,7 @@ class Armour { Thing _nextThing; uint16 _attributes; public: - Armour(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} + explicit Armour(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} ArmourType getType() { return (ArmourType)(_attributes & 0x7F); } Thing getNextThing() { return _nextThing; } @@ -336,7 +336,7 @@ class Scroll { Thing _nextThing; uint16 _attributes; public: - Scroll(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} + explicit Scroll(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} void set(Thing next, uint16 attribs) { _nextThing = next; _attributes = attribs; @@ -364,7 +364,7 @@ class Potion { Thing _nextThing; uint16 _attributes; public: - Potion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} + explicit Potion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} PotionType getType() { return (PotionType)((_attributes >> 8) & 0x7F); } Thing getNextThing() { return _nextThing; } @@ -375,7 +375,7 @@ class Container { Thing _nextContainedThing; uint16 _type; public: - Container(uint16 *rawDat) : _nextThing(rawDat[0]), _nextContainedThing(rawDat[1]), _type(rawDat[2]) {} + explicit Container(uint16 *rawDat) : _nextThing(rawDat[0]), _nextContainedThing(rawDat[1]), _type(rawDat[2]) {} uint16 getType() { return (_type >> 1) & 0x3; } Thing getNextContainedThing() { return _nextContainedThing; } @@ -399,7 +399,7 @@ class Junk { Thing _nextThing; uint16 _attributes; public: - Junk(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} + explicit Junk(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} JunkType getType() { return (JunkType)(_attributes & 0x7F); } uint16 getChargeCount() { return (_attributes >> 14) & 0x3; } @@ -414,7 +414,7 @@ class Projectile { byte _damageEnergy; uint16 _timerIndex; public: - Projectile(uint16 *rawDat) : _nextThing(rawDat[0]), _object(rawDat[1]), _kineticEnergy(rawDat[2]), + explicit Projectile(uint16 *rawDat) : _nextThing(rawDat[0]), _object(rawDat[1]), _kineticEnergy(rawDat[2]), _damageEnergy(rawDat[3]), _timerIndex(rawDat[4]) {} Thing getNextThing() { return _nextThing; } @@ -424,7 +424,7 @@ class Explosion { Thing _nextThing; uint16 _attributes; public: - Explosion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} + explicit Explosion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {} Thing getNextThing() { return _nextThing; } }; // @ EXPLOSION @@ -470,8 +470,8 @@ enum SquareType { class Square { byte _data; public: - Square(byte dat = 0) : _data(dat) {} - Square(SquareType type) { setType(type); } + explicit Square(byte dat = 0) : _data(dat) {} + explicit Square(SquareType type) { setType(type); } Square &set(byte dat) { this->_data = dat; return *this; } Square &set(SquareMask mask) { _data |= mask; return *this; } byte get(SquareMask mask) { return _data & mask; } @@ -573,7 +573,7 @@ class DungeonMan { void setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap public: - DungeonMan(DMEngine *dmEngine); + explicit DungeonMan(DMEngine *dmEngine); ~DungeonMan(); Thing getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index f72a985c5805..4b62677474a7 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -197,13 +197,15 @@ class EventManager { void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty public: + explicit EventManager(DMEngine *vm); + MouseInput* _primaryMouseInput;// @ G0441_ps_PrimaryMouseInput MouseInput* _secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput bool _mousePointerBitmapUpdated; // @ G0598_B_MousePointerBitmapUpdated bool _refreshMousePointerInMainLoop; // @ G0326_B_RefreshMousePointerInMainLoop bool _highlightBoxEnabled; // @ G0341_B_HighlightBoxEnabled uint16 _useChampionIconOrdinalAsMousePointerBitmap; // @ G0599_ui_UseChampionIconOrdinalAsMousePointerBitmap - EventManager(DMEngine *vm); + void initMouse(); void showMouse(bool visibility); diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index 38d6630a9664..e2f30f339c52 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -279,7 +279,7 @@ class DisplayMan { // some methods use this for a stratchpad, don't make assumptions about content between function calls byte *_tmpBitmap; - DisplayMan(DMEngine *dmEngine); + explicit DisplayMan(DMEngine *dmEngine); ~DisplayMan(); void loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h index aa75dc0d6dbb..b8fbe516a513 100644 --- a/engines/dm/inventory.h +++ b/engines/dm/inventory.h @@ -21,9 +21,11 @@ enum PanelContent { class InventoryMan { DMEngine *_vm; public: + explicit InventoryMan(DMEngine *vm); + int16 _inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal PanelContent _panelContent; // @ G0424_i_PanelContent - InventoryMan(DMEngine *vm); + void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar diff --git a/engines/dm/loadsave.h b/engines/dm/loadsave.h index 857191200fc6..abedf549085f 100644 --- a/engines/dm/loadsave.h +++ b/engines/dm/loadsave.h @@ -13,13 +13,11 @@ enum LoadgameResponse { class LoadsaveMan { DMEngine *_vm; public: - LoadsaveMan(DMEngine *vm); + explicit LoadsaveMan(DMEngine *vm); LoadgameResponse loadgame(); // @ F0435_STARTEND_LoadGame_CPSF - }; } #endif - diff --git a/engines/dm/menus.h b/engines/dm/menus.h index de0c43ac7412..edaa970bd5f9 100644 --- a/engines/dm/menus.h +++ b/engines/dm/menus.h @@ -9,9 +9,11 @@ namespace DM { class MenuMan { DMEngine *_vm; public: + explicit MenuMan(DMEngine *vm); + bool _shouldRefreshActionArea; // @ G0508_B_RefreshActionArea bool _actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons - MenuMan(DMEngine *vm); + void clearActingChampion(); // @ F0388_MENUS_ClearActingChampion void drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h index 908520c5f00b..dd0150d747bd 100644 --- a/engines/dm/objectman.h +++ b/engines/dm/objectman.h @@ -7,7 +7,8 @@ namespace DM { class ObjectMan { DMEngine *_vm; public: - ObjectMan(DMEngine *vm); + explicit ObjectMan(DMEngine *vm); + IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType IconIndice getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex void extractIconFromBitmap(uint16 iconIndex, byte *srcBitmap); // F0036_OBJECT_ExtractIconFromBitmap