diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp index d7f451bf52d..ecac605b188 100644 --- a/engines/ultima/ultima4/controllers/combat_controller.cpp +++ b/engines/ultima/ultima4/controllers/combat_controller.cpp @@ -106,41 +106,41 @@ CombatController::~CombatController() { } // Accessor Methods -bool CombatController::isCamping() const { +bool CombatController::isCamping() const { return _camping; } -bool CombatController::isWinOrLose() const { +bool CombatController::isWinOrLose() const { return _winOrLose; } -Direction CombatController::getExitDir() const { +Direction CombatController::getExitDir() const { return _exitDir; } -byte CombatController::getFocus() const { +byte CombatController::getFocus() const { return _focus; } -CombatMap *CombatController::getMap() const { +CombatMap *CombatController::getMap() const { return _map; } -Creature *CombatController::getCreature() const { +Creature *CombatController::getCreature() const { return _creature; } -PartyMemberVector *CombatController::getParty() { +PartyMemberVector *CombatController::getParty() { return &_party; } -PartyMember *CombatController::getCurrentPlayer() { +PartyMember *CombatController::getCurrentPlayer() { return _party[_focus]; } -void CombatController::setExitDir(Direction d) { +void CombatController::setExitDir(Direction d) { _exitDir = d; } -void CombatController::setCreature(Creature *m) { +void CombatController::setCreature(Creature *m) { _creature = m; } -void CombatController::setWinOrLose(bool worl) { +void CombatController::setWinOrLose(bool worl) { _winOrLose = worl; } -void CombatController::showCombatMessage(bool show) { +void CombatController::showCombatMessage(bool show) { _showMessage = show; } diff --git a/engines/ultima/ultima4/controllers/combat_controller.h b/engines/ultima/ultima4/controllers/combat_controller.h index 8f9b92f51b9..5e2494fc958 100644 --- a/engines/ultima/ultima4/controllers/combat_controller.h +++ b/engines/ultima/ultima4/controllers/combat_controller.h @@ -237,13 +237,13 @@ public: static MapId mapForTile(const Tile *ground, const Tile *transport, Object *obj); // Getters - bool isDungeonRoom() const { + bool isDungeonRoom() const { return _dungeonRoom; } - bool isAltarRoom() const { + bool isAltarRoom() const { return _altarRoom != VIRT_NONE; } - bool isContextual() const { + bool isContextual() const { return _contextual; } BaseVirtue getAltarRoom() const { @@ -254,10 +254,10 @@ public: void setAltarRoom(BaseVirtue ar) { _altarRoom = ar; } - void setDungeonRoom(bool d) { + void setDungeonRoom(bool d) { _dungeonRoom = d; } - void setContextual(bool c) { + void setContextual(bool c) { _contextual = c; } diff --git a/engines/ultima/ultima4/conversation/conversation.h b/engines/ultima/ultima4/conversation/conversation.h index 3b72b5e930a..68c3ebe68f4 100644 --- a/engines/ultima/ultima4/conversation/conversation.h +++ b/engines/ultima/ultima4/conversation/conversation.h @@ -148,10 +148,10 @@ public: /* * Accessor methods */ - const Common::String &getKeyword() { + const Common::String &getKeyword() { return _keyword; } - Response *getResponse() { + Response *getResponse() { return _response; } @@ -174,53 +174,53 @@ public: /* * Accessor methods */ - const Common::String &getName() const { + const Common::String &getName() const { return _name; } - const Common::String &getPronoun() const { + const Common::String &getPronoun() const { return _pronoun; } - const Common::String &getPrompt() const { + const Common::String &getPrompt() const { return _prompt; } - Response *getIntro(bool familiar = false) { + Response *getIntro(bool familiar = false) { return _intro; } - Response *getLongIntro(bool familiar = false) { + Response *getLongIntro(bool familiar = false) { return _longIntro; } - Response *getDefaultAnswer() { + Response *getDefaultAnswer() { return _defaultAnswer; } - Dialogue::Question *getQuestion() { + Dialogue::Question *getQuestion() { return _question; } /* * Getters */ - void setName(const Common::String &n) { + void setName(const Common::String &n) { _name = n; } - void setPronoun(const Common::String &pn) { + void setPronoun(const Common::String &pn) { _pronoun = pn; } void setPrompt(const Common::String &prompt) { this->_prompt = prompt; } - void setIntro(Response *i) { + void setIntro(Response *i) { _intro = i; } - void setLongIntro(Response *i) { + void setLongIntro(Response *i) { _longIntro = i; } - void setDefaultAnswer(Response *a) { + void setDefaultAnswer(Response *a) { _defaultAnswer = a; } - void setTurnAwayProb(int prob) { + void setTurnAwayProb(int prob) { _turnAwayProb = prob; } - void setQuestion(Question *q) { + void setQuestion(Question *q) { _question = q; } void addKeyword(const Common::String &kw, Response *response); diff --git a/engines/ultima/ultima4/events/event_handler.cpp b/engines/ultima/ultima4/events/event_handler.cpp index b9997946f77..08ec2f23339 100644 --- a/engines/ultima/ultima4/events/event_handler.cpp +++ b/engines/ultima/ultima4/events/event_handler.cpp @@ -92,7 +92,7 @@ void EventHandler::end() { _ended = true; } -TimedEventMgr *EventHandler::getTimer() { +TimedEventMgr *EventHandler::getTimer() { return &_timer; } diff --git a/engines/ultima/ultima4/filesys/filesystem.cpp b/engines/ultima/ultima4/filesys/filesystem.cpp index b6eb55965c5..97cd37ff32a 100644 --- a/engines/ultima/ultima4/filesys/filesystem.cpp +++ b/engines/ultima/ultima4/filesys/filesystem.cpp @@ -77,15 +77,15 @@ Common::String Path::getDir() const { return !node.exists() || node.isDirectory() ? node.getPath() : node.getParent().getPath(); } -Common::String Path::getFilename() const { +Common::String Path::getFilename() const { return (ext.empty()) ? file : file + Common::String(".") + ext; } -Common::String Path::getBaseFilename() const { +Common::String Path::getBaseFilename() const { return file; } -Common::String Path::getExt() const { +Common::String Path::getExt() const { return ext; } diff --git a/engines/ultima/ultima4/filesys/filesystem.h b/engines/ultima/ultima4/filesys/filesystem.h index 5648d43b28a..6a9b14f0f29 100644 --- a/engines/ultima/ultima4/filesys/filesystem.h +++ b/engines/ultima/ultima4/filesys/filesystem.h @@ -60,7 +60,7 @@ public: /** * Returns the full translated path */ - Common::String getPath() const { + Common::String getPath() const { return path; } diff --git a/engines/ultima/ultima4/game/armor.h b/engines/ultima/ultima4/game/armor.h index 23d61628234..ae676b41a1a 100644 --- a/engines/ultima/ultima4/game/armor.h +++ b/engines/ultima/ultima4/game/armor.h @@ -37,13 +37,13 @@ class Armor { friend class Armors; public: // Getters - ArmorType getType() const { + ArmorType getType() const { return _type; /**< Returns the ArmorType of the armor */ } - const Common::String &getName() const { + const Common::String &getName() const { return _name; /**< Returns the name of the armor */ } - int getDefense() const { + int getDefense() const { return _defense; /**< Returns the defense value of the armor */ } /** Returns true if the class given can wear the armor */ diff --git a/engines/ultima/ultima4/game/aura.h b/engines/ultima/ultima4/game/aura.h index 14617b84231..29fc6c9fe49 100644 --- a/engines/ultima/ultima4/game/aura.h +++ b/engines/ultima/ultima4/game/aura.h @@ -44,13 +44,13 @@ public: Aura(); - int getDuration() const { + int getDuration() const { return _duration; } - Aura::Type getType() const { + Aura::Type getType() const { return _type; } - bool isActive() const { + bool isActive() const { return _duration > 0; } @@ -58,10 +58,10 @@ public: void set(Type = NONE, int d = 0); void setType(Type t); - bool operator==(const Type &t) const { + bool operator==(const Type &t) const { return _type == t; } - bool operator!=(const Type &t) const { + bool operator!=(const Type &t) const { return !operator==(t); } diff --git a/engines/ultima/ultima4/game/creature.cpp b/engines/ultima/ultima4/game/creature.cpp index 5bb2a6c82f1..c65cb105fcc 100644 --- a/engines/ultima/ultima4/game/creature.cpp +++ b/engines/ultima/ultima4/game/creature.cpp @@ -237,7 +237,7 @@ void Creature::load(const ConfigElement &conf) { _slowedType = SLOWED_BY_NOTHING; } -bool Creature::isAttackable() const { +bool Creature::isAttackable() const { if (_mAttr & MATTR_NONATTACKABLE) return false; /* can't attack horse transport */ diff --git a/engines/ultima/ultima4/game/game.cpp b/engines/ultima/ultima4/game/game.cpp index 4e6762aecc6..3e242b7a0cf 100644 --- a/engines/ultima/ultima4/game/game.cpp +++ b/engines/ultima/ultima4/game/game.cpp @@ -794,7 +794,7 @@ void mixReagentsSuper() { ReagentShop shops[] = { { "BuccDen", {6, 7, 9, 9, 9, 1} }, { "Moonglo", {2, 5, 6, 3, 6, 9} }, - { "Paws", {3, 4, 2, 8, 6, 7} }, + { "Paws", {3, 4, 2, 8, 6, 7} }, { "SkaraBr", {2, 4, 9, 6, 4, 8} }, }; const int shopcount = sizeof(shops) / sizeof(shops[0]); diff --git a/engines/ultima/ultima4/game/menuitem.cpp b/engines/ultima/ultima4/game/menuitem.cpp index f4dda8eb630..a8b11d0ce1b 100644 --- a/engines/ultima/ultima4/game/menuitem.cpp +++ b/engines/ultima/ultima4/game/menuitem.cpp @@ -36,34 +36,34 @@ MenuItem::MenuItem(Common::String t, short xp, short yp, int sc) : if (sc != -1) addShortcutKey(tolower(_text[sc])); } -int MenuItem::getId() const { +int MenuItem::getId() const { return _id; } -short MenuItem::getX() const { +short MenuItem::getX() const { return x; } -short MenuItem::getY() const { +short MenuItem::getY() const { return y; } -int MenuItem::getScOffset() const { +int MenuItem::getScOffset() const { return _scOffset; } -Common::String MenuItem::getText() const { +Common::String MenuItem::getText() const { return _text; } -bool MenuItem::isHighlighted() const { +bool MenuItem::isHighlighted() const { return _highlighted; } -bool MenuItem::isSelected() const { +bool MenuItem::isSelected() const { return _selected; } -bool MenuItem::isVisible() const { +bool MenuItem::isVisible() const { return _visible; } -const Std::set &MenuItem::getShortcutKeys() const { +const Std::set &MenuItem::getShortcutKeys() const { return _shortcutKeys; } -bool MenuItem::getClosesMenu() const { +bool MenuItem::getClosesMenu() const { return _closesMenu; } diff --git a/engines/ultima/ultima4/game/player.cpp b/engines/ultima/ultima4/game/player.cpp index cb6d4cc8d00..550a1d58ba1 100644 --- a/engines/ultima/ultima4/game/player.cpp +++ b/engines/ultima/ultima4/game/player.cpp @@ -118,7 +118,7 @@ Common::String PartyMember::translate(Std::vector &parts) { return ""; } -int PartyMember::getHp() const { +int PartyMember::getHp() const { return _player->_hp; } @@ -164,19 +164,19 @@ const Weapon *PartyMember::getWeapon() const { return Weapon::get(_player->_weapon); } -const Armor *PartyMember::getArmor() const { +const Armor *PartyMember::getArmor() const { return g_armors->get(_player->armor); } -Common::String PartyMember::getName() const { +Common::String PartyMember::getName() const { return _player->name; } -SexType PartyMember::getSex() const { +SexType PartyMember::getSex() const { return _player->_sex; } -ClassType PartyMember::getClass() const { +ClassType PartyMember::getClass() const { return _player->_class; } diff --git a/engines/ultima/ultima4/game/script.cpp b/engines/ultima/ultima4/game/script.cpp index d3cb708b85f..9fc86e71535 100644 --- a/engines/ultima/ultima4/game/script.cpp +++ b/engines/ultima/ultima4/game/script.cpp @@ -444,28 +444,28 @@ void Script::_continue() { else run(_target); } -void Script::resetState() { +void Script::resetState() { _state = STATE_NORMAL; } -void Script::setState(Script::State s) { +void Script::setState(Script::State s) { _state = s; } -void Script::setTarget(const Common::String &val) { +void Script::setTarget(const Common::String &val) { _target = val; } -void Script::setChoices(const Common::String &val) { +void Script::setChoices(const Common::String &val) { _choices = val; } -void Script::setVar(const Common::String &name, const Common::String &val) { +void Script::setVar(const Common::String &name, const Common::String &val) { removeCurrentVariable(name); _variables[name] = new Variable(val); } -void Script::setVar(const Common::String &name, int val) { +void Script::setVar(const Common::String &name, int val) { removeCurrentVariable(name); _variables[name] = new Variable(val); } @@ -477,11 +477,11 @@ void Script::unsetVar(const Common::String &name) { else _variables[name] = new Variable(); } -Script::State Script::getState() { +Script::State Script::getState() { return _state; } -Common::String Script::getTarget() { +Common::String Script::getTarget() { return _target; } @@ -489,15 +489,15 @@ Script::InputType Script::getInputType() { return _inputType; } -Common::String Script::getChoices() { +Common::String Script::getChoices() { return _choices; } -Common::String Script::getInputName() { +Common::String Script::getInputName() { return _inputName; } -int Script::getInputMaxLen() { +int Script::getInputMaxLen() { return _inputMaxLen; } diff --git a/engines/ultima/ultima4/game/weapon.h b/engines/ultima/ultima4/game/weapon.h index fbb09a77dae..14e5ffc3f4d 100644 --- a/engines/ultima/ultima4/game/weapon.h +++ b/engines/ultima/ultima4/game/weapon.h @@ -57,62 +57,62 @@ public: */ static const Weapon *get(const Common::String &name); - WeaponType getType() const { + WeaponType getType() const { return _type; } - const Common::String &getName() const { + const Common::String &getName() const { return _name; } - const Common::String &getAbbrev() const { + const Common::String &getAbbrev() const { return _abbr; } bool canReady(ClassType klass) const { return (_canUse & (1 << klass)) != 0; } - int getRange() const { + int getRange() const { return _range; } - int getDamage() const { + int getDamage() const { return _damage; } - const Common::String &getHitTile() const { + const Common::String &getHitTile() const { return _hitTile; } - const Common::String &getMissTile() const { + const Common::String &getMissTile() const { return _missTile; } - const Common::String &leavesTile() const { + const Common::String &leavesTile() const { return _leaveTile; } - unsigned short getFlags() const { + unsigned short getFlags() const { return _flags; } - bool loseWhenUsed() const { + bool loseWhenUsed() const { return _flags & WEAP_LOSE; } - bool loseWhenRanged() const { + bool loseWhenRanged() const { return _flags & WEAP_LOSEWHENRANGED; } - bool canChooseDistance() const { + bool canChooseDistance() const { return _flags & WEAP_CHOOSEDISTANCE; } - bool alwaysHits() const { + bool alwaysHits() const { return _flags & WEAP_ALWAYSHITS; } - bool isMagic() const { + bool isMagic() const { return _flags & WEAP_MAGIC; } bool canAttackThroughObjects() const { return _flags & WEAP_ATTACKTHROUGHOBJECTS; } - bool rangeAbsolute() const { + bool rangeAbsolute() const { return _flags & WEAP_ABSOLUTERANGE; } - bool returns() const { + bool returns() const { return _flags & WEAP_RETURNS; } - bool showTravel() const { + bool showTravel() const { return !(_flags & WEAP_DONTSHOWTRAVEL); } diff --git a/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp b/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp index ffddbf1f2db..da5215b3d23 100644 --- a/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp +++ b/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp @@ -67,9 +67,9 @@ Image *FMTOWNSImageLoader::load(Common::File *file, int width, int height, int b // error("FMTOWNS 4bit images cannot handle widths not divisible by 2!"); // byte nibble_mask = 0x0F; // for (int y = 0; y < height; y++) -// { +// { // for (int x = 0; x < width; x+=2) -// { +// { // int byte = raw[(y * width + x) / 2]; // image->putPixelIndex(x ,y,(byte & nibble_mask) << 4); // image->putPixelIndex(x+1,y,(byte ) ); diff --git a/engines/ultima/ultima4/map/dungeonview.cpp b/engines/ultima/ultima4/map/dungeonview.cpp index f5976cc1ca2..50327e6bbf7 100644 --- a/engines/ultima/ultima4/map/dungeonview.cpp +++ b/engines/ultima/ultima4/map/dungeonview.cpp @@ -41,7 +41,7 @@ DungeonView::DungeonView(int x, int y, int columns, int rows) : TileView(x, y, r } DungeonView *DungeonView::getInstance() { - if (!_instance) { + if (!_instance) { _instance = new DungeonView(BORDER_WIDTH, BORDER_HEIGHT, VIEWPORT_W, VIEWPORT_H); } return _instance; diff --git a/engines/ultima/ultima4/map/tile.h b/engines/ultima/ultima4/map/tile.h index 8f30e97a674..8706b463613 100644 --- a/engines/ultima/ultima4/map/tile.h +++ b/engines/ultima/ultima4/map/tile.h @@ -72,46 +72,46 @@ public: */ void loadProperties(const ConfigElement &conf); - TileId getId() const { + TileId getId() const { return _id; } - const Common::String &getName() const { + const Common::String &getName() const { return _name; } - int getWidth() const { + int getWidth() const { return _w; } - int getHeight() const { + int getHeight() const { return _h; } - int getFrames() const { + int getFrames() const { return _frames; } - int getScale() const { + int getScale() const { return _scale; } - TileAnim *getAnim() const { + TileAnim *getAnim() const { return _anim; } Image *getImage(); - const Common::String &getLooksLike() const { + const Common::String &getLooksLike() const { return _looksLike; } - bool isTiledInDungeon() const { + bool isTiledInDungeon() const { return _tiledInDungeon; } - bool isLandForeground() const { + bool isLandForeground() const { return _foreground; } - bool isWaterForeground() const { + bool isWaterForeground() const { return _waterForeground; } - int canWalkOn(Direction d) const { + int canWalkOn(Direction d) const { return DIR_IN_MASK(d, rule->_walkOnDirs); } - int canWalkOff(Direction d) const { + int canWalkOff(Direction d) const { return DIR_IN_MASK(d, rule->_walkOffDirs); } @@ -119,23 +119,23 @@ public: * All tiles that you can walk, swim, or sail on, can be attacked over. All others must declare * themselves */ - int canAttackOver() const { + int canAttackOver() const { return isWalkable() || isSwimable() || isSailable() || (rule->_mask & MASK_ATTACKOVER); } - int canLandBalloon() const { + int canLandBalloon() const { return rule->_mask & MASK_CANLANDBALLOON; } - int isLivingObject() const { + int isLivingObject() const { return rule->_mask & MASK_LIVING_THING; } - int isReplacement() const { + int isReplacement() const { return rule->_mask & MASK_REPLACEMENT; } int isWaterReplacement() const { return rule->_mask & MASK_WATER_REPLACEMENT; } - int isWalkable() const { + int isWalkable() const { return rule->_walkOnDirs > 0; } bool isCreatureWalkable() const { @@ -143,49 +143,49 @@ public: } bool isDungeonWalkable() const; bool isDungeonFloor() const; - int isSwimable() const { + int isSwimable() const { return rule->_movementMask & MASK_SWIMABLE; } - int isSailable() const { + int isSailable() const { return rule->_movementMask & MASK_SAILABLE; } - bool isWater() const { + bool isWater() const { return (isSwimable() || isSailable()); } - int isFlyable() const { + int isFlyable() const { return !(rule->_movementMask & MASK_UNFLYABLE); } - int isDoor() const { + int isDoor() const { return rule->_mask & MASK_DOOR; } - int isLockedDoor() const { + int isLockedDoor() const { return rule->_mask & MASK_LOCKEDDOOR; } - int isChest() const { + int isChest() const { return rule->_mask & MASK_CHEST; } - int isShip() const { + int isShip() const { return rule->_mask & MASK_SHIP; } - bool isPirateShip() const { + bool isPirateShip() const { return _name == "pirate_ship"; } - int isHorse() const { + int isHorse() const { return rule->_mask & MASK_HORSE; } - int isBalloon() const { + int isBalloon() const { return rule->_mask & MASK_BALLOON; } - int canDispel() const { + int canDispel() const { return rule->_mask & MASK_DISPEL; } - int canTalkOver() const { + int canTalkOver() const { return rule->_mask & MASK_TALKOVER; } - TileSpeed getSpeed() const { + TileSpeed getSpeed() const { return rule->_speed; } - TileEffect getEffect() const { + TileEffect getEffect() const { return rule->_effect; } @@ -199,10 +199,10 @@ public: Direction directionForFrame(int frame) const; int frameForDirection(Direction d) const; - static void resetNextId() { + static void resetNextId() { _nextId = 0; } - static bool canTalkOverTile(const Tile *tile) { + static bool canTalkOverTile(const Tile *tile) { return tile->canTalkOver() != 0; } static bool canAttackOverTile(const Tile *tile) { diff --git a/engines/ultima/ultima4/sound/music.h b/engines/ultima/ultima4/sound/music.h index 4225e62b899..e6a9a3e37c3 100644 --- a/engines/ultima/ultima4/sound/music.h +++ b/engines/ultima/ultima4/sound/music.h @@ -95,7 +95,7 @@ public: /** * Stop playing music */ - void stop() { + void stop() { _on = false; stopMid(); } @@ -113,28 +113,28 @@ public: /** * Music when you talk to Lord British */ - void lordBritish() { + void lordBritish() { playMid(RULEBRIT); } /** * Music when you talk to Hawkwind */ - void hawkwind() { + void hawkwind() { playMid(SHOPPING); } /** * Music that plays while camping */ - void camp() { + void camp() { fadeOut(1000); } /** * Music when talking to a vendor */ - void shopping() { + void shopping() { playMid(SHOPPING); } void intro() { diff --git a/engines/ultima/ultima4/sound/sound_p.h b/engines/ultima/ultima4/sound/sound_p.h index 6abe336c2c6..3cd37488d7a 100644 --- a/engines/ultima/ultima4/sound/sound_p.h +++ b/engines/ultima/ultima4/sound/sound_p.h @@ -43,7 +43,7 @@ public: private: bool load(Sound sound); int init_sys(); - void del() { + void del() { del_sys(); } void del_sys();