diff options
Diffstat (limited to 'engines')
43 files changed, 522 insertions, 515 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp index 51f288c595..2ab532938b 100644 --- a/engines/xeen/character.cpp +++ b/engines/xeen/character.cpp @@ -78,9 +78,6 @@ void InventoryItems::clear() { operator[](idx).clear(); } -/** -* Return whether a given item passes class-based usage restrictions -*/ bool InventoryItems::passRestrictions(int itemId, bool showError) const { CharacterClass charClass = _character->_class; @@ -117,9 +114,6 @@ bool InventoryItems::passRestrictions(int itemId, bool showError) const { return false; } -/** - * Return the bare name of a given inventory item - */ Common::String InventoryItems::getName(int itemIndex) { int id = operator[](itemIndex)._id; return _names[id]; @@ -143,9 +137,6 @@ Common::String InventoryItems::getIdentifiedDetails(int itemIndex) { return getAttributes(item, classes); } -/** - * Discard an item from the inventory - */ bool InventoryItems::discardItem(int itemIndex) { XeenItem &item = operator[](itemIndex); XeenEngine *vm = Party::_vm; @@ -167,9 +158,6 @@ bool InventoryItems::discardItem(int itemIndex) { return true; } -/** - * Sorts the items list, removing any empty item slots to the end of the array - */ void InventoryItems::sort() { for (uint idx = 0; idx < size(); ++idx) { if (operator[](idx)._id == 0) { @@ -189,9 +177,6 @@ void InventoryItems::sort() { } } -/** - * Un-equips the given item - */ void InventoryItems::removeItem(int itemIndex) { XeenItem &item = operator[](itemIndex); XeenEngine *vm = Party::_vm; @@ -228,19 +213,12 @@ void InventoryItems::enchantItem(int itemIndex, int amount) { ErrorScroll::show(vm, Common::String::format(NOT_ENCHANTABLE, SPELL_FAILED)); } -/** - * Return if the given inventory items list is full - */ bool InventoryItems::isFull() const { return operator[](size() - 1)._id != 0; } - /*------------------------------------------------------------------------*/ -/** - * Equip a given weapon - */ void WeaponItems::equipItem(int itemIndex) { XeenItem &item = operator[](itemIndex); @@ -291,10 +269,6 @@ void WeaponItems::equipItem(int itemIndex) { } } -/** - * Assembles a full lines description for a specified item for use in - * the Items dialog - */ Common::String WeaponItems::getFullDescription(int itemIndex, int displayNum) { XeenItem &i = operator[](itemIndex); Resources &res = *getVm()->_resources; @@ -377,9 +351,6 @@ Common::String WeaponItems::getAttributes(XeenItem &item, const Common::String & /*------------------------------------------------------------------------*/ -/** - * Equip a given piece of armor - */ void ArmorItems::equipItem(int itemIndex) { XeenItem &item = operator[](itemIndex); @@ -458,10 +429,6 @@ void ArmorItems::equipItem(int itemIndex) { } } -/** - * Assembles a full lines description for a specified item for use in - * the Items dialog - */ Common::String ArmorItems::getFullDescription(int itemIndex, int displayNum) { XeenItem &i = operator[](itemIndex); Resources &res = *getVm()->_resources; @@ -531,9 +498,6 @@ Common::String ArmorItems::getAttributes(XeenItem &item, const Common::String &c /*------------------------------------------------------------------------*/ -/** - * Equip a given accessory - */ void AccessoryItems::equipItem(int itemIndex) { XeenItem &item = operator[](itemIndex); @@ -582,10 +546,6 @@ void AccessoryItems::equipItem(int itemIndex) { } } -/** - * Assembles a full lines description for a specified item for use in - * the Items dialog - */ Common::String AccessoryItems::getFullDescription(int itemIndex, int displayNum) { XeenItem &i = operator[](itemIndex); Resources &res = *getVm()->_resources; @@ -632,10 +592,6 @@ Common::String AccessoryItems::getAttributes(XeenItem &item, const Common::Strin /*------------------------------------------------------------------------*/ -/** - * Assembles a full lines description for a specified item for use in - * the Items dialog - */ Common::String MiscItems::getFullDescription(int itemIndex, int displayNum) { XeenItem &i = operator[](itemIndex); Resources &res = *getVm()->_resources; @@ -681,9 +637,6 @@ InventoryItems &InventoryItemsGroup::operator[](ItemCategory category) { return *_itemSets[category]; } -/** - * Breaks all the items in a given character's inventory - */ void InventoryItemsGroup::breakAllItems() { for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) { if ((*_itemSets[0])[idx]._id != 34) { @@ -848,9 +801,6 @@ void Character::synchronize(Common::Serializer &s) { s.syncAsByte(_currentCombatSpell); } -/** - * Returns the worst condition the character is suffering from - */ Condition Character::worstCondition() const { for (int cond = ERADICATED; cond >= CURSED; --cond) { if (_conditions[cond]) @@ -860,9 +810,6 @@ Condition Character::worstCondition() const { return NO_CONDITION; } -/** - * Returns whether the given character has a disabling condition, but still alive - */ bool Character::isDisabled() const { Condition condition = worstCondition(); @@ -870,27 +817,18 @@ bool Character::isDisabled() const { || condition == STONED || condition == ERADICATED; } -/** -* Returns whether the given character has a disabling condition, or is dead -*/ bool Character::isDisabledOrDead() const { Condition condition = worstCondition(); return condition == ASLEEP || (condition >= PARALYZED && condition <= ERADICATED); } -/** - * Returns whether the given character has a dead condition - */ bool Character::isDead() const { Condition condition = worstCondition(); return condition >= DEAD && condition <= ERADICATED; } -/** - * Get the character's age - */ int Character::getAge(bool ignoreTemp) const { int year = MIN(Party::_vm->_party->_year - _birthYear, (uint)254); @@ -967,9 +905,6 @@ int Character::getMaxSP() const { return result; } -/** - * Get the effective value of a given stat for the character - */ uint Character::getStat(Attribute attrib, bool baseOnly) const { AttributePair attr; int mode = 0; @@ -1024,10 +959,6 @@ uint Character::getStat(Attribute attrib, bool baseOnly) const { return MAX(attr._permanent, (uint)0); } -/** - * Return the color number to use for a given stat value in the character - * info or quick reference dialogs - */ int Character::statColor(int amount, int threshold) { if (amount < 1) return 6; @@ -1136,9 +1067,6 @@ int Character::getArmorClass(bool baseOnly) const { return MAX(result, 0); } -/** - * Returns the thievery skill level, adjusted by class and race - */ int Character::getThievery() const { int result = getCurrentLevel() * 2; @@ -1258,9 +1186,6 @@ int Character::itemScan(int itemId) const { return result; } -/** - * Modifies a passed attribute value based on player's condition - */ int Character::conditionMod(Attribute attrib) const { if (_conditions[DEAD] || _conditions[STONED] || _conditions[ERADICATED]) return 0; @@ -1829,9 +1754,6 @@ int Character::makeItem(int p1, int itemIndex, int p3) { return category; } -/** - * Add hit points to a character - */ void Character::addHitPoints(int amount) { Interface &intf = *Party::_vm->_interface; Common::fill(&intf._charFX[0], &intf._charFX[MAX_ACTIVE_PARTY], 0); @@ -1852,9 +1774,6 @@ void Character::addHitPoints(int amount) { Common::fill(&intf._charFX[0], &intf._charFX[MAX_ACTIVE_PARTY], 0); } -/** - * Remove hit points fromo the character - */ void Character::subtractHitPoints(int amount) { SoundManager &sound = *Party::_vm->_sound; _currentHp -= amount; diff --git a/engines/xeen/character.h b/engines/xeen/character.h index 83198a1d8d..903d8faabc 100644 --- a/engines/xeen/character.h +++ b/engines/xeen/character.h @@ -124,24 +124,42 @@ public: void clear(); + /** + * Return whether a given item passes class-based usage restrictions + */ bool passRestrictions(int itemId, bool showError) const; + /** + * Return the bare name of a given inventory item + */ Common::String getName(int itemIndex); virtual Common::String getFullDescription(int itemIndex, int displayNum = 15) = 0; Common::String getIdentifiedDetails(int itemIndex); + /** + * Discard an item from the inventory + */ bool discardItem(int itemIndex); virtual void equipItem(int itemIndex) {} + /** + * Un-equips the given item + */ void removeItem(int itemIndex); + /** + * Sorts the items list, removing any empty item slots to the end of the array + */ void sort(); virtual void enchantItem(int itemIndex, int amount); + /** + * Return if the given inventory items list is full + */ bool isFull() const; }; @@ -152,8 +170,15 @@ public: WeaponItems(Character *character) : InventoryItems(character, CATEGORY_WEAPON) {} virtual ~WeaponItems() {} + /** + * Equip a given weapon + */ virtual void equipItem(int itemIndex); + /** + * Assembles a full lines description for a specified item for use in + * the Items dialog + */ virtual Common::String getFullDescription(int itemIndex, int displayNum); virtual void enchantItem(int itemIndex, int amount); @@ -166,8 +191,15 @@ public: ArmorItems(Character *character) : InventoryItems(character, CATEGORY_ARMOR) {} virtual ~ArmorItems() {} + /** + * Equip a given piece of armor + */ virtual void equipItem(int itemIndex); + /** + * Assembles a full lines description for a specified item for use in + * the Items dialog + */ virtual Common::String getFullDescription(int itemIndex, int displayNum); virtual void enchantItem(int itemIndex, int amount); @@ -179,8 +211,15 @@ protected: public: AccessoryItems(Character *character) : InventoryItems(character, CATEGORY_ACCESSORY) {} + /** + * Equip a given accessory + */ virtual void equipItem(int itemIndex); + /** + * Assembles a full lines description for a specified item for use in + * the Items dialog + */ virtual Common::String getFullDescription(int itemIndex, int displayNum); }; @@ -191,6 +230,10 @@ public: MiscItems(Character *character) : InventoryItems(character, CATEGORY_MISC) {} virtual ~MiscItems() {} + /** + * Assembles a full lines description for a specified item for use in + * the Items dialog + */ virtual Common::String getFullDescription(int itemIndex, int displayNum); }; @@ -203,6 +246,9 @@ public: InventoryItems &operator[](ItemCategory category); + /** + * Breaks all the items in a given character's inventory + */ void breakAllItems(); }; @@ -218,6 +264,9 @@ public: class Character { private: + /** + * Modifies a passed attribute value based on player's condition + */ int conditionMod(Attribute attrib) const; public: Common::String _name; @@ -275,22 +324,44 @@ public: void synchronize(Common::Serializer &s); + /** + * Returns the worst condition the character is suffering from + */ Condition worstCondition() const; + /** + * Returns whether the given character has a disabling condition, but still alive + */ bool isDisabled() const; + /** + * Returns whether the given character has a disabling condition, or is dead + */ bool isDisabledOrDead() const; + /** + * Returns whether the given character has a dead condition + */ bool isDead() const; + /** + * Get the character's age + */ int getAge(bool ignoreTemp = false) const; int getMaxHP() const; int getMaxSP() const; + /** + * Get the effective value of a given stat for the character + */ uint getStat(Attribute attrib, bool baseOnly = false) const; + /** + * Return the color number to use for a given stat value in the character + * info or quick reference dialogs + */ static int statColor(int amount, int threshold); int statBonus(uint statValue) const; @@ -305,6 +376,9 @@ public: int getArmorClass(bool baseOnly = false) const; + /** + * Returns the thievery skill level, adjusted by class and race + */ int getThievery() const; uint getCurrentLevel() const; @@ -327,8 +401,14 @@ public: int makeItem(int p1, int itemIndex, int p3); + /** + * Add hit points to a character + */ void addHitPoints(int amount); + /** + * Remove hit points fromo the character + */ void subtractHitPoints(int amount); bool hasSpecialItem() const; diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index c8cece7b10..3faff3d157 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -256,9 +256,6 @@ loop: } } -/** - * Do damage to a specific character - */ void Combat::doCharDamage(Character &c, int charNum, int monsterDataIndex) { EventsManager &events = *_vm->_events; Interface &intf = *_vm->_interface; @@ -664,9 +661,6 @@ void Combat::setupMonsterAttack(int monsterDataIndex, const Common::Point &pt) { } } -/** - * Determines whether a given monster can move - */ bool Combat::monsterCanMove(const Common::Point &pt, int wallShift, int xDiff, int yDiff, int monsterId) { Map &map = *_vm->_map; @@ -709,9 +703,6 @@ bool Combat::monsterCanMove(const Common::Point &pt, int wallShift, } } -/** - * Moves a monster by a given delta amount if it's a valid move - */ void Combat::moveMonster(int monsterId, const Common::Point &moveDelta) { Map &map = *_vm->_map; MazeMonster &monster = map._mobData._monsters[monsterId]; @@ -1062,9 +1053,6 @@ int Combat::stopAttack(const Common::Point &diffPt) { } } -/** - * Setup the combat party with a copy of the currently active party - */ void Combat::setupCombatParty() { Party &party = *_vm->_party; @@ -1123,9 +1111,6 @@ void Combat::setSpeedTable() { } } -/** - * Returns true if all participants in the combat are disabled - */ bool Combat::allHaveGone() const { for (uint idx = 0; idx < _charsGone.size(); ++idx) { if (!_charsGone[idx]) { @@ -1142,9 +1127,6 @@ bool Combat::allHaveGone() const { return true; } -/** - * Returns true if all the characters of the party are disabled - */ bool Combat::charsCantAct() const { for (uint idx = 0; idx < _combatParty.size(); ++idx) { if (!_combatParty[idx]->isDisabledOrDead()) @@ -1154,9 +1136,6 @@ bool Combat::charsCantAct() const { return true; } -/** - * Return a description of the monsters being faced - */ Common::String Combat::getMonsterDescriptions() { Map &map = *_vm->_map; Common::String lines[3]; @@ -1583,16 +1562,10 @@ void Combat::attack2(int damage, RangeType rangeType) { } } -/** - * Flag the currently active character as blocking/defending - */ void Combat::block() { _charsBlocked[_whosTurn] = true; } -/** - * Perform whatever the current combat character's quick action is - */ void Combat::quickFight() { Spells &spells = *_vm->_spells; Character *c = _combatParty[_whosTurn]; @@ -1617,9 +1590,6 @@ void Combat::quickFight() { } } -/** - * Current selected character is trying to run away - */ void Combat::run() { Map &map = *_vm->_map; SoundManager &sound = *_vm->_sound; @@ -1803,9 +1773,6 @@ int Combat::getMonsterResistence(RangeType rangeType) { return damage; } -/** - * Distribute experience between active party members - */ void Combat::giveExperience(int experience) { Party &party = *_vm->_party; bool inCombat = _vm->_mode == MODE_COMBAT; @@ -2089,9 +2056,6 @@ done: party.giveTreasure(); } -/** - * Fires off a ranged attack at all oncoming monsters - */ void Combat::shootRangedWeapon() { _rangeType = RT_ALL; _damageType = DT_PHYSICAL; diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h index 33309b243b..1a1fc3a41b 100644 --- a/engines/xeen/combat.h +++ b/engines/xeen/combat.h @@ -88,6 +88,9 @@ private: int getMonsterResistence(RangeType rangeType); + /** + * Distribute experience between active party members + */ void giveExperience(int experience); public: Common::Array<Character *> _combatParty; @@ -136,35 +139,65 @@ public: void giveCharDamage(int damage, DamageType attackType, int charIndex); + /** + * Do damage to a specific character + */ void doCharDamage(Character &c, int charNum, int monsterDataIndex); void moveMonsters(); + /** + * Setup the combat party with a copy of the currently active party + */ void setupCombatParty(); void setSpeedTable(); + /** + * Returns true if all participants in the combat are disabled + */ bool allHaveGone() const; + /** + * Returns true if all the characters of the party are disabled + */ bool charsCantAct() const; + /** + * Return a description of the monsters being faced + */ Common::String getMonsterDescriptions(); void attack(Character &c, RangeType rangeType); + /** + * Flag the currently active character as blocking/defending + */ void block(); + /** + * Perform whatever the current combat character's quick action is + */ void quickFight(); + /** + * Current selected character is trying to run away + */ void run(); void monstersAttack(); void setupMonsterAttack(int monsterDataIndex, const Common::Point &pt); + /** + * Determines whether a given monster can move + */ bool monsterCanMove(const Common::Point &pt, int wallShift, int v1, int v2, int monsterId); + /** + * Moves a monster by a given delta amount if it's a valid move + */ void moveMonster(int monsterId, const Common::Point &moveDelta); void doMonsterTurn(int monsterId); @@ -177,6 +210,9 @@ public: void multiAttack(int powNum); + /** + * Fires off a ranged attack at all oncoming monsters + */ void shootRangedWeapon(); }; diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp index 77cdd92169..4ecd1c775c 100644 --- a/engines/xeen/dialogs.cpp +++ b/engines/xeen/dialogs.cpp @@ -29,9 +29,6 @@ namespace Xeen { -/** - * Saves the current list of buttons - */ void ButtonContainer::saveButtons() { _savedButtons.push(_buttons); clearButtons(); @@ -100,10 +97,6 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) { return false; } - -/** -* Draws the scroll in the background -*/ void ButtonContainer::doScroll(XeenEngine *vm, bool drawFlag, bool doFade) { Screen &screen = *vm->_screen; EventsManager &events = *vm->_events; @@ -205,9 +198,6 @@ void ButtonContainer::doScroll(XeenEngine *vm, bool drawFlag, bool doFade) { delete hand[i]; } -/** - * Draws the buttons onto the passed surface - */ void ButtonContainer::drawButtons(XSurface *surface) { for (uint btnIndex = 0; btnIndex < _buttons.size(); ++btnIndex) { UIButton &btn = _buttons[btnIndex]; diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h index 6e809ba2dc..51eafa5f54 100644 --- a/engines/xeen/dialogs.h +++ b/engines/xeen/dialogs.h @@ -53,12 +53,18 @@ protected: Common::Array<UIButton> _buttons; int _buttonValue; + /** + * Draws the scroll in the background + */ void doScroll(XeenEngine *vm, bool drawFlag, bool doFade); bool checkEvents(XeenEngine *vm); public: ButtonContainer() : _buttonValue(0) {} + /** + * Saves the current list of buttons + */ void saveButtons(); void clearButtons(); @@ -71,6 +77,9 @@ public: void addPartyButtons(XeenEngine *vm); + /** + * Draws the buttons onto the passed surface + */ void drawButtons(XSurface *surface); }; diff --git a/engines/xeen/dialogs_char_info.cpp b/engines/xeen/dialogs_char_info.cpp index c00916cd6f..0494c22b9c 100644 --- a/engines/xeen/dialogs_char_info.cpp +++ b/engines/xeen/dialogs_char_info.cpp @@ -213,9 +213,6 @@ exit: _vm->_combat->_itemFlag = false; } -/** - * Load the draw structure list with frame numbers and positions - */ void CharacterInfo::loadDrawStructs() { _drawList[0] = DrawStruct(0, 2, 16); _drawList[1] = DrawStruct(2, 2, 39); @@ -247,9 +244,6 @@ void CharacterInfo::loadDrawStructs() { _drawList[idx]._sprites = &_iconSprites; } -/** - * Set up the button list for the dialog - */ void CharacterInfo::addButtons() { addButton(Common::Rect(10, 24, 34, 44), 1001, &_iconSprites); addButton(Common::Rect(10, 47, 34, 67), 1002, &_iconSprites); @@ -278,9 +272,6 @@ void CharacterInfo::addButtons() { addPartyButtons(_vm); } -/** - * Return a string containing the details of the character - */ Common::String CharacterInfo::loadCharacterDetails(const Character &c) { Condition condition = c.worstCondition(); Party &party = *_vm->_party; @@ -324,9 +315,6 @@ Common::String CharacterInfo::loadCharacterDetails(const Character &c) { ); } -/** - * Cursor display handling - */ void CharacterInfo::showCursor(bool flag) { Screen &screen = *_vm->_screen; const int CURSOR_X[5] = { 9, 60, 111, 176, 0 }; diff --git a/engines/xeen/dialogs_char_info.h b/engines/xeen/dialogs_char_info.h index 5a20ff2248..90b35a9f6b 100644 --- a/engines/xeen/dialogs_char_info.h +++ b/engines/xeen/dialogs_char_info.h @@ -40,12 +40,24 @@ private: void execute(int charIndex); + /** + * Load the draw structure list with frame numbers and positions + */ void loadDrawStructs(); + /** + * Set up the button list for the dialog + */ void addButtons(); + /** + * Return a string containing the details of the character + */ Common::String loadCharacterDetails(const Character &c); + /** + * Cursor display handling + */ void showCursor(bool flag); bool expandStat(int attrib, const Character &c); diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp index eec6088a2c..5833733353 100644 --- a/engines/xeen/dialogs_input.cpp +++ b/engines/xeen/dialogs_input.cpp @@ -35,9 +35,6 @@ int Input::show(XeenEngine *vm, Window *window, Common::String &line, return result; } -/** - * Allows the user to enter a string - */ int Input::getString(Common::String &line, uint maxLen, int maxWidth, bool isNumeric) { _vm->_noDirectionSense = true; Common::String msg = Common::String::format("\x3""l\t000\x4%03d\x0""c", maxWidth); @@ -75,9 +72,6 @@ int Input::getString(Common::String &line, uint maxLen, int maxWidth, bool isNum return line.size(); } -/** - * Draws the cursor and waits until the user presses a key - */ Common::KeyCode Input::doCursor(const Common::String &msg) { EventsManager &events = *_vm->_events; Interface &intf = *_vm->_interface; diff --git a/engines/xeen/dialogs_input.h b/engines/xeen/dialogs_input.h index 2f30b73973..e824d17f57 100644 --- a/engines/xeen/dialogs_input.h +++ b/engines/xeen/dialogs_input.h @@ -31,11 +31,17 @@ namespace Xeen { class Input : public ButtonContainer { private: + /** + * Draws the cursor and waits until the user presses a key + */ Common::KeyCode doCursor(const Common::String &msg); protected: XeenEngine *_vm; Window *_window; + /** + * Allows the user to enter a string + */ int getString(Common::String &line, uint maxLen, int maxWidth, bool isNumeric); Input(XeenEngine *vm, Window *window) : _vm(vm), _window(window) {} diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp index 147f934a61..4ad9e240bd 100644 --- a/engines/xeen/dialogs_items.cpp +++ b/engines/xeen/dialogs_items.cpp @@ -513,9 +513,6 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { return c; } -/** - * Load the buttons for the dialog - */ void ItemsDialog::loadButtons(ItemsMode mode, Character *&c) { _iconSprites.load(Common::String::format("%s.icn", (mode == ITEMMODE_CHAR_INFO) ? "items" : "buy")); @@ -580,11 +577,6 @@ void ItemsDialog::loadButtons(ItemsMode mode, Character *&c) { } } -/** - * Loads the temporary _itemsCharacter character with the item set - * the given blacksmith has available, so the user can "view" the - * set as if it were a standard character's inventory - */ void ItemsDialog::blackData2CharData() { Party &party = *_vm->_party; bool isDarkCc = _vm->_files->_isDarkCc; @@ -602,10 +594,6 @@ void ItemsDialog::blackData2CharData() { } } -/** -* Saves the inventory from the temporary _itemsCharacter character back into the -* blacksmith storage, so changes in blacksmith inventory remain persistent -*/ void ItemsDialog::charData2BlackData() { Party &party = *_vm->_party; bool isDarkCc = _vm->_files->_isDarkCc; @@ -623,9 +611,6 @@ void ItemsDialog::charData2BlackData() { } } -/** - * Sets the equipment icon to use for each item for display - */ void ItemsDialog::setEquipmentIcons() { for (int typeIndex = 0; typeIndex < 4; ++typeIndex) { for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) { @@ -676,9 +661,6 @@ void ItemsDialog::setEquipmentIcons() { } } -/** - * Calculate the cost of an item - */ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode, int skillLevel, ItemCategory category) { int amount1 = 0, amount2 = 0, amount3 = 0, amount4 = 0; diff --git a/engines/xeen/dialogs_items.h b/engines/xeen/dialogs_items.h index bc995c52f8..6069ca823b 100644 --- a/engines/xeen/dialogs_items.h +++ b/engines/xeen/dialogs_items.h @@ -49,14 +49,32 @@ private: Character *execute(Character *c, ItemsMode mode); + /** + * Load the buttons for the dialog + */ void loadButtons(ItemsMode mode, Character *&c); + /** + * Loads the temporary _itemsCharacter character with the item set + * the given blacksmith has available, so the user can "view" the + * set as if it were a standard character's inventory + */ void blackData2CharData(); + /** + * Saves the inventory from the temporary _itemsCharacter character back into the + * blacksmith storage, so changes in blacksmith inventory remain persistent + */ void charData2BlackData(); + /** + * Sets the equipment icon to use for each item for display + */ void setEquipmentIcons(); + /** + * Calculate the cost of an item + */ int calcItemCost(Character *c, int itemIndex, ItemsMode mode, int skillLevel, ItemCategory category); diff --git a/engines/xeen/dialogs_party.cpp b/engines/xeen/dialogs_party.cpp index 69761bb4ec..18f5f3af10 100644 --- a/engines/xeen/dialogs_party.cpp +++ b/engines/xeen/dialogs_party.cpp @@ -295,9 +295,6 @@ void PartyDialog::setupBackground() { _vm->_interface->assembleBorder(); } -/** - * Sets up the faces from the avaialble roster for display in the party dialog - */ void PartyDialog::setupFaces(int firstDisplayChar, bool updateFlag) { Party &party = *_vm->_party; Common::String charNames[4]; @@ -765,10 +762,6 @@ int PartyDialog::selectCharacter(bool isDelete, int firstDisplayChar) { return result == -1 ? 0 : result; } -/** - * Roll up some random values for the attributes, and return both them as - * well as a list of classes that the attributes meet the requirements for - */ void PartyDialog::throwDice(uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES]) { bool repeat = true; do { @@ -793,10 +786,6 @@ void PartyDialog::throwDice(uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[ } while (repeat); } -/** - * Set a list of flags for which classes the passed attribute set meet the - * minimum requirements of - */ void PartyDialog::checkClass(const uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES]) { allowedClasses[CLASS_KNIGHT] = attribs[MIGHT] >= 15; allowedClasses[CLASS_PALADIN] = attribs[MIGHT] >= 13 @@ -812,9 +801,6 @@ void PartyDialog::checkClass(const uint attribs[TOTAL_ATTRIBUTES], bool allowedC && attribs[ENDURANCE] >= 12 && attribs[SPEED] >= 12; } -/** - * Return details of the generated character - */ int PartyDialog::newCharDetails(const uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES], Race race, Sex sex, int classId, int selectedClass, Common::String &msg) { @@ -863,9 +849,6 @@ int PartyDialog::newCharDetails(const uint attribs[TOTAL_ATTRIBUTES], return classId == -1 ? foundClass : selectedClass; } -/** - * Print the selection arrow to indicate the selected class - */ void PartyDialog::printSelectionArrow(SpriteResource &icons, int selectedClass) { Window &w = _vm->_screen->_windows[0]; icons.draw(w, 61, Common::Point(220, 19)); @@ -873,9 +856,6 @@ void PartyDialog::printSelectionArrow(SpriteResource &icons, int selectedClass) w.update(); } -/** - * Print the dice animation - */ void PartyDialog::drawDice(SpriteResource &dice) { EventsManager &events = *_vm->_events; Window &w = _vm->_screen->_windows[32]; @@ -911,9 +891,6 @@ void PartyDialog::drawDice(SpriteResource &dice) { checkEvents(_vm); } -/** - * Exchanging two attributes for the character being rolled - */ int PartyDialog::exchangeAttribute(int srcAttr) { EventsManager &events = *_vm->_events; Screen &screen = *_vm->_screen; @@ -989,9 +966,6 @@ int PartyDialog::exchangeAttribute(int srcAttr) { return result; } -/** - * Saves the rolled character into the roster - */ bool PartyDialog::saveCharacter(Character &c, CharacterClass classId, Race race, Sex sex, uint attribs[TOTAL_ATTRIBUTES]) { if (classId == -1) { diff --git a/engines/xeen/dialogs_party.h b/engines/xeen/dialogs_party.h index db2a3dfb36..2ad2daea0d 100644 --- a/engines/xeen/dialogs_party.h +++ b/engines/xeen/dialogs_party.h @@ -52,6 +52,9 @@ private: void setupBackground(); + /** + * Sets up the faces from the avaialble roster for display in the party dialog + */ void setupFaces(int firstDisplayChar, bool updateFlag); void startingCharChanged(int firstDisplayChar); @@ -60,20 +63,43 @@ private: int selectCharacter(bool isDelete, int firstDisplayChar); + /** + * Roll up some random values for the attributes, and return both them as + * well as a list of classes that the attributes meet the requirements for + */ void throwDice(uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES]); + /** + * Set a list of flags for which classes the passed attribute set meet the + * minimum requirements of + */ void checkClass(const uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES]); + /** + * Return details of the generated character + */ int newCharDetails(const uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES], Race race, Sex sex, int classId, int selectedClass, Common::String &msg); + /** + * Print the selection arrow to indicate the selected class + */ void printSelectionArrow(SpriteResource &icons, int selectedClass); + /** + * Print the dice animation + */ void drawDice(SpriteResource &dice); + /** + * Exchanging two attributes for the character being rolled + */ int exchangeAttribute(int srcAttr); + /** + * Saves the rolled character into the roster + */ bool saveCharacter(Character &c, CharacterClass classId, Race race, Sex sex, uint attribs[TOTAL_ATTRIBUTES]); public: diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp index 92dc8b487f..0c0a32be03 100644 --- a/engines/xeen/events.cpp +++ b/engines/xeen/events.cpp @@ -31,9 +31,6 @@ namespace Xeen { -/** - * Constructor - */ EventsManager::EventsManager(XeenEngine *vm) : _vm(vm), _frameCounter(0), _priorFrameCounterTime(0), _gameCounter(0), _priorGameCounterTime(0), _keyCode(Common::KEYCODE_INVALID), @@ -42,15 +39,9 @@ EventsManager::EventsManager(XeenEngine *vm) : _vm(vm), Common::fill(&_gameCounters[0], &_gameCounters[6], 0); } -/** - * Destructor - */ EventsManager::~EventsManager() { } -/* - * Set the cursor - */ void EventsManager::setCursor(int cursorId) { XSurface cursor; _sprites.draw(cursor, cursorId); @@ -59,23 +50,14 @@ void EventsManager::setCursor(int cursorId) { showCursor(); } -/** - * Show the mouse cursor - */ void EventsManager::showCursor() { CursorMan.showMouse(true); } -/** - * Hide the mouse cursor - */ void EventsManager::hideCursor() { CursorMan.showMouse(false); } -/** - * Returns if the mouse cursor is visible - */ bool EventsManager::isCursorVisible() { return CursorMan.isVisible(); } @@ -154,9 +136,6 @@ bool EventsManager::isKeyPending() const { return _keyCode != Common::KEYCODE_INVALID; } -/** - * Returns true if a key or mouse press is pending - */ bool EventsManager::isKeyMousePressed() { bool result = _leftButton || _rightButton || isKeyPending(); debounceMouse(); @@ -183,9 +162,6 @@ void EventsManager::ipause(uint amount) { } while (!_vm->shouldQuit() && timeElapsed() < amount); } -/** - * Handles moving to the next game frame - */ void EventsManager::nextFrame() { ++_frameCounter; diff --git a/engines/xeen/events.h b/engines/xeen/events.h index cce3155a4b..6ebe46e6fe 100644 --- a/engines/xeen/events.h +++ b/engines/xeen/events.h @@ -44,6 +44,9 @@ private: Common::KeyCode _keyCode; SpriteResource _sprites; + /** + * Handles moving to the next game frame + */ void nextFrame(); public: bool _leftButton, _rightButton; @@ -53,12 +56,24 @@ public: ~EventsManager(); + /* + * Set the cursor + */ void setCursor(int cursorId); + /** + * Show the mouse cursor + */ void showCursor(); + /** + * Hide the mouse cursor + */ void hideCursor(); + /** + * Returns if the mouse cursor is visible + */ bool isCursorVisible(); void pollEvents(); @@ -73,6 +88,9 @@ public: bool isKeyPending() const; + /** + * Returns true if a key or mouse press is pending + */ bool isKeyMousePressed(); void updateGameCounter() { _gameCounter = _frameCounter; } diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp index 50949b7696..bcee6bf9f6 100644 --- a/engines/xeen/files.cpp +++ b/engines/xeen/files.cpp @@ -29,9 +29,6 @@ namespace Xeen { -/** -* Hash a given filename to produce the Id that represents it -*/ uint16 BaseCCArchive::convertNameToId(const Common::String &resourceName) { if (resourceName.empty()) return 0xffff; @@ -57,9 +54,6 @@ uint16 BaseCCArchive::convertNameToId(const Common::String &resourceName) { return total; } -/** -* Load the index of a given CC file -*/ void BaseCCArchive::loadIndex(Common::SeekableReadStream *stream) { int count = stream->readUint16LE(); @@ -95,10 +89,6 @@ bool BaseCCArchive::hasFile(const Common::String &name) const { return getHeaderEntry(name, ccEntry); } -/** -* Given a resource name, returns whether an entry exists, and returns -* the header index data for that entry -*/ bool BaseCCArchive::getHeaderEntry(const Common::String &resourceName, CCEntry &ccEntry) const { uint16 id = convertNameToId(resourceName); @@ -193,9 +183,6 @@ Common::SeekableReadStream *CCArchive::createReadStreamForMember(const Common::S /*------------------------------------------------------------------------*/ -/** - * Instantiates the resource manager - */ FileManager::FileManager(XeenEngine *vm) { Common::File f; int sideNum = 0; @@ -219,9 +206,6 @@ FileManager::FileManager(XeenEngine *vm) { /*------------------------------------------------------------------------*/ -/** - * Opens the given file, throwing an error if it can't be opened - */ void File::openFile(const Common::String &filename) { if (!Common::File::open(filename)) error("Could not open file - %s", filename.c_str()); diff --git a/engines/xeen/files.h b/engines/xeen/files.h index f0c92d1050..fc75031a72 100644 --- a/engines/xeen/files.h +++ b/engines/xeen/files.h @@ -56,6 +56,9 @@ public: bool _isDarkCc; CCArchive *_sideArchives[2]; public: + /** + * Instantiates the resource manager + */ FileManager(XeenEngine *vm); void setGameCc(bool isDarkCc) { _isDarkCc = isDarkCc; } @@ -73,7 +76,14 @@ public: } virtual ~File() {} + /** + * Opens the given file, throwing an error if it can't be opened + */ void openFile(const Common::String &filename); + + /** + * Opens the given file, throwing an error if it can't be opened + */ void openFile(const Common::String &filename, Common::Archive &archive); Common::String readString(); @@ -112,10 +122,20 @@ class BaseCCArchive : public Common::Archive { protected: Common::Array<CCEntry> _index; + /** + * Load the index of a given CC file + */ void loadIndex(Common::SeekableReadStream *stream); + /** + * Given a resource name, returns whether an entry exists, and returns + * the header index data for that entry + */ virtual bool getHeaderEntry(const Common::String &resourceName, CCEntry &ccEntry) const; public: + /** + * Hash a given filename to produce the Id that represents it + */ static uint16 convertNameToId(const Common::String &resourceName); public: BaseCCArchive() {} diff --git a/engines/xeen/font.cpp b/engines/xeen/font.cpp index bfdc4bde6b..87e16b5bdd 100644 --- a/engines/xeen/font.cpp +++ b/engines/xeen/font.cpp @@ -37,10 +37,6 @@ FontSurface::FontSurface(int wv, int hv) : XSurface(wv, hv), _fontData(nullptr), setTextColor(0); } -/** - * Draws a symbol to the surface. - * @param symbolId Symbol number from 0 to 19 - */ void FontSurface::writeSymbol(int symbolId) { const byte *srcP = &SYMBOLS[symbolId][0]; @@ -57,14 +53,6 @@ void FontSurface::writeSymbol(int symbolId) { _writePos.x += 8; } -/** - * Write a string to the surface - * @param s String to display - * @param clipRect Window bounds to display string within - * @returns Any string remainder that couldn't be displayed - * @remarks Note that bounds is just used for wrapping purposes. Unless - * justification is set, the message will be written at _writePos - */ const char *FontSurface::writeString(const Common::String &s, const Common::Rect &bounds) { _displayString = s.c_str(); assert(_fontData); @@ -253,16 +241,10 @@ const char *FontSurface::writeString(const Common::String &s, const Common::Rect return _displayString; } -/** - * Return the next pending character to display - */ char FontSurface::getNextChar() { return *_displayString++ & 0x7f; } -/** -* Return the width of a given character -*/ bool FontSurface::getNextCharWidth(int &total) { char c = getNextChar(); @@ -292,9 +274,6 @@ bool FontSurface::getNextCharWidth(int &total) { } } -/** - * Handles moving to the next line of the given bounded area - */ bool FontSurface::newLine(const Common::Rect &bounds) { // Move past any spaces currently being pointed to while ((*_displayString & 0x7f) == ' ') @@ -309,9 +288,6 @@ bool FontSurface::newLine(const Common::Rect &bounds) { return ((_writePos.y + hv - 1) > bounds.bottom); } -/** - * Extract a number of a given maximum length from the string - */ int FontSurface::fontAtoi(int len) { int total = 0; for (int i = 0; i < len; ++i) { @@ -329,17 +305,11 @@ int FontSurface::fontAtoi(int len) { return total; } -/** - * Set the text colors based on the specified index in the master text colors list - */ void FontSurface::setTextColor(int idx) { const byte *colP = &TEXT_COLORS[idx][0]; Common::copy(colP, colP + 4, &_textColors[0]); } -/** - * Wrie a character to the surface - */ void FontSurface::writeChar(char c, const Common::Rect &clipRect) { // Get y position, handling kerning int y = _writePos.y; diff --git a/engines/xeen/font.h b/engines/xeen/font.h index caaa03c5ba..021205d5e5 100644 --- a/engines/xeen/font.h +++ b/engines/xeen/font.h @@ -38,16 +38,34 @@ private: const char *_displayString; bool _msgWraps; + /** + * Return the next pending character to display + */ char getNextChar(); + /** + * Return the width of a given character + */ bool getNextCharWidth(int &total); + /** + * Handles moving to the next line of the given bounded area + */ bool newLine(const Common::Rect &bounds); + /** + * Extract a number of a given maximum length from the string + */ int fontAtoi(int len = 3); + /** + * Set the text colors based on the specified index in the master text colors list + */ void setTextColor(int idx); + /** + * Wrie a character to the surface + */ void writeChar(char c, const Common::Rect &clipRect); public: const byte *_fontData; @@ -61,8 +79,20 @@ public: FontSurface(int wv, int hv); virtual ~FontSurface() {} + /** + * Draws a symbol to the surface. + * @param symbolId Symbol number from 0 to 19 + */ void writeSymbol(int symbolId); + /** + * Write a string to the surface + * @param s String to display + * @param clipRect Window bounds to display string within + * @returns Any string remainder that couldn't be displayed + * @remarks Note that bounds is just used for wrapping purposes. Unless + * justification is set, the message will be written at _writePos + */ const char *writeString(const Common::String &s, const Common::Rect &clipRect); }; diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index f9f1eebd10..3225831879 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -259,10 +259,6 @@ void Interface::setMainButtons(bool combatMode) { } } -/** - * Waits for a keypress or click, whilst still allowing the game scene to - * be animated. - */ void Interface::perform() { Combat &combat = *_vm->_combat; EventsManager &events = *_vm->_events; @@ -621,9 +617,6 @@ void Interface::chargeStep() { } } -/** - * Handles incrementing game time - */ void Interface::stepTime() { Party &party = *_vm->_party; SoundManager &sound = *_vm->_sound; @@ -714,9 +707,6 @@ void Interface::doStepCode() { } } -/** - * Start the party falling - */ void Interface::startFalling(bool flag) { Combat &combat = *_vm->_combat; Map &map = *_vm->_map; @@ -931,9 +921,6 @@ void Interface::startFalling(bool flag) { _flipGround ^= 1; } -/** - * Check movement in the given direction - */ bool Interface::checkMoveDirection(int key) { Map &map = *_vm->_map; Party &party = *_vm->_party; @@ -1316,9 +1303,6 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) { events.wait(2); } -/** - * Handle doing the falling - */ void Interface::handleFalling() { Party &party = *_vm->_party; Screen &screen = *_vm->_screen; @@ -1375,19 +1359,13 @@ void Interface::saveFall() { } void Interface::fall(int v) { - + // TODO } -/** - * Shake the screen - */ void Interface::shake(int time) { - + // TODO } -/** - * Draw the minimap - */ void Interface::drawMiniMap() { Map &map = *_vm->_map; Party &party = *_vm->_party; @@ -1765,9 +1743,6 @@ void Interface::drawMiniMap() { party._wizardEyeActive = eyeActive; } -/** - * Draw the display borders - */ void Interface::assembleBorder() { Combat &combat = *_vm->_combat; Resources &res = *_vm->_resources; @@ -2186,9 +2161,6 @@ void Interface::doCombat() { combat._combatMode = COMBATMODE_1; } -/** - * Select next character or monster to be attacking - */ void Interface::nextChar() { Combat &combat = *_vm->_combat; Party &party = *_vm->_party; diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 24edf9d23d..074d7fdafb 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -90,22 +90,40 @@ private: void chargeStep(); + /** + * Handles incrementing game time + */ void stepTime(); void doStepCode(); + /** + * Check movement in the given direction + */ bool checkMoveDirection(int key); + /** + * Handle doing the falling + */ void handleFalling(); void saveFall(); void fall(int v); + /** + * Shake the screen + */ void shake(int time); + /** + * Draw the minimap + */ void drawMiniMap(); + /** + * Select next character or monster to be attacking + */ void nextChar(); public: int _intrIndex1; @@ -133,8 +151,15 @@ public: void mainIconsPrint(); + /** + * Start the party falling + */ void startFalling(bool v); + /** + * Waits for a keypress or click, whilst still allowing the game scene to + * be animated. + */ void perform(); void rest(); @@ -143,6 +168,9 @@ public: void draw3d(bool updateFlag, bool skipDelay = false); + /** + * Draw the display borders + */ void assembleBorder(); void doCombat(); diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp index a08ce808d8..f5bf2af187 100644 --- a/engines/xeen/interface_map.cpp +++ b/engines/xeen/interface_map.cpp @@ -690,10 +690,6 @@ void InterfaceMap::drawMap() { animate3d(); } -/** - * Handles animation of monsters, wall items, and combat within the 3d - * view by cycling the appropriate frame numbers - */ void InterfaceMap::animate3d() { Combat &combat = *_vm->_combat; Map &map = *_vm->_map; @@ -2304,9 +2300,6 @@ void InterfaceMap::setMazeBits() { } } -/** - * Set up draw structures for displaying on-screen monsters - */ void InterfaceMap::setIndoorsMonsters() { Combat &combat = *_vm->_combat; Map &map = *_vm->_map; @@ -2616,10 +2609,6 @@ void InterfaceMap::setIndoorsMonsters() { } } -/** - * Helper method for setIndoorsMonsters to set a draw structure - * with the deatils for a given monster - */ void InterfaceMap::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster, SpriteResource *sprites, int frame, int defaultY) { MonsterStruct &monsterData = *monster._monsterData; @@ -2641,9 +2630,6 @@ void InterfaceMap::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster drawStruct._flags = MONSTER_EFFECT_FLAGS[monster._effect2][monster._effect3]; } -/** - * Set up draw structures for displaying on-screen objects - */ void InterfaceMap::setIndoorsObjects() { Common::Point mazePos = _vm->_party->_mazePosition; Direction dir = _vm->_party->_mazeDirection; @@ -2869,9 +2855,6 @@ void InterfaceMap::setIndoorsObjects() { } } -/** - * Set up draw structures for displaying on-screen wall items - */ void InterfaceMap::setIndoorsWallPics() { Map &map = *_vm->_map; const Common::Point &mazePos = _vm->_party->_mazePosition; @@ -3098,9 +3081,6 @@ void InterfaceMap::setIndoorsWallPics() { } } -/** - * Set up the draw structures for displaying monsters on outdoor maps - */ void InterfaceMap::setOutdoorsMonsters() { Combat &combat = *_vm->_combat; Map &map = *_vm->_map; @@ -3354,9 +3334,6 @@ void InterfaceMap::setOutdoorsMonsters() { // TODO } -/** - * Set up the draw structures for displaying objects on outdoor maps - */ void InterfaceMap::setOutdoorsObjects() { Map &map = *_vm->_map; Party &party = *_vm->_party; @@ -3544,9 +3521,6 @@ void InterfaceMap::setOutdoorsObjects() { } } -/** - * Draw the contents of the current 3d view of an indoor map - */ void InterfaceMap::drawIndoors() { Map &map = *_vm->_map; int surfaceId; @@ -4393,9 +4367,6 @@ void InterfaceMap::drawIndoors() { _charsShooting = _isAttacking; } -/** - * Draw the contents of the current 3d view of an outdoor map - */ void InterfaceMap::drawOutdoors() { Map &map = *_vm->_map; Party &party = *_vm->_party; diff --git a/engines/xeen/interface_map.h b/engines/xeen/interface_map.h index a37bf349ec..2189aacec1 100644 --- a/engines/xeen/interface_map.h +++ b/engines/xeen/interface_map.h @@ -95,6 +95,10 @@ private: void initDrawStructs(); + /** + * Helper method for setIndoorsMonsters to set a draw structure + * with the deatils for a given monster + */ void setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster, SpriteResource *sprites, int frame, int defaultY); protected: @@ -109,6 +113,10 @@ protected: void setMazeBits(); + /** + * Handles animation of monsters, wall items, and combat within the 3d + * view by cycling the appropriate frame numbers + */ void animate3d(); void drawMap(); @@ -126,18 +134,39 @@ public: virtual ~InterfaceMap() {} + /** + * Set up draw structures for displaying on-screen monsters + */ void setIndoorsMonsters(); + /** + * Set up draw structures for displaying on-screen objects + */ void setIndoorsObjects(); + /** + * Set up draw structures for displaying on-screen wall items + */ void setIndoorsWallPics(); + /** + * Draw the contents of the current 3d view of an indoor map + */ void drawIndoors(); + /** + * Set up the draw structures for displaying monsters on outdoor maps + */ void setOutdoorsMonsters(); + /** + * Set up the draw structures for displaying objects on outdoor maps + */ void setOutdoorsObjects(); + /** + * Draw the contents of the current 3d view of an outdoor map + */ void drawOutdoors(); }; diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index ff7938746e..6816423a19 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -603,9 +603,6 @@ void MazeData::synchronize(Common::SeekableReadStream &s) { SavesManager::syncBitFlags(ser, &_steppedOnTiles[y][0], &_steppedOnTiles[y][MAP_WIDTH]); } -/** - * Flags all tiles for the map as having been stepped on - */ void MazeData::setAllTilesStepped() { for (int y = 0; y < MAP_HEIGHT; ++y) Common::fill(&_steppedOnTiles[y][0], &_steppedOnTiles[y][MAP_WIDTH], true); @@ -663,10 +660,6 @@ MazeMonster::MazeMonster() { _monsterData = nullptr; } -/** - * Return the text color to use when displaying the monster's name in combat - * to indicate how damaged they are - */ int MazeMonster::getTextColor() const { if (_hp == _monsterData->_hp) return 15; @@ -843,9 +836,6 @@ void HeadData::synchronize(Common::SeekableReadStream &s) { /*------------------------------------------------------------------------*/ -/** - * Synchronize data for an animation entry - */ void AnimationEntry::synchronize(Common::SeekableReadStream &s) { for (int i = 0; i < 4; ++i) _frame1._frames[i] = s.readByte(); @@ -855,9 +845,6 @@ void AnimationEntry::synchronize(Common::SeekableReadStream &s) { _frame2._frames[i] = s.readByte(); } -/** - * Synchronize data for object animations within the game - */ void AnimationInfo::synchronize(Common::SeekableReadStream &s) { AnimationEntry entry; @@ -868,9 +855,6 @@ void AnimationInfo::synchronize(Common::SeekableReadStream &s) { } } -/** - * Load the animation info objects in the game - */ void AnimationInfo::load(const Common::String &name) { File f(name); synchronize(f); @@ -1301,9 +1285,6 @@ int Map::mazeLookup(const Common::Point &pt, int layerShift, int wallMask) { } } -/** - * Load the events for a new map - */ void Map::loadEvents(int mapId) { // Load events Common::String filename = Common::String::format("maze%c%03d.evt", diff --git a/engines/xeen/map.h b/engines/xeen/map.h index a7e88c1726..2c02e6ed2f 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -210,6 +210,9 @@ public: void synchronize(Common::SeekableReadStream &s); + /** + * Flags all tiles for the map as having been stepped on + */ void setAllTilesStepped(); void clearCellSurfaces(); @@ -257,6 +260,10 @@ struct MazeMonster { MazeMonster(); + /** + * Return the text color to use when displaying the monster's name in combat + * to indicate how damaged they are + */ int getTextColor() const; }; @@ -341,13 +348,22 @@ struct AnimationEntry { int _frames[4]; } _frame2; + /** + * Synchronize data for an animation entry + */ void synchronize(Common::SeekableReadStream &s); }; class AnimationInfo : public Common::Array<AnimationEntry> { public: + /** + * Synchronize data for object animations within the game + */ void synchronize(Common::SeekableReadStream &s); + /** + * Load the animation info objects in the game + */ void load(const Common::String &name); }; @@ -361,6 +377,9 @@ private: int _sideMonsters; int _mazeDataIndex; + /** + * Load the events for a new map + */ void loadEvents(int mapId); public: Common::String _mazeName; diff --git a/engines/xeen/module.mk b/engines/xeen/module.mk index de4df4a90f..b18f44fa6d 100644 --- a/engines/xeen/module.mk +++ b/engines/xeen/module.mk @@ -9,7 +9,6 @@ MODULE_OBJS := \ debugger.o \ detection.o \ dialogs.o \ - automap.o \ dialogs_automap.o \ dialogs_char_info.o \ dialogs_control_panel.o \ diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 1db4a14f59..35a8f00fbe 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -264,19 +264,12 @@ bool Party::isInParty(int charId) { return false; } -/** - * Copy the currently active party characters' data back to the roster - */ void Party::copyPartyToRoster() { for (uint i = 0; i < _activeParty.size(); ++i) { _roster[_activeParty[i]._rosterId] = _activeParty[i]; } } -/** - * Adds time to the party's playtime, taking into account the effect of any - * stat modifier changes - */ void Party::changeTime(int numMinutes) { bool killed = false; @@ -557,16 +550,10 @@ void Party::checkPartyDead() { _dead = true; } -/** - * Move party position to the run destination on the current map - */ void Party::moveToRunLocation() { _mazePosition = _vm->_map->mazeData()._runPosition; } -/** - * Give treasure to the party - */ void Party::giveTreasure() { Combat &combat = *_vm->_combat; EventsManager &events = *_vm->_events; @@ -691,9 +678,6 @@ void Party::giveTreasure() { scripts._v2 = 1; } -/** - * Returns true if all the packs for all the characters are full - */ bool Party::arePacksFull() const { uint total = 0; for (uint idx = 0; idx < _activeParty.size(); ++idx) { @@ -707,9 +691,6 @@ bool Party::arePacksFull() const { return total == (_activeParty.size() * NUM_ITEM_CATEGORIES); } -/** - * Give a treasure item to the given character's inventory - */ void Party::giveTreasureToCharacter(Character &c, ItemCategory category, int itemIndex) { EventsManager &events = *_vm->_events; Screen &screen = *_vm->_screen; diff --git a/engines/xeen/party.h b/engines/xeen/party.h index df6864da33..d753b75801 100644 --- a/engines/xeen/party.h +++ b/engines/xeen/party.h @@ -78,6 +78,9 @@ class Party { private: static XeenEngine *_vm; + /** + * Give a treasure item to the given character's inventory + */ void giveTreasureToCharacter(Character &c, ItemCategory category, int itemIndex); public: // Dynamic data that's saved @@ -153,8 +156,15 @@ public: bool isInParty(int charId); + /** + * Copy the currently active party characters' data back to the roster + */ void copyPartyToRoster(); + /** + * Adds time to the party's playtime, taking into account the effect of any + * stat modifier changes + */ void changeTime(int numMinutes); void addTime(int numMinutes); @@ -169,10 +179,19 @@ public: void checkPartyDead(); + /** + * Move party position to the run destination on the current map + */ void moveToRunLocation(); + /** + * Give treasure to the party + */ void giveTreasure(); + /** + * Returns true if all the packs for all the characters are full + */ bool arePacksFull() const; bool canShoot() const; diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp index 61022a31cb..9fd2d19a9b 100644 --- a/engines/xeen/saves.cpp +++ b/engines/xeen/saves.cpp @@ -57,9 +57,6 @@ SavesManager::~SavesManager() { delete[] _data; } -/** - * Synchronizes a boolean array as a bitfield set - */ void SavesManager::syncBitFlags(Common::Serializer &s, bool *startP, bool *endP) { byte data = 0; @@ -122,9 +119,6 @@ void SavesManager::load(Common::SeekableReadStream *stream) { delete pty; } -/** - * Sets up the dynamic data for the game for a new game - */ void SavesManager::reset() { Common::String prefix = _vm->getGameID() != GType_DarkSide ? "xeen|" : "dark|"; Common::MemoryWriteStreamDynamic saveFile(DisposeAfterUse::YES); diff --git a/engines/xeen/saves.h b/engines/xeen/saves.h index 8f112f689e..2571c46600 100644 --- a/engines/xeen/saves.h +++ b/engines/xeen/saves.h @@ -64,6 +64,9 @@ private: void load(Common::SeekableReadStream *stream); public: + /** + * Synchronizes a boolean array as a bitfield set + */ static void syncBitFlags(Common::Serializer &s, bool *startP, bool *endP); public: bool _wonWorld; @@ -73,6 +76,9 @@ public: ~SavesManager(); + /** + * Sets up the dynamic data for the game for a new game + */ void reset(); void readCharFile(); diff --git a/engines/xeen/screen.cpp b/engines/xeen/screen.cpp index 80f0149d7c..a013b9706b 100644 --- a/engines/xeen/screen.cpp +++ b/engines/xeen/screen.cpp @@ -161,24 +161,15 @@ void Window::close() { } } -/** - * Update the window - */ void Window::update() { // Since all window drawing is done on the screen surface anyway, // there's nothing that needs to be updated here } -/** - * Adds an area that requires redrawing on the next frame update - */ void Window::addDirtyRect(const Common::Rect &r) { _vm->_screen->addDirtyRect(r); } -/** - * Fill the content area of a window with the current background color - */ void Window::fill() { fillRect(_innerBounds, _vm->_screen->_bgColor); } @@ -202,9 +193,6 @@ void Window::drawList(DrawStruct *items, int count) { /*------------------------------------------------------------------------*/ -/** - * Constructor - */ Screen::Screen(XeenEngine *vm) : _vm(vm) { _fadeIn = false; create(SCREEN_WIDTH, SCREEN_HEIGHT); @@ -337,18 +325,12 @@ bool Screen::unionRectangle(Common::Rect &destRect, const Common::Rect &src1, co return !destRect.isEmpty(); } -/** - * Load a palette resource into the temporary palette - */ void Screen::loadPalette(const Common::String &name) { File f(name); for (int i = 0; i < PALETTE_SIZE; ++i) _tempPalette[i] = f.readByte() << 2; } -/** - * Load a background resource into memory - */ void Screen::loadBackground(const Common::String &name) { File f(name); @@ -357,9 +339,6 @@ void Screen::loadBackground(const Common::String &name) { addDirtyRect(Common::Rect(0, 0, this->w, this->h)); } -/** - * Copy a loaded background into a display page - */ void Screen::loadPage(int pageNum) { assert(pageNum == 0 || pageNum == 1); if (_pages[0].empty()) { @@ -375,9 +354,6 @@ void Screen::freePages() { _pages[1].free(); } -/** - * Merge the two pages along a horizontal split point - */ void Screen::horizMerge(int xp) { if (_pages[0].empty()) return; @@ -394,9 +370,6 @@ void Screen::horizMerge(int xp) { } } -/** - * Merge the two pages along a vertical split point - */ void Screen::vertMerge(int yp) { if (_pages[0].empty()) return; @@ -420,9 +393,6 @@ void Screen::draw(void *data) { drawScreen(); } -/** - * Mark the entire screen for drawing - */ void Screen::drawScreen() { addDirtyRect(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); } diff --git a/engines/xeen/screen.h b/engines/xeen/screen.h index 21b7e8992e..4ab76d529d 100644 --- a/engines/xeen/screen.h +++ b/engines/xeen/screen.h @@ -86,10 +86,16 @@ public: void close(); + /** + * Update the window + */ void update(); void frame(); + /** + * Fill the content area of a window with the current background color + */ void fill(); const char *writeString(const Common::String &s); @@ -113,6 +119,9 @@ private: bool unionRectangle(Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2); + /** + * Mark the entire screen for drawing + */ void drawScreen(); void fadeInner(int step); @@ -121,6 +130,9 @@ private: void updatePalette(const byte *pal, int start, int count16); public: + /** + * Adds an area that requires redrawing on the next frame update + */ virtual void addDirtyRect(const Common::Rect &r); public: Common::Array<Window> _windows; @@ -137,16 +149,31 @@ public: void update(); + /** + * Load a palette resource into the temporary palette + */ void loadPalette(const Common::String &name); + /** + * Load a background resource into memory + */ void loadBackground(const Common::String &name); + /** + * Copy a loaded background into a display page + */ void loadPage(int pageNum); void freePages(); + /** + * Merge the two pages along a horizontal split point + */ void horizMerge(int xp); + /** + * Merge the two pages along a vertical split point + */ void vertMerge(int yp); void draw(void *data = nullptr); diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 175292fa1d..177bb5d146 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -316,9 +316,6 @@ void Scripts::openGrate(int wallVal, int action) { typedef void(Scripts::*ScriptMethodPtr)(Common::Array<byte> &); -/** - * Handles executing a given script command - */ void Scripts::doOpcode(MazeEvent &event) { static const ScriptMethodPtr COMMAND_LIST[] = { nullptr, &Scripts::cmdDisplay1, &Scripts::cmdDoorTextSml, @@ -349,9 +346,6 @@ void Scripts::doOpcode(MazeEvent &event) { (this->*COMMAND_LIST[event._opcode])(event._parameters); } -/** - * Display a msesage on-screen - */ void Scripts::cmdDisplay1(Common::Array<byte> ¶ms) { Screen &screen = *_vm->_screen; Common::String paramText = _vm->_map->_events._text[_event->_parameters[0]]; @@ -366,9 +360,6 @@ void Scripts::cmdDisplay1(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Displays a door text message using the small font - */ void Scripts::cmdDoorTextSml(Common::Array<byte> ¶ms) { Interface &intf = *_vm->_interface; @@ -381,9 +372,6 @@ void Scripts::cmdDoorTextSml(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Displays a door text message using the large font - */ void Scripts::cmdDoorTextLrg(Common::Array<byte> ¶ms) { Interface &intf = *_vm->_interface; @@ -396,9 +384,6 @@ void Scripts::cmdDoorTextLrg(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Show a sign text on-screen - */ void Scripts::cmdSignText(Common::Array<byte> ¶ms) { Interface &intf = *_vm->_interface; @@ -421,9 +406,6 @@ void Scripts::cmdNPC(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Play a sound FX - */ void Scripts::cmdPlayFX(Common::Array<byte> ¶ms) { _vm->_sound->playFX(params[0]); @@ -496,9 +478,6 @@ void Scripts::cmdTeleport(Common::Array<byte> ¶ms) { } } -/** - * Do a conditional check - */ void Scripts::cmdIf(Common::Array<byte> ¶ms) { Party &party = *_vm->_party; uint32 mask; @@ -542,9 +521,6 @@ void Scripts::cmdIf(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Moves the position of an object - */ void Scripts::cmdMoveObj(Common::Array<byte> ¶ms) { MazeObject &mazeObj = _vm->_map->_mobData._objects[params[0]]; @@ -765,9 +741,6 @@ void Scripts::cmdTakeOrGive(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Move to the next line of the script - */ void Scripts::cmdNoAction(Common::Array<byte> ¶ms) { // Move to next line _lineNum = _vm->_party->_partyDead ? -1 : _lineNum + 1; @@ -786,9 +759,6 @@ void Scripts::cmdRemove(Common::Array<byte> ¶ms) { cmdMakeNothingHere(params); } -/** - * Set the currently active character for other script operations - */ void Scripts::cmdSetChar(Common::Array<byte> ¶ms) { if (params[0] != 7) { _charIndex = WhoWill::show(_vm, 22, 3, false); @@ -804,9 +774,6 @@ void Scripts::cmdSetChar(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Spawn a monster - */ void Scripts::cmdSpawn(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; if (params[0] >= map._mobData._monsters.size()) @@ -833,16 +800,10 @@ void Scripts::cmdDoTownEvent(Common::Array<byte> ¶ms) { cmdExit(params); } -/** - * Stop executing the script - */ void Scripts::cmdExit(Common::Array<byte> ¶ms) { _lineNum = -1; } -/** - * Changes the value for the wall on a given cell - */ void Scripts::cmdAlterMap(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; @@ -970,9 +931,6 @@ void Scripts::cmdDamage(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Jump if a random number matches a given value - */ void Scripts::cmdJumpRnd(Common::Array<byte> ¶ms) { int v = _vm->getRandomNumber(1, params[0]); if (v == params[1]) @@ -981,9 +939,6 @@ void Scripts::cmdJumpRnd(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Alter an existing event - */ void Scripts::cmdAlterEvent(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; Party &party = *_vm->_party; @@ -1000,10 +955,6 @@ void Scripts::cmdAlterEvent(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Stores the current location and line for later resuming, and set up to execute - * a script at a given location - */ void Scripts::cmdCallEvent(Common::Array<byte> ¶ms) { _stack.push(StackEntry(_currentPos, _lineNum)); _currentPos = Common::Point(params[0], params[1]); @@ -1012,10 +963,6 @@ void Scripts::cmdCallEvent(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Return from executing a script to the script location that previously - * called the script - */ void Scripts::cmdReturn(Common::Array<byte> ¶ms) { StackEntry &se = _stack.top(); _currentPos = se; @@ -1245,9 +1192,6 @@ void Scripts::cmdItemType(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Disable all the scripts at the party's current position - */ void Scripts::cmdMakeNothingHere(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; Party &party = *_vm->_party; @@ -1270,10 +1214,6 @@ void Scripts::cmdCheckProtection(Common::Array<byte> ¶ms) { cmdExit(params); } -/** - * Given a number of options, and a list of line numbers associated with - * those options, jumps to whichever line for the option the user selects - */ void Scripts::cmdChooseNumeric(Common::Array<byte> ¶ms) { int choice = Choose123::show(_vm, params[0]); if (choice) { @@ -1305,9 +1245,6 @@ void Scripts::cmdDisplayLarge(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Exchange the positions of two objects in the maze - */ void Scripts::cmdExchObj(Common::Array<byte> ¶ms) { MazeObject &obj1 = _vm->_map->_mobData._objects[params[0]]; MazeObject &obj2 = _vm->_map->_mobData._objects[params[1]]; @@ -1335,11 +1272,6 @@ void Scripts::cmdDisplayMain(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Jumps to a given line number if the surface at relative cell position 1 matches - * a specified surface. - * @remarks This opcode is apparently never actually used - */ void Scripts::cmdGoto(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; map.getCell(1); @@ -1349,9 +1281,6 @@ void Scripts::cmdGoto(Common::Array<byte> ¶ms) { cmdNoAction(params); } -/** - * Pick a random value from the parameter list and jump to that line number - */ void Scripts::cmdGotoRandom(Common::Array<byte> ¶ms) { _lineNum = params[_vm->getRandomNumber(1, params[0])] - 1; cmdNoAction(params); @@ -1414,9 +1343,6 @@ void Scripts::doEnding(const Common::String &endStr, int v2) { warning("TODO: doEnding"); } -/** - * This monstrosity handles doing the various types of If checks on various data - */ bool Scripts::ifProc(int action, uint32 mask, int mode, int charIndex) { Party &party = *_vm->_party; Character &ps = party._activeParty[charIndex]; diff --git a/engines/xeen/scripts.h b/engines/xeen/scripts.h index 15550dd9c0..f41be1b7c6 100644 --- a/engines/xeen/scripts.h +++ b/engines/xeen/scripts.h @@ -155,30 +155,99 @@ private: Common::String _message; Common::String _displayMessage; + /** + * Handles executing a given script command + */ void doOpcode(MazeEvent &event); + + /** + * Display a msesage on-screen + */ void cmdDisplay1(Common::Array<byte> ¶ms); + + /** + * Displays a door text message using the small font + */ void cmdDoorTextSml(Common::Array<byte> ¶ms); + + /** + * Displays a door text message using the large font + */ void cmdDoorTextLrg(Common::Array<byte> ¶ms); + + /** + * Show a sign text on-screen + */ void cmdSignText(Common::Array<byte> ¶ms); void cmdNPC(Common::Array<byte> ¶ms); + + /** + * Play a sound FX + */ void cmdPlayFX(Common::Array<byte> ¶ms); void cmdTeleport(Common::Array<byte> ¶ms); + + /** + * Do a conditional check + */ void cmdIf(Common::Array<byte> ¶ms); + + /** + * Moves the position of an object + */ void cmdMoveObj(Common::Array<byte> ¶ms); void cmdTakeOrGive(Common::Array<byte> ¶ms); + + /** + * Move to the next line of the script + */ void cmdNoAction(Common::Array<byte> ¶ms); void cmdRemove(Common::Array<byte> ¶ms); + + /** + * Set the currently active character for other script operations + */ void cmdSetChar(Common::Array<byte> ¶ms); + + /** + * Spawn a monster + */ void cmdSpawn(Common::Array<byte> ¶ms); void cmdDoTownEvent(Common::Array<byte> ¶ms); + + /** + * Stop executing the script + */ void cmdExit(Common::Array<byte> ¶ms); + + /** + * Changes the value for the wall on a given cell + */ void cmdAlterMap(Common::Array<byte> ¶ms); void cmdGiveExtended(Common::Array<byte> ¶ms); void cmdConfirmWord(Common::Array<byte> ¶ms); void cmdDamage(Common::Array<byte> ¶ms); + + /** + * Jump if a random number matches a given value + */ void cmdJumpRnd(Common::Array<byte> ¶ms); + + /** + * Alter an existing event + */ void cmdAlterEvent(Common::Array<byte> ¶ms); + + /** + * Stores the current location and line for later resuming, and set up to execute + * a script at a given location + */ void cmdCallEvent(Common::Array<byte> ¶ms); + + /** + * Return from executing a script to the script location that previously + * called the script + */ void cmdReturn(Common::Array<byte> ¶ms); void cmdSetVar(Common::Array<byte> ¶ms); void cmdCutsceneEndClouds(Common::Array<byte> ¶ms); @@ -195,15 +264,38 @@ private: void cmdSelRndChar(Common::Array<byte> ¶ms); void cmdGiveEnchanted(Common::Array<byte> ¶ms); void cmdItemType(Common::Array<byte> ¶ms); + + /** + * Disable all the scripts at the party's current position + */ void cmdMakeNothingHere(Common::Array<byte> ¶ms); void cmdCheckProtection(Common::Array<byte> ¶ms); + + /** + * Given a number of options, and a list of line numbers associated with + * those options, jumps to whichever line for the option the user selects + */ void cmdChooseNumeric(Common::Array<byte> ¶ms); void cmdDisplayBottomTwoLines(Common::Array<byte> ¶ms); void cmdDisplayLarge(Common::Array<byte> ¶ms); + + /** + * Exchange the positions of two objects in the maze + */ void cmdExchObj(Common::Array<byte> ¶ms); void cmdFallToMap(Common::Array<byte> ¶ms); void cmdDisplayMain(Common::Array<byte> ¶ms); + + /** + * Jumps to a given line number if the surface at relative cell position 1 matches + * a specified surface. + * @remarks This opcode is apparently never actually used + */ void cmdGoto(Common::Array<byte> ¶ms); + + /** + * Pick a random value from the parameter list and jump to that line number + */ void cmdGotoRandom(Common::Array<byte> ¶ms); void cmdCutsceneEndDarkside(Common::Array<byte> ¶ms); void cmdCutsceneEdWorld(Common::Array<byte> ¶ms); @@ -220,6 +312,9 @@ private: void doEnding(const Common::String &endStr, int v2); + /** + * This monstrosity handles doing the various types of If checks on various data + */ bool ifProc(int action, uint32 mask, int mode, int charIndex); bool copyProtectionCheck(); diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp index ba4e78bfb9..ee3085d052 100644 --- a/engines/xeen/spells.cpp +++ b/engines/xeen/spells.cpp @@ -88,16 +88,10 @@ void Spells::executeSpell(MagicSpell spellId) { (this->*SPELL_LIST[spellId])(); } -/** - * Spell being cast failed - */ void Spells::spellFailed() { ErrorScroll::show(_vm, SPELL_FAILED, WT_NONFREEZED_WAIT); } -/** - * Cast a spell associated with an item - */ void Spells::castItemSpell(int itemSpellId) { switch (itemSpellId) { case 15: @@ -170,9 +164,6 @@ void Spells::castItemSpell(int itemSpellId) { executeSpell(spells[itemSpellId]); } -/** - * Cast a given spell - */ int Spells::castSpell(Character *c, MagicSpell spellId) { Combat &combat = *_vm->_combat; Interface &intf = *_vm->_interface; @@ -217,10 +208,6 @@ int Spells::castSpell(Character *c, MagicSpell spellId) { return result; } -/** - * Subtract the requirements for a given spell if available, returning - * true if there was sufficient - */ int Spells::subSpellCost(Character &c, int spellId) { Party &party = *_vm->_party; int gemCost = SPELL_GEM_COST[spellId]; @@ -243,10 +230,6 @@ int Spells::subSpellCost(Character &c, int spellId) { return 0; } -/** - * Add the SP and gem requirements for a given spell to the given - * character and party - */ void Spells::addSpellCost(Character &c, int spellId) { Party &party = *_vm->_party; int gemCost = SPELL_GEM_COST[spellId]; diff --git a/engines/xeen/spells.h b/engines/xeen/spells.h index 1af4fb222f..a05e81c56d 100644 --- a/engines/xeen/spells.h +++ b/engines/xeen/spells.h @@ -69,6 +69,9 @@ private: void executeSpell(MagicSpell spellId); + /** + * Spell being cast failed + */ void spellFailed(); // Spell list @@ -160,12 +163,26 @@ public: int calcSpellPoints(int spellId, int expenseFactor) const; + /** + * Cast a spell associated with an item + */ void castItemSpell(int itemSpellId); + /** + * Cast a given spell + */ int castSpell(Character *c, MagicSpell spellId); + /** + * Subtract the requirements for a given spell if available, returning + * true if there was sufficient + */ int subSpellCost(Character &c, int spellId); + /** + * Add the SP and gem requirements for a given spell to the given + * character and party + */ void addSpellCost(Character &c, int spellId); }; diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index b29fb2d053..4804f0aa66 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -51,9 +51,6 @@ SpriteResource::~SpriteResource() { clear(); } -/** - * Copy operator for duplicating a sprite resource - */ SpriteResource &SpriteResource::operator=(const SpriteResource &src) { delete[] _data; _index.clear(); @@ -69,25 +66,16 @@ SpriteResource &SpriteResource::operator=(const SpriteResource &src) { return *this; } -/** - * Load a sprite resource from a given file - */ void SpriteResource::load(const Common::String &filename) { File f(filename); load(f); } -/** - * Load a sprite resource from a given file and archive - */ void SpriteResource::load(const Common::String &filename, Common::Archive &archive) { File f(filename, archive); load(f); } -/** - * Load a sprite resource from a stream - */ void SpriteResource::load(Common::SeekableReadStream &f) { // Read in a copy of the file _filesize = f.size(); @@ -106,18 +94,12 @@ void SpriteResource::load(Common::SeekableReadStream &f) { } } -/** - * Clears the sprite resource - */ void SpriteResource::clear() { delete[] _data; _data = nullptr; _filesize = 0; } -/** - * Draws a frame using data at a specific offset in the sprite resource - */ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, const Common::Rect &bounds, int flags, int scale) { static const uint SCALE_TABLE[] = { diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h index 2a00ecaf76..9a241c2100 100644 --- a/engines/xeen/sprites.h +++ b/engines/xeen/sprites.h @@ -48,6 +48,9 @@ private: bool _lineDist[320]; int _scaledWidth, _scaledHeight; + /** + * Load a sprite resource from a stream + */ void load(Common::SeekableReadStream &f); /** @@ -72,12 +75,24 @@ public: virtual ~SpriteResource(); + /** + * Copy operator for duplicating a sprite resource + */ SpriteResource &operator=(const SpriteResource &src); + /** + * Load a sprite resource from a given file + */ void load(const Common::String &filename); + /** + * Load a sprite resource from a given file and archive + */ void load(const Common::String &filename, Common::Archive &archive); + /** + * Clears the sprite resource + */ void clear(); void draw(XSurface &dest, int frame, const Common::Point &destPos, diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp index 221f5d9978..52fa988e15 100644 --- a/engines/xeen/town.cpp +++ b/engines/xeen/town.cpp @@ -1184,9 +1184,6 @@ void Town::drawTownAnim(bool flag) { screen._windows[3].update(); } -/** - * Returns true if a town location (bank, blacksmith, etc.) is currently active - */ bool Town::isActive() const { return _townSprites.size() > 0 && !_townSprites[0].empty(); } diff --git a/engines/xeen/town.h b/engines/xeen/town.h index c64ef891f1..f56f24ca73 100644 --- a/engines/xeen/town.h +++ b/engines/xeen/town.h @@ -104,6 +104,9 @@ public: void drawTownAnim(bool flag); + /** + * Returns true if a town location (bank, blacksmith, etc.) is currently active + */ bool isActive() const; void clearSprites(); diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index 3b317f52d6..da7810c4cb 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -271,9 +271,6 @@ void XeenEngine::showMainMenu() { //OptionsMenu::show(this); } -/** - * Main method for playing the game - */ void XeenEngine::playGame() { _saves->reset(); play(); diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h index cd1b98b1b8..389d73dcc3 100644 --- a/engines/xeen/xeen.h +++ b/engines/xeen/xeen.h @@ -115,21 +115,21 @@ protected: virtual void showIntro() = 0; /** - * Play the game - */ + * Play the game + */ virtual void playGame(); private: void initialize(); /** - * Synchronize savegame data - */ + * Synchronize savegame data + */ void synchronize(Common::Serializer &s); /** - * Support method that generates a savegame name - * @param slot Slot number - */ + * Support method that generates a savegame name + * @param slot Slot number + */ Common::String generateSaveName(int slot); // Engine APIs |