diff options
author | Eugene Sandulenko | 2016-10-09 14:59:58 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-09 14:59:58 +0200 |
commit | dead4aa01446da2bf711e64a4e681be460fa1202 (patch) | |
tree | 149648f240e839900e18af10953c4408da1e9464 /engines/xeen | |
parent | c5efd9f7487f4f51316d9ae6e6cbef3d35dd7b51 (diff) | |
download | scummvm-rg350-dead4aa01446da2bf711e64a4e681be460fa1202.tar.gz scummvm-rg350-dead4aa01446da2bf711e64a4e681be460fa1202.tar.bz2 scummvm-rg350-dead4aa01446da2bf711e64a4e681be460fa1202.zip |
JANITORIAL: Remove trailing spaces
Diffstat (limited to 'engines/xeen')
44 files changed, 311 insertions, 311 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp index 4d791b9c7b..dc2b65885e 100644 --- a/engines/xeen/character.cpp +++ b/engines/xeen/character.cpp @@ -149,7 +149,7 @@ bool InventoryItems::discardItem(int itemIndex) { sort(); return true; - } + } } return true; @@ -277,7 +277,7 @@ Common::String WeaponItems::getFullDescription(int itemIndex, int displayNum) { displayNum, Res.WEAPON_NAMES[i._id], !i._bonusFlags ? "" : Res.BONUS_NAMES[i._bonusFlags & ITEMFLAG_BONUS_MASK], - (i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED)) || + (i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED)) || !i._bonusFlags ? "\b " : "" ); } @@ -315,7 +315,7 @@ Common::String WeaponItems::getAttributes(XeenItem &item, const Common::String & maxVal += Res.METAL_DAMAGE[item._material - 37]; toHit = Common::String::format("%+d", Res.METAL_DAMAGE_PERCENT[item._material - 37]); } - + physDamage = Common::String::format(Res.DAMAGE_X_TO_Y, minVal, maxVal); // Next handle elemental/attribute damage @@ -471,7 +471,7 @@ Common::String ArmorItems::getAttributes(XeenItem &item, const Common::String &c int eCategory = ELEM_FIRE; while (eCategory < ELEM_MAGIC && Res.ELEMENTAL_CATEGORIES[eCategory] < item._material) ++eCategory; - + elemResist = Common::String::format(Res.ATTR_XY_BONUS, resistence, Res.ELEMENTAL_NAMES[eCategory]); } @@ -617,7 +617,7 @@ Common::String MiscItems::getAttributes(XeenItem &item, const Common::String &cl } return Common::String::format(Res.ITEM_DETAILS, classes.c_str(), - Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, + Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, specialPower.c_str()); } /*------------------------------------------------------------------------*/ @@ -743,7 +743,7 @@ void Character::synchronize(Common::Serializer &s) { _level.synchronize(s); s.syncAsByte(_birthDay); s.syncAsByte(_tempAge); - + // Synchronize the skill list for (int idx = 0; idx < 18; ++idx) s.syncAsByte(_skills[idx]); @@ -760,7 +760,7 @@ void Character::synchronize(Common::Serializer &s) { // Synchronize spell list for (int i = 0; i < MAX_SPELLS_PER_CLASS - 1; ++i) - s.syncAsByte(_spells[i]); + s.syncAsByte(_spells[i]); s.syncAsByte(_lloydMap); s.syncAsByte(_lloydPosition.x); s.syncAsByte(_lloydPosition.y); @@ -784,7 +784,7 @@ void Character::synchronize(Common::Serializer &s) { _poisonResistence.synchronize(s); _energyResistence.synchronize(s); _magicResistence.synchronize(s); - + for (int i = 0; i < 16; ++i) s.syncAsByte(_conditions[i]); @@ -1025,7 +1025,7 @@ bool Character::noActions() { case IN_LOVE: case DRUNK: { Common::String msg = Common::String::format(Res.IN_NO_CONDITION, _name.c_str()); - ErrorScroll::show(Party::_vm, msg, + ErrorScroll::show(Party::_vm, msg, Party::_vm->_mode == 17 ? WT_2 : WT_NONFREEZED_WAIT); return true; } @@ -1170,7 +1170,7 @@ int Character::itemScan(int itemId) const { if (itemId > 10 && item._material < 37) { int mIndex = item.getElementalCategory() + 11; - + if (mIndex == itemId) result += Res.ELEMENTAL_RESISTENCES[item._material]; } @@ -1754,7 +1754,7 @@ int Character::makeItem(int p1, int itemIndex, int p3) { void Character::addHitPoints(int amount) { Interface &intf = *Party::_vm->_interface; Common::fill(&intf._charFX[0], &intf._charFX[MAX_ACTIVE_PARTY], 0); - + if (!isDead()) { int maxHp = getMaxHP(); if (_currentHp <= maxHp) { @@ -1824,11 +1824,11 @@ int Character::getClassCategory() const { case CLASS_ARCHER: case CLASS_SORCERER: return 1; - + case CLASS_DRUID: case CLASS_RANGER: return 2; - + default: return 0; } diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 9282b4e75b..bc01e87618 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -139,7 +139,7 @@ void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) { bool breakFlag = false; screen.closeWindows(); - + int idx = (int)party._activeParty.size(); if (!scripts._v2) { for (idx = 0; idx < (int)party._activeParty.size(); ++idx) { @@ -611,7 +611,7 @@ void Combat::monstersAttack() { intf.draw3d(true); events.pollEventsAndWait(); } while (!_vm->shouldQuit() && intf._isAttacking); - + endAttack(); if (_vm->_mode != MODE_COMBAT) { @@ -645,7 +645,7 @@ void Combat::setupMonsterAttack(int monsterDataIndex, const Common::Point &pt) { for (int idx = 0; idx < 36; ++idx) { if (_gmonHit[idx] != -1) { int result = stopAttack(pt - party._mazePosition); - if (result) { + if (result) { _monstersAttacking = true; _gmonHit[idx] = monsterDataIndex; @@ -877,7 +877,7 @@ void Combat::doMonsterTurn(int monsterId) { if (cond >= PARALYZED && cond <= ERADICATED) { Common::Array<int> ableChars; bool skip = false; - + for (uint idx = 0; idx < _combatParty.size() && !skip; ++idx) { switch (_combatParty[idx]->worstCondition()) { case PARALYZED: @@ -976,7 +976,7 @@ int Combat::stopAttack(const Common::Point &diffPt) { } } return dir == DIR_WEST ? diffPt.x * -1 + 1 : 1; - + } else if (diffPt.y <= 0) { for (int y = diffPt.y; y < 0; ++y) { int v = map.mazeLookup(Common::Point(mazePos.x, mazePos.y + y), 4); @@ -1032,7 +1032,7 @@ int Combat::stopAttack(const Common::Point &diffPt) { return 0; } return dir == DIR_WEST ? diffPt.x * -1 + 1 : 1; - + } else if (diffPt.y <= 0) { for (int y = diffPt.y; y < 0; ++y) { int v = map.mazeLookup(Common::Point(mazePos.x, mazePos.y + y), 0, 0x8000); @@ -1256,7 +1256,7 @@ void Combat::attack(Character &c, RangeType rangeType) { break; } } - } + } } else { Common::fill(&_elemPow[0], &_elemPow[PARTY_AND_MONSTERS], ELEM_FIRE); damage = 0; @@ -1392,7 +1392,7 @@ void Combat::attack2(int damage, RangeType rangeType) { damage += 100; if (monster._damageType == DT_SLEEP || monster._damageType == DT_DRAGONSLEEP) monster._damageType = DT_PHYSICAL; - + if ((!rangeType || !_damageType) && _attackWeaponId != 34) { if (monsterData._phsyicalResistence != 0) { if (monsterData._phsyicalResistence == 100) { @@ -1446,14 +1446,14 @@ void Combat::attack2(int damage, RangeType rangeType) { break; } } - + if (damage < 1) { sound.playSound(_missVoc, 1); sound.playFX(6); } else { _monsterScale[_monsterIndex] = getDamageScale(damage); intf.draw3d(true); - + sound.stopSound(); File powVoc(Common::String::format("pow%d.voc", POW_WEAPON_VOCS[_attackWeaponId])); @@ -1506,7 +1506,7 @@ void Combat::attack2(int damage, RangeType rangeType) { if (MONSTER_ITEM_RANGES[itemDrop] >= _vm->getRandomNumber(1, 100)) { Character tempChar; int category = tempChar.makeItem(itemDrop, 0, 0); - + switch (category) { case CATEGORY_WEAPON: for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { @@ -1609,7 +1609,7 @@ bool Combat::hitMonster(Character &c, RangeType rangeType) { getWeaponDamage(c, rangeType); int chance = c.statBonus(c.getStat(ACCURACY)) + _hitChanceBonus; int divisor = 0; - + switch (c._class) { case CLASS_KNIGHT: case CLASS_BARBARIAN: @@ -1758,7 +1758,7 @@ int Combat::getMonsterResistence(RangeType rangeType) { else if (material < 34) resistence = monsterData._energyResistence; else - resistence = monsterData._magicResistence; + resistence = monsterData._magicResistence; } } @@ -1767,7 +1767,7 @@ int Combat::getMonsterResistence(RangeType rangeType) { return 0; else return ((100 - resistence) * damage) / 100; - } + } return damage; } @@ -1840,7 +1840,7 @@ void Combat::multiAttack(int powNum) { int monsterIndex = _monsterIndex; int monster2Attack = _monster2Attack; bool attackedFlag = false; - + Common::Array<int> attackMonsters; for (int idx = 0; idx < 3; ++idx) { if (_attackMonsters[idx] != -1) diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp index 1924c69cf4..3304689416 100644 --- a/engines/xeen/dialogs.cpp +++ b/engines/xeen/dialogs.cpp @@ -45,7 +45,7 @@ void ButtonContainer::restoreButtons() { _buttons = _savedButtons.pop(); } -void ButtonContainer::addButton(const Common::Rect &bounds, int val, +void ButtonContainer::addButton(const Common::Rect &bounds, int val, SpriteResource *sprites) { _buttons.push_back(UIButton(bounds, val, sprites, true)); } @@ -80,7 +80,7 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) { } else if (events.isKeyPending()) { Common::KeyState keyState; events.getKey(keyState); - + _buttonValue = keyState.keycode; if (_buttonValue == Common::KEYCODE_KP8) _buttonValue = Common::KEYCODE_UP; @@ -137,7 +137,7 @@ void CreditsScreen::show(XeenEngine *vm) { void CreditsScreen::execute() { Screen &screen = *_vm->_screen; EventsManager &events = *_vm->_events; - + // Handle drawing the credits screen doScroll(true, false); screen._windows[GAME_WINDOW].close(); @@ -145,7 +145,7 @@ void CreditsScreen::execute() { screen.loadBackground("marb.raw"); screen._windows[0].writeString(Res.CREDITS); doScroll(false, false); - + events.setCursor(0); screen._windows[0].update(); clearButtons(); diff --git a/engines/xeen/dialogs_automap.cpp b/engines/xeen/dialogs_automap.cpp index 652494742a..16ce225515 100644 --- a/engines/xeen/dialogs_automap.cpp +++ b/engines/xeen/dialogs_automap.cpp @@ -76,7 +76,7 @@ void AutoMapDialog::execute() { // MazeData &mazeData = map.mazeDataCurrent(); bool drawFlag = true; int v; - + events.updateGameCounter(); do { if (drawFlag) @@ -106,7 +106,7 @@ void AutoMapDialog::execute() { } } - + for (int yp = 38, yDiff = pt.y + 7; yp < 166; yp += 8, --yDiff) { for (int xp = 80, xDiff = -7; xp < 240; xp += 10, ++xDiff) { v = map.mazeLookup(Common::Point(xDiff, yDiff), 8); @@ -128,7 +128,7 @@ void AutoMapDialog::execute() { map._tileSprites.draw(screen, 0, Common::Point(xp, yp)); } } - + // Draw thinner ground tiles on the left edge of the map for (int yp = 43, yDiff = pt.y + 7; yp < 171; yp += 8, --yDiff) { v = map.mazeLookup(Common::Point(pt.x - 8, yDiff), 0, 0xffff); @@ -137,13 +137,13 @@ void AutoMapDialog::execute() { map._tileSprites.draw(screen, 36 + map.mazeData()._surfaceTypes[ map._currentSurfaceId], Common::Point(75, yp)); } - + // Draw thin tile portion on top-left corner of map v = map.mazeLookup(Common::Point(pt.x - 8, pt.y + 8), 0, 0xffff); if (v != INVALID_CELL && map._currentSurfaceId != 0 && map._currentSteppedOn) map._tileSprites.draw(screen, 36 + map.mazeData()._surfaceTypes[ map._currentSurfaceId], Common::Point(75, 35)); - + // Draw any thin tiles at the very top of the map for (int xp = 85, xDiff = pt.x - 7; xp < 245; xp += 10, ++xDiff) { v = map.mazeLookup(Common::Point(xDiff, pt.y + 8), 0, 0xffff); @@ -165,7 +165,7 @@ void AutoMapDialog::execute() { } // Draw walls on left and top edges of map - for (int xp = 80, yp = 158, xDiff = pt.x - 7, yDiff = pt.y - 8; xp < 250; + for (int xp = 80, yp = 158, xDiff = pt.x - 7, yDiff = pt.y - 8; xp < 250; xp += 10, yp -= 8, ++xDiff, ++yDiff) { // Draw walls on left edge of map v = map.mazeLookup(Common::Point(pt.x - 8, yDiff), 12); @@ -385,7 +385,7 @@ void AutoMapDialog::execute() { map._tileSprites.draw(screen, frame, Common::Point(xp, yp)); } } - + // Draw overlay on cells that haven't been stepped on yet for (int yDiff = pt.y + 7, yp = 38; yp < 166; --yDiff, yp += 8) { for (int xp = 80, xDiff = pt.x - 7; xp < 240; xp += 10, ++xDiff) { diff --git a/engines/xeen/dialogs_char_info.cpp b/engines/xeen/dialogs_char_info.cpp index 6dd79618ed..23f089b93e 100644 --- a/engines/xeen/dialogs_char_info.cpp +++ b/engines/xeen/dialogs_char_info.cpp @@ -206,7 +206,7 @@ void CharacterInfo::execute(int charIndex) { goto exit; } } while (!_vm->shouldQuit()); -exit: +exit: w.close(); intf.unhighlightChar(); _vm->_mode = oldMode; @@ -400,7 +400,7 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) { stat1, stat2); bounds.setHeight(42); break; - + case 11: // Spell Points stat1 = c._currentSp; diff --git a/engines/xeen/dialogs_error.h b/engines/xeen/dialogs_error.h index 56e30bc9de..3657cd01be 100644 --- a/engines/xeen/dialogs_error.h +++ b/engines/xeen/dialogs_error.h @@ -28,7 +28,7 @@ namespace Xeen { -enum ErrorWaitType { WT_FREEZE_WAIT = 0, WT_NONFREEZED_WAIT = 1, +enum ErrorWaitType { WT_FREEZE_WAIT = 0, WT_NONFREEZED_WAIT = 1, WT_2 = 2, WT_3 = 3 }; class ErrorDialog : public ButtonContainer { @@ -43,7 +43,7 @@ public: class ErrorScroll { public: - static void show(XeenEngine *vm, const Common::String &msg, + static void show(XeenEngine *vm, const Common::String &msg, ErrorWaitType waitType = WT_FREEZE_WAIT); }; diff --git a/engines/xeen/dialogs_info.cpp b/engines/xeen/dialogs_info.cpp index 945567c9b2..d0cd7c5243 100644 --- a/engines/xeen/dialogs_info.cpp +++ b/engines/xeen/dialogs_info.cpp @@ -37,7 +37,7 @@ void InfoDialog::execute() { EventsManager &events = *_vm->_events; Interface &intf = *_vm->_interface; Party &party = *_vm->_party; - + protectionText(); Common::String statusText = ""; for (uint idx = 0; idx < _lines.size(); ++idx) diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp index 943b038d09..5376fb7c46 100644 --- a/engines/xeen/dialogs_input.cpp +++ b/engines/xeen/dialogs_input.cpp @@ -26,7 +26,7 @@ namespace Xeen { -int Input::show(XeenEngine *vm, Window *window, Common::String &line, +int Input::show(XeenEngine *vm, Window *window, Common::String &line, uint maxLen, int maxWidth, bool isNumeric) { Input *dlg = new Input(vm, window); int result = dlg->getString(line, maxLen, maxWidth, isNumeric); @@ -129,7 +129,7 @@ int StringInput::show(XeenEngine *vm, bool type, const Common::String &msg1, return result; } -int StringInput::execute(bool type, const Common::String &expected, +int StringInput::execute(bool type, const Common::String &expected, const Common::String &title, int opcode) { Interface &intf = *_vm->_interface; Screen &screen = *_vm->_screen; @@ -211,7 +211,7 @@ int Choose123::execute(int numOptions) { Interface &intf = *_vm->_interface; Screen &screen = *_vm->_screen; Town &town = *_vm->_town; - + Mode oldMode = _vm->_mode; _vm->_mode = MODE_DIALOG_123; diff --git a/engines/xeen/dialogs_input.h b/engines/xeen/dialogs_input.h index ce159c77a3..8221320b22 100644 --- a/engines/xeen/dialogs_input.h +++ b/engines/xeen/dialogs_input.h @@ -45,7 +45,7 @@ protected: Input(XeenEngine *vm, Window *window) : ButtonContainer(vm), _window(window) {} public: - static int show(XeenEngine *vm, Window *window, Common::String &line, + static int show(XeenEngine *vm, Window *window, Common::String &line, uint maxLen, int maxWidth, bool isNumeric = false); }; @@ -53,10 +53,10 @@ class StringInput : public Input { protected: StringInput(XeenEngine *vm); - int execute(bool type, const Common::String &expected, + int execute(bool type, const Common::String &expected, const Common::String &title, int opcode); public: - static int show(XeenEngine *vm, bool type, const Common::String &msg1, + static int show(XeenEngine *vm, bool type, const Common::String &msg1, const Common::String &msg2, int opcode); }; diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp index 56de6a5b17..227b5708e7 100644 --- a/engines/xeen/dialogs_items.cpp +++ b/engines/xeen/dialogs_items.cpp @@ -42,9 +42,9 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { Interface &intf = *_vm->_interface; Party &party = *_vm->_party; Screen &screen = *_vm->_screen; - + Character *startingChar = c; - ItemCategory category = mode == ITEMMODE_RECHARGE || mode == ITEMMODE_COMBAT ? + ItemCategory category = mode == ITEMMODE_RECHARGE || mode == ITEMMODE_COMBAT ? CATEGORY_MISC : CATEGORY_WEAPON; int varA = mode == ITEMMODE_COMBAT ? 1 : 0; if (varA != 0) @@ -88,7 +88,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { Res.BTN_SELL, Res.BTN_IDENTIFY, Res.BTN_FIX); } else if (mode != ITEMMODE_ENCHANT && mode != ITEMMODE_RECHARGE && mode != ITEMMODE_TO_GOLD) { msg = Common::String::format(Res.ITEMS_DIALOG_TEXT1, - category == 3 ? Res.BTN_USE : Res.BTN_EQUIP, + category == 3 ? Res.BTN_USE : Res.BTN_EQUIP, Res.BTN_REMOVE, Res.BTN_DISCARD, Res.BTN_QUEST); } else if (mode == ITEMMODE_ENCHANT) { msg = Common::String::format(Res.ITEMS_DIALOG_TEXT2, Res.BTN_ENCHANT); @@ -138,7 +138,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { _itemsDrawList[idx]._y = 10 + idx * 9; switch (category) { - case CATEGORY_WEAPON: + case CATEGORY_WEAPON: case CATEGORY_ARMOR: case CATEGORY_ACCESSORY: { XeenItem &i = (category == CATEGORY_WEAPON) ? c->_weapons[idx] : @@ -147,7 +147,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { if (i._id) { if (mode == ITEMMODE_CHAR_INFO || mode == ITEMMODE_8 || mode == ITEMMODE_ENCHANT || mode == ITEMMODE_RECHARGE) { - lines.push_back(Common::String::format(Res.ITEMS_DIALOG_LINE1, + lines.push_back(Common::String::format(Res.ITEMS_DIALOG_LINE1, arr[idx], idx + 1, c->_items[category].getFullDescription(idx, arr[idx]).c_str())); } else { @@ -225,7 +225,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { // Original uses var in this block that's never set?! const int v1 = 0; screen._windows[30].writeString(Common::String::format(Res.AVAILABLE_GOLD_COST, - Res.CATEGORY_NAMES[category], + Res.CATEGORY_NAMES[category], v1 ? "" : "s", party._gold, lines[0].c_str(), lines[1].c_str(), lines[2].c_str(), lines[3].c_str(), lines[4].c_str(), lines[5].c_str(), lines[6].c_str(), lines[7].c_str(), @@ -287,8 +287,8 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { default: break; } - } - + } + // If it's time to do an item action, take care of it if (actionIndex >= 0) { int result = doItemOptions(*c, actionIndex, itemIndex, category, mode); @@ -307,7 +307,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { // Otherwise, result and continue showing dialog actionIndex = -1; } - + // Wait for a selection _buttonValue = 0; while (!_vm->shouldQuit() && !_buttonValue) { @@ -332,11 +332,11 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { case Common::KEYCODE_F4: case Common::KEYCODE_F5: case Common::KEYCODE_F6: - if (!varA && mode != ITEMMODE_3 && mode != ITEMMODE_ENCHANT + if (!varA && mode != ITEMMODE_3 && mode != ITEMMODE_ENCHANT && mode != ITEMMODE_RECHARGE && mode != ITEMMODE_TO_GOLD && party._mazeId != 0) { _buttonValue -= Common::KEYCODE_F1; - + if (_buttonValue < (int)(_vm->_mode == MODE_COMBAT ? combat._combatParty.size() : party._activeParty.size())) { // Character number is valid @@ -391,7 +391,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { // Select an item if (mode == ITEMMODE_3) break; - + _buttonValue -= Common::KEYCODE_1; if (_buttonValue != itemIndex) { // Check whether the new selection has an associated item @@ -431,7 +431,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { if (mode == ITEMMODE_CHAR_INFO) actionIndex = 3; break; - + case Common::KEYCODE_e: if (mode == ITEMMODE_CHAR_INFO || mode == ITEMMODE_ENCHANT || mode == ITEMMODE_TO_GOLD) { @@ -447,7 +447,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) { mode = ITEMMODE_REPAIR; c = startingChar; redrawFlag = REDRAW_TEXT; - } + } break; case Common::KEYCODE_g: @@ -653,7 +653,7 @@ void ItemsDialog::setEquipmentIcons() { i._frame = 11; break; } - + default: break; } @@ -684,7 +684,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode, default: break; } - + switch (category) { case CATEGORY_WEAPON: case CATEGORY_ARMOR: @@ -694,7 +694,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode, (mode == 1 ? c->_armor[itemIndex] : c->_accessories[itemIndex]); amount1 = (mode == 0) ? Res.WEAPON_BASE_COSTS[i._id] : (mode == 1 ? Res.ARMOR_BASE_COSTS[i._id] : Res.ACCESSORY_BASE_COSTS[i._id]); - + if (i._material > 36 && i._material < 59) { switch (i._material) { case 37: @@ -719,7 +719,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode, amount2 = Res.ELEMENTAL_DAMAGE[i._material] * 100; else if (i._material > 58) amount3 = Res.ELEMENTAL_DAMAGE[i._material - 59 + 7] * 100; - + switch (mode) { case ITEMMODE_BLACKSMITH: case ITEMMODE_2: @@ -741,7 +741,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode, XeenItem &i = c->_misc[itemIndex]; amount1 = Res.MISC_MATERIAL_COSTS[i._material]; amount4 = Res.MISC_BASE_COSTS[i._id]; - + switch (mode) { case ITEMMODE_BLACKSMITH: case ITEMMODE_2: diff --git a/engines/xeen/dialogs_items.h b/engines/xeen/dialogs_items.h index c161b0721b..cfa6818843 100644 --- a/engines/xeen/dialogs_items.h +++ b/engines/xeen/dialogs_items.h @@ -31,7 +31,7 @@ namespace Xeen { enum ItemsMode { ITEMMODE_CHAR_INFO = 0, ITEMMODE_BLACKSMITH = 1, ITEMMODE_2 = 2, ITEMMODE_3 = 3, - ITEMMODE_RECHARGE = 4, ITEMMODE_5 = 5, ITEMMODE_ENCHANT = 6, ITEMMODE_COMBAT = 7, ITEMMODE_8 = 8, + ITEMMODE_RECHARGE = 4, ITEMMODE_5 = 5, ITEMMODE_ENCHANT = 6, ITEMMODE_COMBAT = 7, ITEMMODE_8 = 8, ITEMMODE_REPAIR = 9, ITEMMODE_IDENTIFY = 10, ITEMMODE_TO_GOLD = 11 }; @@ -73,10 +73,10 @@ private: /** * Calculate the cost of an item */ - int calcItemCost(Character *c, int itemIndex, ItemsMode mode, int skillLevel, + int calcItemCost(Character *c, int itemIndex, ItemsMode mode, int skillLevel, ItemCategory category); - int doItemOptions(Character &c, int actionIndex, int itemIndex, + int doItemOptions(Character &c, int actionIndex, int itemIndex, ItemCategory category, ItemsMode mode); void itemToGold(Character &c, int itemIndex, ItemCategory category, ItemsMode mode); diff --git a/engines/xeen/dialogs_party.cpp b/engines/xeen/dialogs_party.cpp index 9457173e0e..3dc47d1e9b 100644 --- a/engines/xeen/dialogs_party.cpp +++ b/engines/xeen/dialogs_party.cpp @@ -32,7 +32,7 @@ namespace Xeen { -PartyDialog::PartyDialog(XeenEngine *vm) : ButtonContainer(vm), +PartyDialog::PartyDialog(XeenEngine *vm) : ButtonContainer(vm), PartyDrawer(vm), _vm(vm) { initDrawStructs(); } @@ -264,7 +264,7 @@ void PartyDialog::execute() { startingCharChanged(startingChar); } break; - + default: break; } @@ -579,11 +579,11 @@ void PartyDialog::createChar() { _buttons[destAttrib + 10]._bounds.left, _buttons[destAttrib + 10]._bounds.top)); w.update(); - + SWAP(attribs[srcAttrib], attribs[destAttrib]); checkClass(attribs, allowedClasses); classId = -1; - selectedClass = newCharDetails(attribs, allowedClasses, + selectedClass = newCharDetails(attribs, allowedClasses, race, sex, classId, selectedClass, msg); } else { icons.draw(w, srcAttrib * 2 + 10, Common::Point( @@ -642,7 +642,7 @@ void PartyDialog::createChar() { if (_buttonValue != Common::KEYCODE_PAGEDOWN) { selectedClass = newCharDetails(attribs, allowedClasses, race, sex, classId, selectedClass, msg); - + for (int idx = 0; idx < 7; ++idx) icons.draw(w, 10 + idx * 2, Common::Point(168, 19 + idx * 24)); for (int idx = 0; idx < 10; ++idx) @@ -656,7 +656,7 @@ void PartyDialog::createChar() { icons.draw(w, 61, Common::Point(220, 19)); icons.draw(w, 64, Common::Point(220, 155)); icons.draw(w, 65, Common::Point(220, 170)); - + party._roster[freeCharList[charIndex]]._faceSprites->draw(w, 0, Common::Point(27, 102)); @@ -675,7 +675,7 @@ void PartyDialog::createChar() { } } - // Move to next available class, or if the code block above resulted in + // Move to next available class, or if the code block above resulted in // selectedClass being -1, move to select the first available class for (int tempClass = selectedClass + 1; tempClass <= CLASS_RANGER; ++tempClass) { if (allowedClasses[tempClass]) { @@ -686,7 +686,7 @@ void PartyDialog::createChar() { printSelectionArrow(icons, selectedClass); } while (!_vm->shouldQuit() && _buttonValue != Common::KEYCODE_ESCAPE); - + _vm->_mode = oldMode; } @@ -707,7 +707,7 @@ int PartyDialog::selectCharacter(bool isDelete, int firstDisplayChar) { w.update(); saveButtons(); - addButton(Common::Rect(225, isDelete ? 120 : 84, 249, isDelete ? 140 : 104), + addButton(Common::Rect(225, isDelete ? 120 : 84, 249, isDelete ? 140 : 104), Common::KEYCODE_ESCAPE, &iconSprites); addButton(Common::Rect(16, 16, 48, 48), Common::KEYCODE_1); addButton(Common::Rect(117, 16, 149, 48), Common::KEYCODE_2); @@ -755,7 +755,7 @@ int PartyDialog::selectCharacter(bool isDelete, int firstDisplayChar) { default: break; } - } + } w.close(); restoreButtons(); @@ -802,7 +802,7 @@ void PartyDialog::checkClass(const uint attribs[TOTAL_ATTRIBUTES], bool allowedC } int PartyDialog::newCharDetails(const uint attribs[TOTAL_ATTRIBUTES], - bool allowedClasses[TOTAL_CLASSES], Race race, Sex sex, int classId, + bool allowedClasses[TOTAL_CLASSES], Race race, Sex sex, int classId, int selectedClass, Common::String &msg) { int foundClass = -1; Common::String skillStr, classStr, raceSkillStr; diff --git a/engines/xeen/dialogs_party.h b/engines/xeen/dialogs_party.h index 17ec4fd300..84b98579e1 100644 --- a/engines/xeen/dialogs_party.h +++ b/engines/xeen/dialogs_party.h @@ -78,7 +78,7 @@ private: /** * Return details of the generated character */ - int newCharDetails(const uint attribs[TOTAL_ATTRIBUTES], + int newCharDetails(const uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES], Race race, Sex sex, int classId, int selectedClass, Common::String &msg); diff --git a/engines/xeen/dialogs_query.cpp b/engines/xeen/dialogs_query.cpp index d8dfea116a..76083a8170 100644 --- a/engines/xeen/dialogs_query.cpp +++ b/engines/xeen/dialogs_query.cpp @@ -127,7 +127,7 @@ bool YesNo::execute(bool type, bool townFlag) { while (!_vm->shouldQuit()) { events.updateGameCounter(); - + if (town.isActive()) { town.drawTownAnim(townFlag); //numFrames = 3; diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp index 47125c4fa7..f5dfe65b00 100644 --- a/engines/xeen/dialogs_spells.cpp +++ b/engines/xeen/dialogs_spells.cpp @@ -30,7 +30,7 @@ namespace Xeen { -Character *SpellsDialog::show(XeenEngine *vm, ButtonContainer *priorDialog, +Character *SpellsDialog::show(XeenEngine *vm, ButtonContainer *priorDialog, Character *c, int isCasting) { SpellsDialog *dlg = new SpellsDialog(vm); Character *result = dlg->execute(priorDialog, c, isCasting); @@ -228,7 +228,7 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int int spellCost = spells.calcSpellCost(spellId, expenseFactor); if (isCasting) { - selection = newSelection; + selection = newSelection; } else { Common::String spellName = _spells[newSelection]._name; Common::String msg = (castingCopy & 0x80) ? @@ -499,7 +499,7 @@ int CastSpell::execute(Character *&c) { int spCost = spells.calcSpellPoints(spellId, c->getCurrentLevel()); w.writeString(Common::String::format(Res.CAST_SPELL_DETAILS, - c->_name.c_str(), spells._spellNames[spellId].c_str(), + c->_name.c_str(), spells._spellNames[spellId].c_str(), spCost, gemCost, c->_currentSp)); drawButtons(&screen); w.update(); @@ -586,7 +586,7 @@ Character *SpellOnWho::show(XeenEngine *vm, int spellId) { if (result == -1) return nullptr; - + Combat &combat = *vm->_combat; Party &party = *vm->_party; return combat._combatMode == 2 ? combat._combatParty[result] : @@ -851,7 +851,7 @@ bool LloydsBeacon::execute() { c._lloydMap = party._mazeId; c._lloydPosition = party._mazePosition; c._lloydSide = isDarkCc ? 1 : 0; - + _buttonValue = Common::KEYCODE_ESCAPE; break; } @@ -959,7 +959,7 @@ int TownPortal::execute() { townNames[3].c_str(), townNames[4].c_str() )); w.update(); - + // Get the town number int townNumber; Common::String num; diff --git a/engines/xeen/dialogs_spells.h b/engines/xeen/dialogs_spells.h index 3ccdb836a3..c1aeadc68d 100644 --- a/engines/xeen/dialogs_spells.h +++ b/engines/xeen/dialogs_spells.h @@ -53,7 +53,7 @@ private: const char *setSpellText(Character *c, int isCasting); public: - static Character *show(XeenEngine *vm, ButtonContainer *priorDialog, + static Character *show(XeenEngine *vm, ButtonContainer *priorDialog, Character *c, int isCasting); }; diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp index ff4a56fcb0..06dd3d12a7 100644 --- a/engines/xeen/files.cpp +++ b/engines/xeen/files.cpp @@ -118,14 +118,14 @@ int BaseCCArchive::listMembers(Common::ArchiveMemberList &list) const { /*------------------------------------------------------------------------*/ -CCArchive::CCArchive(const Common::String &filename, bool encoded): +CCArchive::CCArchive(const Common::String &filename, bool encoded): BaseCCArchive(), _filename(filename), _encoded(encoded) { File f(filename); loadIndex(&f); } -CCArchive::CCArchive(const Common::String &filename, const Common::String &prefix, - bool encoded): BaseCCArchive(), _filename(filename), +CCArchive::CCArchive(const Common::String &filename, const Common::String &prefix, + bool encoded): BaseCCArchive(), _filename(filename), _prefix(prefix), _encoded(encoded) { _prefix.toLowercase(); File f(filename); diff --git a/engines/xeen/files.h b/engines/xeen/files.h index d73eb281c6..ffb703374b 100644 --- a/engines/xeen/files.h +++ b/engines/xeen/files.h @@ -32,7 +32,7 @@ namespace Xeen { -enum ArchiveType { +enum ArchiveType { ANY_ARCHIVE = -1, GAME_ARCHIVE = 0, ALTSIDE_ARCHIVE = 1, INTRO_ARCHIVE = 2 }; diff --git a/engines/xeen/font.cpp b/engines/xeen/font.cpp index 459a334da0..ae2f37fa2d 100644 --- a/engines/xeen/font.cpp +++ b/engines/xeen/font.cpp @@ -26,7 +26,7 @@ namespace Xeen { -FontSurface::FontSurface() : XSurface(), _fontData(nullptr), _bgColor(DEFAULT_BG_COLOR), +FontSurface::FontSurface() : XSurface(), _fontData(nullptr), _bgColor(DEFAULT_BG_COLOR), _fontReduced(false),_fontJustify(JUSTIFY_NONE), _msgWraps(false) { setTextColor(0); } @@ -60,7 +60,7 @@ const char *FontSurface::writeString(const Common::String &s, const Common::Rect for (;;) { const char *msgStartP = _displayString; _msgWraps = false; - + // Get the size of the string that can be displayed on the line int xp = _fontJustify == JUSTIFY_CENTER ? bounds.left : _writePos.x; while (!getNextCharWidth(xp)) { @@ -94,7 +94,7 @@ const char *FontSurface::writeString(const Common::String &s, const Common::Rect break; } } else { - // Found word break, find end of previous word + // Found word break, find end of previous word while (endP > _displayString && (*endP & 0x7f) == ' ') --endP; @@ -136,7 +136,7 @@ const char *FontSurface::writeString(const Common::String &s, const Common::Rect // Main character display loop while (_displayString <= displayEnd) { char c = getNextChar(); - + if (c == ' ') { _writePos.x += _fontReduced ? 3 : 4; } else if (c == '\r') { @@ -281,7 +281,7 @@ bool FontSurface::newLine(const Common::Rect &bounds) { _msgWraps = false; _writePos.x = bounds.left; - + int hv = _fontReduced ? 9 : 10; _writePos.y += hv; diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 3c3b572518..d95f613241 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -60,7 +60,7 @@ void PartyDrawer::drawParty(bool updateFlag) { Character &ps = inCombat ? *combat._combatParty[idx] : party._activeParty[idx]; Condition charCondition = ps.worstCondition(); int charFrame = Res.FACE_CONDITION_FRAMES[charCondition]; - + SpriteResource *sprites = (charFrame > 4) ? &_dseFace : ps._faceSprites; if (charFrame > 4) charFrame -= 5; @@ -130,7 +130,7 @@ void PartyDrawer::resetHighlight() { } /*------------------------------------------------------------------------*/ -Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceMap(vm), +Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceMap(vm), PartyDrawer(vm), _vm(vm) { _buttonsLoaded = false; _intrIndex1 = 0; @@ -285,7 +285,7 @@ void Interface::perform() { return; if (_buttonValue == Common::KEYCODE_SPACE) { - int lookupId = map.mazeLookup(party._mazePosition, + int lookupId = map.mazeLookup(party._mazePosition, Res.WALL_SHIFTS[party._mazeDirection][2]); bool eventsFlag = true; @@ -497,7 +497,7 @@ void Interface::perform() { case Common::KEYCODE_b: chargeStep(); - + if (map.getCell(2) < map.mazeData()._difficulties._wallNoPass && !map._isOutdoors) { switch (party._mazeDirection) { @@ -623,7 +623,7 @@ void Interface::stepTime() { Party &party = *_vm->_party; Sound &sound = *_vm->_sound; doStepCode(); - + if (++party._ctr24 == 24) party._ctr24 = 0; @@ -652,11 +652,11 @@ void Interface::doStepCode() { switch (surfaceId) { case SURFTYPE_SPACE: - // Wheeze.. can't breathe in space! Explosive decompression, here we come + // Wheeze.. can't breathe in space! Explosive decompression, here we come party._partyDead = true; break; case SURFTYPE_LAVA: - // It burns, it burns! + // It burns, it burns! damage = 100; party._damageType = DT_FIRE; break; @@ -740,8 +740,8 @@ void Interface::startFalling(bool flag) { map._isOutdoors) { map.getNewMaze(); } - } - + } + if (isDarkCc) { switch (party._mazeId - 25) { case 0: @@ -944,7 +944,7 @@ bool Interface::checkMoveDirection(int key) { default: break; } - + map.getCell(7); int startSurfaceId = map._currentSurfaceId; int surfaceId; @@ -1064,7 +1064,7 @@ void Interface::rest() { for (int idx = 0; idx < 10; ++idx) { chargeStep(); draw3d(true); - + if (_vm->_mode == MODE_1) { _vm->_mode = oldMode; return; @@ -1178,7 +1178,7 @@ void Interface::bash(const Common::Point &pt, Direction direction) { } party._activeParty[charNum1 - 1].subtractHitPoints(2); - _charPowSprites.draw(screen._windows[0], 0, + _charPowSprites.draw(screen._windows[0], 0, Common::Point(Res.CHAR_FACES_X[charNum1 - 1], 150)); screen._windows[0].update(); @@ -1246,7 +1246,7 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) { Party &party = *_vm->_party; Screen &screen = *_vm->_screen; Scripts &scripts = *_vm->_scripts; - + if (screen._windows[11]._enabled) return; @@ -1286,7 +1286,7 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) { if (combat._attackMonsters[0] != -1 || combat._attackMonsters[1] != -1 || combat._attackMonsters[2] != -1) { - if ((_vm->_mode == MODE_1 || _vm->_mode == MODE_SLEEPING) && + if ((_vm->_mode == MODE_1 || _vm->_mode == MODE_SLEEPING) && !combat._monstersAttacking && !_charsShooting && combat._moveMonsters) { doCombat(); if (scripts._eventSkipped) @@ -1862,7 +1862,7 @@ void Interface::doCombat() { Sound &sound = *_vm->_sound; bool upDoorText = _upDoorText; bool reloadMap = false; - + _upDoorText = false; combat._combatMode = COMBATMODE_2; _vm->_mode = MODE_COMBAT; @@ -1974,7 +1974,7 @@ void Interface::doCombat() { combat.block(); nextChar(); break; - + case Common::KEYCODE_c: { // Cast spell int spellId = CastSpell::show(_vm); @@ -2005,7 +2005,7 @@ void Interface::doCombat() { FightOptions::show(_vm); highlightChar(combat._whosTurn); break; - + case Common::KEYCODE_q: // Quick Reference dialog QuickReferenceDialog::show(_vm); @@ -2054,7 +2054,7 @@ void Interface::doCombat() { case Common::KEYCODE_RIGHT: // Rotate party direction left or right if (_buttonValue == Common::KEYCODE_LEFT) { - party._mazeDirection = (party._mazeDirection == DIR_NORTH) ? + party._mazeDirection = (party._mazeDirection == DIR_NORTH) ? DIR_WEST : (Direction)((int)party._mazeDirection - 1); } else { party._mazeDirection = (party._mazeDirection == DIR_WEST) ? diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp index 0244e3e081..1ada1c6e77 100644 --- a/engines/xeen/interface_map.cpp +++ b/engines/xeen/interface_map.cpp @@ -27,7 +27,7 @@ namespace Xeen { -OutdoorDrawList::OutdoorDrawList() : _sky1(_data[0]), _sky2(_data[1]), +OutdoorDrawList::OutdoorDrawList() : _sky1(_data[0]), _sky2(_data[1]), _groundSprite(_data[2]), _attackImgs1(&_data[124]), _attackImgs2(&_data[95]), _attackImgs3(&_data[76]), _attackImgs4(&_data[53]), _groundTiles(&_data[3]) { _data[0] = DrawStruct(0, 8, 8); @@ -166,21 +166,21 @@ OutdoorDrawList::OutdoorDrawList() : _sky1(_data[0]), _sky2(_data[1]), /*------------------------------------------------------------------------*/ -IndoorDrawList::IndoorDrawList() : +IndoorDrawList::IndoorDrawList() : _sky1(_data[0]), _sky2(_data[1]), _ground(_data[2]), _horizon(_data[28]), - _swl_0F1R(_data[146]), _swl_0F1L(_data[144]), _swl_1F1R(_data[134]), - _swl_1F1L(_data[133]), _swl_2F2R(_data[110]), _swl_2F1R(_data[109]), - _swl_2F1L(_data[108]), _swl_2F2L(_data[107]), _swl_3F1R(_data[ 78]), + _swl_0F1R(_data[146]), _swl_0F1L(_data[144]), _swl_1F1R(_data[134]), + _swl_1F1L(_data[133]), _swl_2F2R(_data[110]), _swl_2F1R(_data[109]), + _swl_2F1L(_data[108]), _swl_2F2L(_data[107]), _swl_3F1R(_data[ 78]), _swl_3F2R(_data[ 77]), _swl_3F3R(_data[ 76]), _swl_3F4R(_data[ 75]), - _swl_3F1L(_data[ 74]), _swl_3F2L(_data[ 73]), _swl_3F3L(_data[ 72]), - _swl_3F4L(_data[ 71]), _swl_4F4R(_data[ 33]), _swl_4F3R(_data[ 34]), + _swl_3F1L(_data[ 74]), _swl_3F2L(_data[ 73]), _swl_3F3L(_data[ 72]), + _swl_3F4L(_data[ 71]), _swl_4F4R(_data[ 33]), _swl_4F3R(_data[ 34]), _swl_4F2R(_data[ 35]), _swl_4F1R(_data[ 36]), _swl_4F1L(_data[ 32]), _swl_4F2L(_data[ 31]), _swl_4F3L(_data[ 30]), _swl_4F4L(_data[ 29]), - _fwl_4F4R(_data[ 45]), _fwl_4F3R(_data[ 44]), _fwl_4F2R(_data[ 43]), - _fwl_4F1R(_data[ 42]), _fwl_4F( _data[ 41]), _fwl_4F1L(_data[ 40]), + _fwl_4F4R(_data[ 45]), _fwl_4F3R(_data[ 44]), _fwl_4F2R(_data[ 43]), + _fwl_4F1R(_data[ 42]), _fwl_4F( _data[ 41]), _fwl_4F1L(_data[ 40]), _fwl_4F2L(_data[ 39]), _fwl_4F3L(_data[ 38]), _fwl_4F4L(_data[ 37]), - _fwl_2F1R(_data[121]), _fwl_2F( _data[120]), _fwl_2F1L(_data[119]), - _fwl_3F2R(_data[ 91]), _fwl_3F1R(_data[ 90]), _fwl_3F( _data[ 89]), + _fwl_2F1R(_data[121]), _fwl_2F( _data[120]), _fwl_2F1L(_data[119]), + _fwl_3F2R(_data[ 91]), _fwl_3F1R(_data[ 90]), _fwl_3F( _data[ 89]), _fwl_3F1L(_data[ 88]), _fwl_3F2L(_data[ 87]), _fwl_1F( _data[147]), _fwl_1F1R(_data[145]), _fwl_1F1L(_data[143]), _groundTiles(&_data[3]), @@ -2608,7 +2608,7 @@ void InterfaceMap::setIndoorsMonsters() { } } -void InterfaceMap::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster, SpriteResource *sprites, +void InterfaceMap::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster, SpriteResource *sprites, int frame, int defaultY) { MonsterStruct &monsterData = *monster._monsterData; bool flying = monsterData._flying; @@ -3533,7 +3533,7 @@ void InterfaceMap::drawIndoors() { drawStruct._sprites = sprites.empty() ? (SpriteResource *)nullptr : &sprites; surfaceId = map.mazeData()._surfaceTypes[map._currentSurfaceId]; - if (surfaceId == SURFTYPE_WATER || surfaceId == SURFTYPE_LAVA || + if (surfaceId == SURFTYPE_WATER || surfaceId == SURFTYPE_LAVA || surfaceId == SURFTYPE_SEWER) { drawStruct._frame = Res.DRAW_FRAMES[cellIndex][_flipWater ? 1 : 0]; drawStruct._flags = _flipWater ? SPRFLAG_HORIZ_FLIPPED : 0; @@ -4343,7 +4343,7 @@ void InterfaceMap::drawIndoors() { _vm->_party->_mazeDirection][_vm->_party->_mazePosition.y] ); map.cellFlagLookup(pt); - + _indoorList._sky2._sprites = &map._skySprites[0]; } else { _indoorList._sky2._sprites = _indoorList[0]._sprites; @@ -4362,7 +4362,7 @@ void InterfaceMap::drawIndoors() { if (_vm->_combat->_shooting[idx]) _isAttacking = true; } - + _charsShooting = _isAttacking; } diff --git a/engines/xeen/interface_map.h b/engines/xeen/interface_map.h index 2189aacec1..47a7bad963 100644 --- a/engines/xeen/interface_map.h +++ b/engines/xeen/interface_map.h @@ -44,9 +44,9 @@ public: public: OutdoorDrawList(); - DrawStruct &operator[](int idx) { + DrawStruct &operator[](int idx) { assert(idx < size()); - return _data[idx]; + return _data[idx]; } int size() const { return 132; } @@ -80,9 +80,9 @@ public: public: IndoorDrawList(); - DrawStruct &operator[](int idx) { + DrawStruct &operator[](int idx) { assert(idx < size()); - return _data[idx]; + return _data[idx]; } int size() const { return 170; } @@ -99,7 +99,7 @@ private: * Helper method for setIndoorsMonsters to set a draw structure * with the deatils for a given monster */ - void setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster, + void setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster, SpriteResource *sprites, int frame, int defaultY); protected: int8 _wp[20]; diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index a7be48af8f..f904344206 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -80,13 +80,13 @@ MonsterStruct::MonsterStruct(Common::String name, int experience, int hp, int ac bool flying, int imageNumber, int loopAnimation, int animationEffect, int fx, Common::String attackVoc): _name(name), _experience(experience), _hp(hp), _accuracy(accuracy), - _speed(speed), _numberOfAttacks(numberOfAttacks), _hatesClass(hatesClass), - _strikes(strikes), _dmgPerStrike(dmgPerStrike), _attackType(attackType), - _specialAttack(specialAttack), _hitChance(hitChance), _rangeAttack(rangeAttack), - _monsterType(monsterType), _fireResistence(fireResistence), + _speed(speed), _numberOfAttacks(numberOfAttacks), _hatesClass(hatesClass), + _strikes(strikes), _dmgPerStrike(dmgPerStrike), _attackType(attackType), + _specialAttack(specialAttack), _hitChance(hitChance), _rangeAttack(rangeAttack), + _monsterType(monsterType), _fireResistence(fireResistence), _electricityResistence(electricityResistence), _coldResistence(coldResistence), _poisonResistence(poisonResistence), _energyResistence(energyResistence), - _magicResistence(magicResistence), _phsyicalResistence(phsyicalResistence), + _magicResistence(magicResistence), _phsyicalResistence(phsyicalResistence), _field29(field29), _gold(gold), _gems(gems), _itemDrop(itemDrop), _flying(flying), _imageNumber(imageNumber), _loopAnimation(loopAnimation), _animationEffect(animationEffect), _fx(fx), _attackVoc(attackVoc) { @@ -127,7 +127,7 @@ void MonsterStruct::synchronize(Common::SeekableReadStream &s) { _loopAnimation = s.readByte(); _animationEffect = s.readByte(); _fx = s.readByte(); - + char attackVoc[10]; s.read(attackVoc, 9); attackVoc[9] = '\0'; @@ -640,7 +640,7 @@ MazeObject::MazeObject() { _direction = DIR_NORTH; _flipped = false; _sprites = nullptr; -} +} /*------------------------------------------------------------------------*/ @@ -1040,7 +1040,7 @@ void Map::load(int mapId) { } // TODO: Switch setting flags that don't seem to ever be used - + // Reload the monster data for the main maze that we're loading mapId = _vm->_party->_mazeId; Common::String filename = Common::String::format("maze%c%03d.mob", @@ -1062,7 +1062,7 @@ void Map::load(int mapId) { filename = "085.obj"; _mobData._objectSprites[0]._spriteId = 85; } else { - filename = Common::String::format("%03d.%cbj", + filename = Common::String::format("%03d.%cbj", _mobData._objectSprites[i]._spriteId, _mobData._objectSprites[i]._spriteId >= 100 ? '0' : 'o'); } @@ -1074,7 +1074,7 @@ void Map::load(int mapId) { // Load sprites for the monsters for (uint i = 0; i < _mobData._monsterSprites.size(); ++i) { - ArchiveType archiveType = + ArchiveType archiveType = _mobData._monsterSprites[i]._spriteId == 91 && _vm->getGameID() == GType_WorldOfXeen ? ALTSIDE_ARCHIVE : GAME_ARCHIVE; @@ -1101,7 +1101,7 @@ void Map::load(int mapId) { outdoorList._sky1._sprites = &_skySprites[0]; outdoorList._sky2._sprites = &_skySprites[0]; outdoorList._groundSprite._sprites = &_groundSprites; - + for (int i = 0; i < TOTAL_SURFACES; ++i) { _wallSprites._surfaces[i].clear(); @@ -1195,7 +1195,7 @@ void Map::load(int mapId) { indoorList._fwl_1F._sprites = &_wallSprites._fwl1; indoorList._fwl_1F1R._sprites = &_wallSprites._fwl1; - indoorList._fwl_1F1L._sprites = &_wallSprites._fwl1; + indoorList._fwl_1F1L._sprites = &_wallSprites._fwl1; indoorList._horizon._sprites = &_wallSprites._fwl1; indoorList._ground._sprites = &_groundSprites; @@ -1384,7 +1384,7 @@ void Map::setCellSurfaceFlags(const Common::Point &pt, int bits) { void Map::setWall(const Common::Point &pt, Direction dir, int v) { const int XOR_MASKS[4] = { 0xFFF, 0xF0FF, 0xFF0F, 0xFFF0 }; mazeLookup(pt, 0, 0); - + Common::Point mapPos(pt.x & 15, pt.y & 15); MazeWallLayers &wallLayer = _mazeData[_mazeDataIndex]._wallData[mapPos.y][mapPos.x]; wallLayer._data &= XOR_MASKS[dir]; @@ -1412,7 +1412,7 @@ int Map::getCell(int idx) { } _currentWall = INVALID_CELL; return INVALID_CELL; - } + } _mazeDataIndex = 0; while (_mazeData[_mazeDataIndex]._mazeId != mapId) @@ -1447,7 +1447,7 @@ int Map::getCell(int idx) { _currentWall = INVALID_CELL; return INVALID_CELL; } - + _mazeDataIndex = 0; while (_mazeData[_mazeDataIndex]._mazeId != mapId) ++_mazeDataIndex; @@ -1503,7 +1503,7 @@ int Map::getCell(int idx) { _currentTile = 0; } } else { - if (!mapId) + if (!mapId) return 0; if (pt.x > 31 || pt.y > 31) @@ -1523,7 +1523,7 @@ void Map::loadSky() { party._isNight = party._minutes < (5 * 60) || party._minutes >= (21 * 60); _skySprites[0].load(((party._mazeId >= 89 && party._mazeId <= 112) || - party._mazeId == 128 || party._mazeId == 129) || !party._isNight + party._mazeId == 128 || party._mazeId == 129) || !party._isNight ? "sky.sky" : "night.sky"); } diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 2c02e6ed2f..d0b63ec146 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -138,7 +138,7 @@ public: enum MazeFlags { OUTFLAG_GRATE = 0x80, OUTFLAG_DRAIN = 0x20, OUTFLAG_OBJECT_EXISTS = 0x08, INFLAG_INSIDE = 0x08, FLAG_AUTOEXECUTE_EVENT = 0x10, - RESTRICTION_ETHERIALIZE = 0x40, RESTRICTION_80 = 0x80, + RESTRICTION_ETHERIALIZE = 0x40, RESTRICTION_80 = 0x80, RESTRICTION_TOWN_PORTAL = 0x100, RESTRICTION_SUPER_SHELTER = 0x200, RESTRICTION_TIME_DISTORTION = 0x400, RESTRICTION_LLOYDS_BEACON = 0x800, RESTRICTION_TELPORT = 0x1000, RESTRICTION_2000 = 0x2000, @@ -150,7 +150,7 @@ enum MazeFlags { enum MazeFlags2 { FLAG_IS_OUTDOORS = 0x8000, FLAG_IS_DARK = 0x4000 }; enum SurfaceType { - SURFTYPE_DEFAULT = 0, + SURFTYPE_DEFAULT = 0, SURFTYPE_WATER = 0, SURFTYPE_DIRT = 1, SURFTYPE_GRASS = 2, SURFTYPE_SNOW = 3, SURFTYPE_SWAMP = 4, SURFTYPE_LAVA = 5, SURFTYPE_DESERT = 6, SURFTYPE_ROAD = 7, SURFTYPE_DWATER = 8, diff --git a/engines/xeen/music.h b/engines/xeen/music.h index bf77398885..207ec991a3 100644 --- a/engines/xeen/music.h +++ b/engines/xeen/music.h @@ -361,7 +361,7 @@ public: * Plays a song */ void playSong(const Common::String &name, int param = 0); - + /** * Plays a song */ diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 292ac01d2c..abf2c5cfed 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -364,7 +364,7 @@ void Party::changeTime(int numMinutes) { if (player._conditions[PARALYZED] && _vm->getRandomNumber(4) == 1) player._conditions[PARALYZED]--; } - + if (killed) _vm->_interface->drawParty(true); @@ -375,7 +375,7 @@ void Party::changeTime(int numMinutes) { void Party::addTime(int numMinutes) { int day = _day; _minutes += numMinutes; - + // If the total minutes has exceeded a day, move to next one while (_minutes >= (24 * 60)) { _minutes -= 24 * 60; @@ -464,7 +464,7 @@ void Party::handleLight() { } } - _vm->_interface->_intrIndex1 = _lightCount || + _vm->_interface->_intrIndex1 = _lightCount || (map.mazeData()._mazeFlags2 & FLAG_IS_DARK) == 0 ? 4 : 0; } @@ -599,7 +599,7 @@ void Party::giveTreasure() { // Important item, so clear a slot for it _activeParty[0]._weapons[INV_ITEMS_TOTAL - 1].clear(); } else { - // Otherwise, clear all the remaining treasure items, + // Otherwise, clear all the remaining treasure items, // since all the party's packs are full for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { _treasure._weapons[idx].clear(); @@ -657,7 +657,7 @@ void Party::giveTreasure() { while (!events.isKeyMousePressed() && events.timeElapsed() < 1) events.pollEventsAndWait(); } while (!_vm->shouldQuit() && events.timeElapsed() == 1); - + if (_vm->_mode != MODE_COMBAT) _vm->_mode = MODE_1; @@ -666,7 +666,7 @@ void Party::giveTreasure() { _gems += _treasure._gems; _treasure._gold = 0; _treasure._gems = 0; - + _treasure._hasItems = false; for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { _treasure._weapons[idx].clear(); @@ -698,7 +698,7 @@ void Party::giveTreasureToCharacter(Character &c, ItemCategory category, int ite Window &w = screen._windows[10]; XeenItem &treasureItem = _treasure._categories[category][itemIndex]; sound.playFX(20); - + if (treasureItem._id < 82) { // Copy item into the character's inventory c._items[category][INV_ITEMS_TOTAL - 1] = treasureItem; diff --git a/engines/xeen/party.h b/engines/xeen/party.h index d753b75801..3febf5bfe1 100644 --- a/engines/xeen/party.h +++ b/engines/xeen/party.h @@ -34,7 +34,7 @@ namespace Xeen { -enum Direction { +enum Direction { DIR_NORTH = 0, DIR_EAST = 1, DIR_SOUTH = 2, DIR_WEST = 3, DIR_ALL = 4 }; diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp index b2d8c6d495..4f576835f6 100644 --- a/engines/xeen/resources.cpp +++ b/engines/xeen/resources.cpp @@ -87,7 +87,7 @@ const char *const Resources::CREDITS = "\t190Clayton Retzer\n" "\t190David Vela\003""c"; -const char *const Resources::OPTIONS_TITLE = +const char *const Resources::OPTIONS_TITLE = "\x0D\x01\003""c\014""dMight and Magic Options\n" "World of Xeen\x02\n" "\v117Copyright (c) 1993 NWC, Inc.\n" @@ -316,13 +316,13 @@ const char *const Resources::SEX_NAMES[2] = { "Male", "Female" }; const char *const Resources::SKILL_NAMES[18] = { "Thievery", "Arms Master", "Astrologer", "Body Builder", "Cartographer", - "Crusader", "Direction Sense", "Linguist", "Merchant", "Mountaineer", + "Crusader", "Direction Sense", "Linguist", "Merchant", "Mountaineer", "Navigator", "Path Finder", "Prayer Master", "Prestidigitator", "Swimmer", "Tracker", "Spot Secret Door", "Danger Sense" }; const char *const Resources::CLASS_NAMES[11] = { - "Knight", "Paladin", "Archer", "Cleric", "Sorcerer", "Robber", + "Knight", "Paladin", "Archer", "Cleric", "Sorcerer", "Robber", "Ninja", "Barbarian", "Druid", "Ranger", nullptr }; @@ -331,8 +331,8 @@ const uint Resources::CLASS_EXP_LEVELS[10] = { }; const char *const Resources::CONDITION_NAMES[17] = { - "Cursed", "Heart Broken", "Weak", "Poisoned", "Diseased", - "Insane", "In Love", "Drunk", "Asleep", "Depressed", "Confused", + "Cursed", "Heart Broken", "Weak", "Poisoned", "Diseased", + "Insane", "In Love", "Drunk", "Asleep", "Depressed", "Confused", "Paralyzed", "Unconscious", "Dead", "Stone", "Eradicated", "Good" }; @@ -353,28 +353,28 @@ const char *const Resources::HEROISM = "\n\t020Heroism\t095%+d"; const char *const Resources::IN_PARTY = "\014""15In Party\014""d"; const char *const Resources::PARTY_DETAILS = "\015\003l\002\014""00" - "\013""001""\011""035%s" - "\013""009""\011""035%s" - "\013""017""\011""035%s" - "\013""025""\011""035%s" - "\013""001""\011""136%s" - "\013""009""\011""136%s" - "\013""017""\011""136%s" - "\013""025""\011""136%s" - "\013""044""\011""035%s" - "\013""052""\011""035%s" - "\013""060""\011""035%s" - "\013""068""\011""035%s" - "\013""044""\011""136%s" - "\013""052""\011""136%s" - "\013""060""\011""136%s" + "\013""001""\011""035%s" + "\013""009""\011""035%s" + "\013""017""\011""035%s" + "\013""025""\011""035%s" + "\013""001""\011""136%s" + "\013""009""\011""136%s" + "\013""017""\011""136%s" + "\013""025""\011""136%s" + "\013""044""\011""035%s" + "\013""052""\011""035%s" + "\013""060""\011""035%s" + "\013""068""\011""035%s" + "\013""044""\011""136%s" + "\013""052""\011""136%s" + "\013""060""\011""136%s" "\013""068""\011""136%s"; const char *const Resources::PARTY_DIALOG_TEXT = "%s\x2\x3""c\v106\t013Up\t048Down\t083\f37D\fdel\t118\f37R\fdem" "\t153\f37C\fdreate\t188E\f37x\fdit\x1"; -const int Resources::FACE_CONDITION_FRAMES[17] = { - 2, 2, 2, 1, 1, 4, 4, 4, 3, 2, 4, 3, 3, 5, 6, 7, 0 +const int Resources::FACE_CONDITION_FRAMES[17] = { + 2, 2, 2, 1, 1, 4, 4, 4, 3, 2, 4, 3, 3, 5, 6, 7, 0 }; const int Resources::CHAR_FACES_X[6] = { 10, 45, 81, 117, 153, 189 }; @@ -386,7 +386,7 @@ const char *const Resources::NO_ONE_TO_ADVENTURE_WITH = "You have no one to adve const char *const Resources::YOUR_ROSTER_IS_FULL = "Your Roster is full!"; const byte Resources::BACKGROUND_XLAT[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xFF, 0x07, 0x00, 0x00, 0x00, @@ -409,7 +409,7 @@ const int8 Resources::SCREEN_POSITIONING_X[4][48] = { { -1, 0, 0, 0, 1, -1, 0, 0, 0, 1, -2, -1, -1, 0, 0, 0, 1, 1, 2, -4, -3, -3, -2, -2, - -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, + -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, -3, -2, -1, 0, 0, 1, 2, 3, -4, 4, 0, 0 }, { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, @@ -422,7 +422,7 @@ const int8 Resources::SCREEN_POSITIONING_X[4][48] = { 1, 1, 0, 0, 0, -1, -1, -2, -2, -3, -3, -4, 3, 2, 1, 0, 0, -1, -2, -3, 4, -4, 0, 0 }, { - 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -2, -2, + 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 0, -1 @@ -513,9 +513,9 @@ const byte Resources::WALL_SHIFTS[4][48] = { }; const int Resources::DRAW_NUMBERS[25] = { - 36, 37, 38, 43, 42, 41, - 39, 20, 22, 24, 33, 31, - 29, 26, 10, 11, 18, 16, + 36, 37, 38, 43, 42, 41, + 39, 20, 22, 24, 33, 31, + 29, 26, 10, 11, 18, 16, 13, 5, 9, 6, 0, 4, 1 }; @@ -578,8 +578,8 @@ const int Resources::AGE_RANGES_ADJUST[2][10] = { }; const uint Resources::STAT_VALUES[24] = { - 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 25, 30, 35, 40, - 50, 75, 100, 125, 150, 175, 200, 225, 250, + 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 25, 30, 35, 40, + 50, 75, 100, 125, 150, 175, 200, 225, 250, }; const int Resources::STAT_BONUSES[24] = { @@ -777,7 +777,7 @@ const char *const Resources::TEMPLE_TEXT = "\x03l\x09""000\x0B""090Gold\x03r\x09""000%s" "\x02\x03""c\x0B""122\x09""040ESC\x01"; -const char *const Resources::EXPERIENCE_FOR_LEVEL = +const char *const Resources::EXPERIENCE_FOR_LEVEL = "%s needs %lu experience for level %u."; const char *const Resources::LEARNED_ALL = "%s has learned all we can teach!"; @@ -832,7 +832,7 @@ const char *const Resources::BUY_SPELLS = "\x09""012\x0C""37B\x0C""duy Spells\n" "\x09""012\x0C""37S\x0C""dpell Info"; -const char *const Resources::GUILD_OPTIONS = +const char *const Resources::GUILD_OPTIONS = "\x0D\x0C""00\x03""c\x0B""000\x09""000Guild Options for%s" "\x03l\x09""000\x0B""090Gold" "\x03r\x09""000%s\x02\x03""c\x0B""122\x09""040ESC\x01"; @@ -870,8 +870,8 @@ const int Resources::SPELL_COSTS[77] = { }; const int Resources::DARK_SPELL_RANGES[12][2] = { - { 0, 20 }, { 16, 35 }, { 27, 37 }, { 29, 39 }, - { 0, 17 }, { 14, 34 }, { 26, 37 }, { 29, 39 }, + { 0, 20 }, { 16, 35 }, { 27, 37 }, { 29, 39 }, + { 0, 17 }, { 14, 34 }, { 26, 37 }, { 29, 39 }, { 0, 20 }, { 16, 35 }, { 27, 37 }, { 29, 39 } }; @@ -948,7 +948,7 @@ const char *const Resources::SPELLS_PRESS_A_KEY = const char *const Resources::SPELLS_PURCHASE = "\x3l\xB""000\x9""000\xC""d%s Do you wish to purchase " - "\xC""09%s\xC""d for %u?"; + "\xC""09%s\xC""d for %u?"; const char *const Resources::MAP_TEXT = "\x3""c\xB""000\x9""000%s\x3l\xB""139" @@ -970,7 +970,7 @@ const char *const Resources::LEVITATE_TEXT = "%c%sLevitate%s"; const char *const Resources::WALK_ON_WATER_TEXT = "%c%sWalk on Water"; -const char *const Resources::GAME_INFORMATION = +const char *const Resources::GAME_INFORMATION = "\xD\x3""c\x9""000\xB""001\xC""37%s of Xeen\xC""d\n" "Game Information\n" "\n" @@ -1043,7 +1043,7 @@ const char *const Resources::LEVEL_TEXT = "\x3r\x9""054%u\x3l\x9""058/ %u\n" "\x3""c%u Attack%s/Round\x1"; -const char *const Resources::RESISTENCES_TEXT = +const char *const Resources::RESISTENCES_TEXT = "\x2\x3""c%s\x3l\n" "\x9""020Fire\x9""100%u\n" "\x9""020Cold\x9""100%u\n" @@ -1072,7 +1072,7 @@ const char *const Resources::FOOD_TEXT = const char *const Resources::EXCHANGE_WITH_WHOM = "\t010\v005Exchange with whom?"; -const char *const Resources::QUICK_REF_LINE = +const char *const Resources::QUICK_REF_LINE = "\xB%3d\x9""007%u)\x9""027%s\x9""110%c%c%c\x3r\x9""160\xC%02u%u\xC""d" "\x3l\x9""170\xC%02u%d\xC""d\x9""208\xC%02u%u\xC""d\x9""247\xC" "%02u%u\xC""d\x9""270\xC%02u%c%c%c%c\xC""d"; @@ -1118,11 +1118,11 @@ const char *const Resources::BONUS_NAMES[7] = { }; const char *const Resources::WEAPON_NAMES[35] = { - nullptr, "long sword ", "short sword ", "broad sword ", "scimitar ", - "cutlass ", "sabre ", "club ", "hand axe ", "katana ", "nunchakas ", - "wakazashi ", "dagger ", "mace ", "flail ", "cudgel ", "maul ", "spear ", + nullptr, "long sword ", "short sword ", "broad sword ", "scimitar ", + "cutlass ", "sabre ", "club ", "hand axe ", "katana ", "nunchakas ", + "wakazashi ", "dagger ", "mace ", "flail ", "cudgel ", "maul ", "spear ", "bardiche ", "glaive ", "halberd ", "pike ", "flamberge ", "trident ", - "staff ", "hammer ", "naginata ", "battle axe ", "grand axe ", "great axe ", + "staff ", "hammer ", "naginata ", "battle axe ", "grand axe ", "great axe ", "short bow ", "long bow ", "crossbow ", "sling ", "Xeen Slayer Sword" }; @@ -1139,8 +1139,8 @@ const char *const Resources::ACCESSORY_NAMES[11] = { const char *const Resources::MISC_NAMES[22] = { nullptr, "rod ", "jewel ", "gem ", "box ", "orb ", "horn ", "coin ", - "wand ", "whistle ", "potion ", "scroll ", "RogueVM", - "bogusg", "bogus", "bogus", "bogus", "bogus", + "wand ", "whistle ", "potion ", "scroll ", "RogueVM", + "bogusg", "bogus", "bogus", "bogus", "bogus", "bogus", "bogus", "bogus", "bogus" }; @@ -1283,10 +1283,10 @@ const int Resources::ITEM_SKILL_DIVISORS[4] = { 1, 2, 100, 10 }; const int Resources::RESTRICTION_OFFSETS[4] = { 0, 35, 49, 60 }; const int Resources::ITEM_RESTRICTIONS[86] = { - 0, 86, 86, 86, 86, 86, 86, 0, 6, 239, 239, 239, 2, 4, 4, 4, 4, - 6, 70, 70, 70, 70, 94, 70, 0, 4, 239, 86, 86, 86, 70, 70, 70, 70, - 0, 0, 0, 68, 100, 116, 125, 255, 255, 85, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 86, 86, 86, 86, 86, 86, 0, 6, 239, 239, 239, 2, 4, 4, 4, 4, + 6, 70, 70, 70, 70, 94, 70, 0, 4, 239, 86, 86, 86, 70, 70, 70, 70, + 0, 0, 0, 68, 100, 116, 125, 255, 255, 85, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -1326,7 +1326,7 @@ const char *const Resources::WHICH_ITEM = "\t010\v005%s which item?"; const char *const Resources::WHATS_YOUR_HURRY = "\v007What's your hurry?\n" "Wait till you get out of here!"; -const char *const Resources::USE_ITEM_IN_COMBAT = +const char *const Resources::USE_ITEM_IN_COMBAT = "\v007To use an item in Combat, invoke the Use command on your turn!"; const char *const Resources::NO_SPECIAL_ABILITIES = "\v005\x3""c%s\fdhas no special abilities!"; @@ -1422,7 +1422,7 @@ const char *const Resources::QUEST_ITEMS_DATA = "\f04 * \fd%s\n" "\f04 * \fd%s\n" "\f04 * \fd%s"; -const char *const Resources::CURRENT_QUESTS_DATA = +const char *const Resources::CURRENT_QUESTS_DATA = "\r\x1\fd\x3""c\t000\v000Current Quests\x3l\x2\n" "%s\n" "\n" @@ -1441,7 +1441,7 @@ const char *const Resources::AUTO_NOTES_DATA = "%s\x3l\n" "%s\x3l"; -const char *const Resources::REST_COMPLETE = +const char *const Resources::REST_COMPLETE = "\v000\t0008 hours pass. Rest complete.\n" "%s\n" "%d food consumed."; @@ -1460,10 +1460,10 @@ const char *const Resources::YOUR_PARTY_IS_FULL = "\v007Your party is full!"; const char *const Resources::HAS_SLAYER_SWORD = "\v000\t000This character has the Xeen Slayer Sword and cannot be deleted!"; -const char *const Resources::SURE_TO_DELETE_CHAR = +const char *const Resources::SURE_TO_DELETE_CHAR = "Are you sure you want to delete %s the %s?"; -const char *const Resources::CREATE_CHAR_DETAILS = +const char *const Resources::CREATE_CHAR_DETAILS = "\f04\x3""c\x2\t144\v119\f37R\f04oll\t144\v149\f37C\f04reate" "\t144\v179\f37ESC\f04\x3l\x1\t195\v021\f37M\f04gt" "\t195\v045\f37I\f04nt\t195\v069\f37P\f04er\t195\v093\f37E\f04nd" @@ -1514,7 +1514,7 @@ const char *const Resources::COMBAT_DETAILS = "\r\f00\x3""c\v000\t000\x2""Combat const char *Resources::NOT_ENOUGH_TO_CAST = "\x3""c\v010Not enough %s to Cast %s"; const char *Resources::SPELL_CAST_COMPONENTS[2] = { "Spell Points", "Gems" }; -const char *const Resources::CAST_SPELL_DETAILS = +const char *const Resources::CAST_SPELL_DETAILS = "\r\x2\x3""c\v122\t013\f37C\fdast\t040\f37N\fdew" "\t067ESC\x1\t000\v000\x3""cCast Spell\n" "\n" @@ -1586,7 +1586,7 @@ const int Resources::TOWN_MAP_NUMBERS[2][5] = { { 28, 29, 30, 31, 32 }, { 29, 31, 33, 35, 37 } }; -const char *const Resources::MONSTER_DETAILS = +const char *const Resources::MONSTER_DETAILS = "\x3l\n" "%s\x3""c\t100%s\t140%u\t180%u\x3r\t000%s"; diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp index 9fd2d19a9b..4df4b3727c 100644 --- a/engines/xeen/saves.cpp +++ b/engines/xeen/saves.cpp @@ -45,7 +45,7 @@ void OutFile::finalize() { /*------------------------------------------------------------------------*/ -SavesManager::SavesManager(XeenEngine *vm, Party &party) : +SavesManager::SavesManager(XeenEngine *vm, Party &party) : BaseCCArchive(), _vm(vm), _party(party) { SearchMan.add("saves", this, 0, false); _data = nullptr; @@ -82,7 +82,7 @@ void SavesManager::syncBitFlags(Common::Serializer &s, bool *startP, bool *endP) Common::SeekableReadStream *SavesManager::createReadStreamForMember(const Common::String &name) const { CCEntry ccEntry; - // If the given resource has already been perviously "written" to the + // If the given resource has already been perviously "written" to the // save manager, then return that new resource uint16 id = BaseCCArchive::convertNameToId(name); if (_newData.contains(id)) { diff --git a/engines/xeen/screen.cpp b/engines/xeen/screen.cpp index 32a08b24e5..85c4df5590 100644 --- a/engines/xeen/screen.cpp +++ b/engines/xeen/screen.cpp @@ -47,9 +47,9 @@ Window::Window(const Window &src) : XSurface(), _enabled(src._enabled), create(*_vm->_screen, Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); } -Window::Window(const Common::Rect &bounds, int a, int border, +Window::Window(const Common::Rect &bounds, int a, int border, int xLo, int ycL, int xHi, int ycH): XSurface(), - _enabled(false), _a(a), _border(border), + _enabled(false), _a(a), _border(border), _xLo(xLo), _ycL(ycL), _xHi(xHi), _ycH(ycH) { setBounds(bounds); create(*_vm->_screen, Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); @@ -196,7 +196,7 @@ void Window::drawList(DrawStruct *items, int count) { for (int i = 0; i < count; ++i, ++items) { if (items->_frame == -1 || items->_scale == -1 || items->_sprites == nullptr) continue; - + Common::Point pt(items->_x, items->_y); pt.x += _innerBounds.left; pt.y += _innerBounds.top; @@ -296,7 +296,7 @@ void Screen::update() { } void Screen::addDirtyRect(const Common::Rect &r) { - assert(r.isValidRect() && r.width() > 0 && r.height() > 0 + assert(r.isValidRect() && r.width() > 0 && r.height() > 0 && r.left >= 0 && r.top >= 0 && r.right <= SCREEN_WIDTH && r.bottom <= SCREEN_HEIGHT); _dirtyRects.push_back(r); diff --git a/engines/xeen/screen.h b/engines/xeen/screen.h index 8df15b22d6..338a231ce6 100644 --- a/engines/xeen/screen.h +++ b/engines/xeen/screen.h @@ -96,7 +96,7 @@ public: void frame(); /** - * Fill the content area of a window with the current background color + * Fill the content area of a window with the current background color */ void fill(); diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 1393c6eccf..4e0363120c 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -126,7 +126,7 @@ int Scripts::checkEvents() { Mode oldMode = _vm->_mode; Common::fill(&intf._charFX[0], &intf._charFX[MAX_ACTIVE_PARTY], 0); //int items = _treasureItems; - + if (party._treasure._gold & party._treasure._gems) { // Backup any current treasure data party._savedTreasure = party._treasure; @@ -162,7 +162,7 @@ int Scripts::checkEvents() { for (eventIndex = 0; eventIndex < map._events.size(); ++eventIndex) { MazeEvent &event = map._events[eventIndex]; - if (event._position == _currentPos && party._mazeDirection != + if (event._position == _currentPos && party._mazeDirection != (_currentPos.x | _currentPos.y) && event._line == _lineNum) { if (event._direction == party._mazeDirection || event._direction == DIR_ALL) { _vm->_mode = MODE_9; @@ -366,7 +366,7 @@ void Scripts::cmdDoorTextSml(Common::Array<byte> ¶ms) { Interface &intf = *_vm->_interface; Common::String paramText = _vm->_map->_events._text[_event->_parameters[0]]; - intf._screenText = Common::String::format("\x02\f""08\x03""c\t116\v025%s\x03""l\fd""\x01", + intf._screenText = Common::String::format("\x02\f""08\x03""c\t116\v025%s\x03""l\fd""\x01", paramText.c_str()); intf._upDoorText = true; intf.draw3d(true); @@ -523,7 +523,7 @@ void Scripts::cmdIf(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdMoveObj(Common::Array<byte> ¶ms) { +void Scripts::cmdMoveObj(Common::Array<byte> ¶ms) { MazeObject &mazeObj = _vm->_map->_mobData._objects[params[0]]; if (mazeObj._position.x == params[1] && mazeObj._position.y == params[2]) { @@ -662,7 +662,7 @@ void Scripts::cmdTakeOrGive(Common::Array<byte> ¶ms) { for (uint idx = 0; idx < party._activeParty.size(); ++idx) { if (_charIndex == 0 || (_charIndex == 8 && (int)idx != _v2)) { party.giveTake(mode1, mask1, mode1, mask2, idx); - + switch (mode1) { case 8: mode1 = 0; @@ -684,7 +684,7 @@ void Scripts::cmdTakeOrGive(Common::Array<byte> ¶ms) { case 106: if (param2) continue; - + // Break out of character loop idx = party._activeParty.size(); break; @@ -748,7 +748,7 @@ void Scripts::cmdNoAction(Common::Array<byte> ¶ms) { _lineNum = _vm->_party->_partyDead ? -1 : _lineNum + 1; } -void Scripts::cmdRemove(Common::Array<byte> ¶ms) { +void Scripts::cmdRemove(Common::Array<byte> ¶ms) { Interface &intf = *_vm->_interface; Map &map = *_vm->_map; @@ -761,7 +761,7 @@ void Scripts::cmdRemove(Common::Array<byte> ¶ms) { cmdMakeNothingHere(params); } -void Scripts::cmdSetChar(Common::Array<byte> ¶ms) { +void Scripts::cmdSetChar(Common::Array<byte> ¶ms) { if (params[0] != 7) { _charIndex = WhoWill::show(_vm, 22, 3, false); if (_charIndex == 0) { @@ -802,11 +802,11 @@ void Scripts::cmdDoTownEvent(Common::Array<byte> ¶ms) { cmdExit(params); } -void Scripts::cmdExit(Common::Array<byte> ¶ms) { +void Scripts::cmdExit(Common::Array<byte> ¶ms) { _lineNum = -1; } -void Scripts::cmdAlterMap(Common::Array<byte> ¶ms) { +void Scripts::cmdAlterMap(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; if (params[2] == DIR_ALL) { @@ -819,7 +819,7 @@ void Scripts::cmdAlterMap(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdGiveExtended(Common::Array<byte> ¶ms) { +void Scripts::cmdGiveExtended(Common::Array<byte> ¶ms) { Party &party = *_vm->_party; uint32 mask; int newLineNum; @@ -862,7 +862,7 @@ void Scripts::cmdGiveExtended(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdConfirmWord(Common::Array<byte> ¶ms) { +void Scripts::cmdConfirmWord(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; Party &party = *_vm->_party; Common::String msg1 = params[2] ? map._events._text[params[2]] : @@ -893,7 +893,7 @@ void Scripts::cmdConfirmWord(Common::Array<byte> ¶ms) { } else if (result == 61 && !_vm->_files->_isDarkCc) { doWorldEnd(); - } else { + } else { if (result == 59 && !_vm->_files->_isDarkCc) { for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) { XeenItem &item = party._treasure._weapons[idx]; @@ -902,7 +902,7 @@ void Scripts::cmdConfirmWord(Common::Array<byte> ¶ms) { item._material = 0; item._bonusFlags = 0; party._treasure._hasItems = true; - + cmdExit(params); return; } @@ -910,7 +910,7 @@ void Scripts::cmdConfirmWord(Common::Array<byte> ¶ms) { } _lineNum = result == -1 ? params[3] : params[1]; - + return; } } @@ -957,7 +957,7 @@ void Scripts::cmdAlterEvent(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdCallEvent(Common::Array<byte> ¶ms) { +void Scripts::cmdCallEvent(Common::Array<byte> ¶ms) { _stack.push(StackEntry(_currentPos, _lineNum)); _currentPos = Common::Point(params[0], params[1]); _lineNum = params[2] - 1; @@ -973,7 +973,7 @@ void Scripts::cmdReturn(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdSetVar(Common::Array<byte> ¶ms) { +void Scripts::cmdSetVar(Common::Array<byte> ¶ms) { Party &party = *_vm->_party; uint val; _refreshIcons = true; @@ -1011,7 +1011,7 @@ void Scripts::cmdSetVar(Common::Array<byte> ¶ms) { void Scripts::cmdCutsceneEndClouds(Common::Array<byte> ¶ms) { error("TODO"); } -void Scripts::cmdWhoWill(Common::Array<byte> ¶ms) { +void Scripts::cmdWhoWill(Common::Array<byte> ¶ms) { _charIndex = WhoWill::show(_vm, params[0], params[1], true); if (_charIndex == 0) @@ -1020,7 +1020,7 @@ void Scripts::cmdWhoWill(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdRndDamage(Common::Array<byte> ¶ms) { +void Scripts::cmdRndDamage(Common::Array<byte> ¶ms) { Combat &combat = *_vm->_combat; Interface &intf = *_vm->_interface; @@ -1049,7 +1049,7 @@ void Scripts::cmdAlterCellFlag(Common::Array<byte> ¶ms) { MazeWallLayers &wallData = map.mazeDataCurrent()._wallData[pt.y][pt.x]; wallData._data = (wallData._data & 0xFFF0) | params[2]; } else { - pt.x &= 0xF; + pt.x &= 0xF; pt.y &= 0xF; MazeCell &cell = map.mazeDataCurrent()._cells[pt.y][pt.x]; cell._surfaceId = params[2]; @@ -1082,7 +1082,7 @@ void Scripts::cmdDisplayStat(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdSeatTextSml(Common::Array<byte> ¶ms) { +void Scripts::cmdSeatTextSml(Common::Array<byte> ¶ms) { Interface &intf = *_vm->_interface; intf._screenText = Common::String::format("\x2\f08\x3""c\t116\v090%s\x3l\fd\x1", @@ -1270,12 +1270,12 @@ void Scripts::cmdFallToMap(Common::Array<byte> ¶ms) { _lineNum = -1; } -void Scripts::cmdDisplayMain(Common::Array<byte> ¶ms) { +void Scripts::cmdDisplayMain(Common::Array<byte> ¶ms) { display(false, 0); cmdNoAction(params); } -void Scripts::cmdGoto(Common::Array<byte> ¶ms) { +void Scripts::cmdGoto(Common::Array<byte> ¶ms) { Map &map = *_vm->_map; map.getCell(1); if (params[0] == map._currentSurfaceId) @@ -1284,12 +1284,12 @@ void Scripts::cmdGoto(Common::Array<byte> ¶ms) { cmdNoAction(params); } -void Scripts::cmdGotoRandom(Common::Array<byte> ¶ms) { +void Scripts::cmdGotoRandom(Common::Array<byte> ¶ms) { _lineNum = params[_vm->getRandomNumber(1, params[0])] - 1; cmdNoAction(params); } -void Scripts::cmdCutsceneEndDarkside(Common::Array<byte> ¶ms) { +void Scripts::cmdCutsceneEndDarkside(Common::Array<byte> ¶ms) { Party &party = *_vm->_party; _vm->_saves->_wonDarkSide = true; party._questItems[53] = 1; @@ -1301,13 +1301,13 @@ void Scripts::cmdCutsceneEndDarkside(Common::Array<byte> ¶ms) { doEndGame2(); } -void Scripts::cmdCutsceneEdWorld(Common::Array<byte> ¶ms) { +void Scripts::cmdCutsceneEdWorld(Common::Array<byte> ¶ms) { _vm->_saves->_wonWorld = true; _vm->_party->_worldEnd = true; doWorldEnd(); } -void Scripts::cmdFlipWorld(Common::Array<byte> ¶ms) { +void Scripts::cmdFlipWorld(Common::Array<byte> ¶ms) { _vm->_map->_loadDarkSide = params[0] != 0; } @@ -1342,7 +1342,7 @@ void Scripts::doWorldEnd() { void Scripts::doEnding(const Common::String &endStr, int v2) { _vm->_saves->saveChars(); - + warning("TODO: doEnding"); } diff --git a/engines/xeen/scripts.h b/engines/xeen/scripts.h index f41be1b7c6..98f93e7e75 100644 --- a/engines/xeen/scripts.h +++ b/engines/xeen/scripts.h @@ -132,7 +132,7 @@ struct MirrorEntry { int _direction; MirrorEntry() : _mapId(0), _direction(DIR_ALL) {} - + bool synchronize(Common::SeekableReadStream &s); }; @@ -174,7 +174,7 @@ private: * Displays a door text message using the large font */ void cmdDoorTextLrg(Common::Array<byte> ¶ms); - + /** * Show a sign text on-screen */ diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp index 23fb947aef..b3471df96c 100644 --- a/engines/xeen/spells.cpp +++ b/engines/xeen/spells.cpp @@ -81,7 +81,7 @@ void Spells::executeSpell(MagicSpell spellId) { &Spells::starBurst, &Spells::stoneToFlesh, &Spells::sunRay, &Spells::superShelter, &Spells::suppressDisease, &Spells::suppressPoison, &Spells::teleport, &Spells::timeDistortion, &Spells::townPortal, - &Spells::toxicCloud, &Spells::turnUndead, &Spells::walkOnWater, + &Spells::toxicCloud, &Spells::turnUndead, &Spells::walkOnWater, &Spells::wizardEye }; @@ -170,7 +170,7 @@ int Spells::castSpell(Character *c, MagicSpell spellId) { int oldTillMove = intf._tillMove; int result = 1; combat._oldCharacter = c; - + // Try and subtract the SP and gem requirements for the spell int resultError = subSpellCost(*c, spellId); if (resultError) { @@ -180,7 +180,7 @@ int Spells::castSpell(Character *c, MagicSpell spellId) { // Some spells have special handling switch (spellId) { case MS_EnchantItem: - case MS_Etheralize: + case MS_Etheralize: case MS_Jump: case MS_LloydsBeacon: case MS_SuperShelter: @@ -305,7 +305,7 @@ void Spells::coldRay() { combat.multiAttack(8); } -void Spells::createFood() { +void Spells::createFood() { Party &party = *_vm->_party; Sound &sound = *_vm->_sound; @@ -451,7 +451,7 @@ void Spells::detectMonster() { if (monster._position == pt) { if (++grid[yDiff][xDiff] > 3) grid[yDiff][xDiff] = 3; - + sprites.draw(w, grid[yDiff][xDiff], Common::Point(xDiff * 9 + 244, yDiff * 7 + 81)); } @@ -806,7 +806,7 @@ void Spells::levitate() { _vm->_sound->playFX(20); } -void Spells::light() { +void Spells::light() { Interface &intf = *_vm->_interface; Party &party = *_vm->_party; Sound &sound = *_vm->_sound; @@ -837,7 +837,7 @@ void Spells::lloydsBeacon() { } } -void Spells::magicArrow() { +void Spells::magicArrow() { Combat &combat = *_vm->_combat; combat._monsterDamage = 0; combat._damageType = DT_MAGIC_ARROW; @@ -966,7 +966,7 @@ void Spells::protectionFromElements() { Sound &sound = *_vm->_sound; Character &c = *combat._oldCharacter; int resist = MIN(c.getCurrentLevel() * 2 + 5, (uint)200); - + int elementType = SelectElement::show(_vm, MS_ProtFromElements); if (elementType != -1) { switch (elementType) { @@ -1040,7 +1040,7 @@ void Spells::resurrection() { sound.playFX(30); c->addHitPoints(0); c->_conditions[ERADICATED] = 0; - + if (--c->_endurance._permanent < 1) c->_endurance._permanent = 1; if ((c->_tempAge + 5) >= 250) @@ -1235,12 +1235,12 @@ void Spells::townPortal() { if (map.mazeData()._mazeFlags & RESTRICTION_TOWN_PORTAL) { spellFailed(); return; - } + } int townNumber = TownPortal::show(_vm); if (!townNumber) return; - + sound.playFX(51); map._loadDarkSide = map._sideTownPortal; _vm->_files->_isDarkCc = map._sideTownPortal > 0; @@ -1318,7 +1318,7 @@ void Spells::wizardEye() { void Spells::frostbite2() { Combat &combat = *_vm->_combat; Sound &sound = *_vm->_sound; - + combat._monsterDamage = 35; combat._damageType = DT_COLD; combat._rangeType = RT_SINGLE; diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index 7327317156..68382abc67 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -54,7 +54,7 @@ SpriteResource::~SpriteResource() { SpriteResource &SpriteResource::operator=(const SpriteResource &src) { delete[] _data; _index.clear(); - + _filesize = src._filesize; _data = new byte[_filesize]; Common::copy(src._data, src._data + _filesize, _data); @@ -100,9 +100,9 @@ void SpriteResource::clear() { _filesize = 0; } -void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, +void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, const Common::Rect &clipRect, int flags, int scale) { - static const uint SCALE_TABLE[] = { + static const uint SCALE_TABLE[] = { 0xFFFF, 0xFFEF, 0xEFEF, 0xEFEE, 0xEEEE, 0xEEAE, 0xAEAE, 0xAEAA, 0xAAAA, 0xAA8A, 0x8A8A, 0x8A88, 0x8888, 0x8880, 0x8080, 0x8000 }; @@ -126,9 +126,9 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi Common::Point destPos; destPos.x = pt.x + getScaledVal(xOffset, scaleMaskX); destPos.x += (width - getScaledVal(width, scaleMaskX)) / 2; - + destPos.y = pt.y + getScaledVal(yOffset, scaleMaskY); - + // If the flags allow the dest surface to be resized, ensure dest surface is big enough Common::Rect bounds = clipRect; if (flags & SPRFLAG_RESIZE) { @@ -136,7 +136,7 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi dest.create(xOffset + width, yOffset + height); bounds = Common::Rect(0, 0, dest.w, dest.h); } - + uint16 scaleMaskXCopy = scaleMaskX; Common::Rect drawBounds; drawBounds.left = SCREEN_WIDTH; @@ -156,10 +156,10 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi continue; } - // Roll the scale mask + // Roll the scale mask uint bit = (scaleMaskY >> 15) & 1; scaleMaskY = ((scaleMaskY & 0x7fff) << 1) + bit; - + if (!bit) { // Not a line to be drawn due to scaling down f.skip(lineLength); @@ -170,7 +170,7 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi } else { scaleMaskX = scaleMaskXCopy; xOffset = f.readByte(); - + // Initialize the array to hold the temporary data for the line. We do this to make it simpler // to handle both deciding which pixels to draw in a scaled image, as well as when images // have been horizontally flipped. Note that we allocate an extra line for before and after our @@ -308,7 +308,7 @@ void SpriteResource::draw(Window &dest, int frame, const Common::Point &destPos, draw(dest, frame, destPos, dest.getBounds(), flags, scale); } -void SpriteResource::draw(XSurface &dest, int frame, const Common::Point &destPos, +void SpriteResource::draw(XSurface &dest, int frame, const Common::Point &destPos, const Common::Rect &bounds, int flags, int scale) { drawOffset(dest, _index[frame]._offset1, destPos, bounds, flags, scale); @@ -330,7 +330,7 @@ uint SpriteResource::getScaledVal(int xy, uint16 &scaleMask) { scaleMask = ((scaleMask & 0x7fff) << 1) + bit; result += bit; } - + return result; } diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h index 17c745f26e..b61ec83cd6 100644 --- a/engines/xeen/sprites.h +++ b/engines/xeen/sprites.h @@ -66,7 +66,7 @@ private: /** * Draw a sprite frame based on a passed offset into the data stream */ - void drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, + void drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, const Common::Rect &clipRect, int flags, int scale); /** @@ -99,7 +99,7 @@ public: */ void clear(); - void draw(XSurface &dest, int frame, const Common::Point &destPos, + void draw(XSurface &dest, int frame, const Common::Point &destPos, int flags = 0, int scale = 0); void draw(Window &dest, int frame, const Common::Point &destPos, diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp index c0ecf5cf6f..13a631aa47 100644 --- a/engines/xeen/town.cpp +++ b/engines/xeen/town.cpp @@ -104,7 +104,7 @@ int Town::townAction(int actionId) { sound.stopSound(); vocName = isDarkCc ? "bank1.voc" : "banker.voc"; break; - + case 1: // Blacksmith _icons1.load("esc.icn"); @@ -215,7 +215,7 @@ int Town::townAction(int actionId) { Character *charP = &party._activeParty[0]; Common::String title = createTownText(*charP); intf._face1UIFrame = intf._face2UIFrame = 0; - intf._dangerSenseUIFrame = 0; + intf._dangerSenseUIFrame = 0; intf._spotDoorsUIFrame = 0; intf._levitateUIFrame = 0; @@ -525,7 +525,7 @@ Character *Town::doBankOptions(Character *c) { Character *Town::doBlacksmithOptions(Character *c) { Interface &intf = *_vm->_interface; Party &party = *_vm->_party; - + if (_buttonValue >= Common::KEYCODE_F1 && _buttonValue <= Common::KEYCODE_F6) { // Switch character _buttonValue -= Common::KEYCODE_F1; @@ -782,7 +782,7 @@ Character *Town::doTempleOptions(Character *c) { Interface &intf = *_vm->_interface; Party &party = *_vm->_party; Sound &sound = *_vm->_sound; - + switch (_buttonValue) { case Common::KEYCODE_F1: case Common::KEYCODE_F2: @@ -808,7 +808,7 @@ Character *Town::doTempleOptions(Character *c) { if (_dayOfWeek == (party._day / 10)) { party._clairvoyanceActive = true; party._lightCount = 1; - + int amt = _dayOfWeek ? _dayOfWeek : 10; party._heroism = amt; party._holyBonus = amt; @@ -916,7 +916,7 @@ Character *Town::doTrainingOptions(Character *c) { sound.stopSound(); sound.playSound(isDarkCc ? "prtygd.voc" : "trainin2.voc", 1); - c->_experience -= c->nextExperienceLevel() - + c->_experience -= c->nextExperienceLevel() - (c->getCurrentExperience() - c->_experience); c->_level._permanent++; @@ -987,7 +987,7 @@ void Town::depositWithdrawl(int choice) { default: continue; } - + if ((choice && !party._bankGems && flag) || (choice && !party._bankGold && !flag) || (!choice && !party._gems && flag) || @@ -1261,7 +1261,7 @@ bool TownMessage::execute(int portrait, const Common::String &name, const Common break; if (!msgEnd) { - if (confirm || _buttonValue == Common::KEYCODE_ESCAPE || + if (confirm || _buttonValue == Common::KEYCODE_ESCAPE || _buttonValue == Common::KEYCODE_n) result = 0; else if (_buttonValue == Common::KEYCODE_y) diff --git a/engines/xeen/town.h b/engines/xeen/town.h index 0767638f8a..25faa38c76 100644 --- a/engines/xeen/town.h +++ b/engines/xeen/town.h @@ -117,7 +117,7 @@ private: TownMessage(XeenEngine *vm) : ButtonContainer(vm) {} - bool execute(int portrait, const Common::String &name, + bool execute(int portrait, const Common::String &name, const Common::String &text, int confirm); void loadButtons(); diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp index fc7c99d407..32209a766b 100644 --- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp +++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp @@ -154,7 +154,7 @@ bool CloudsCutscenes::showCloudsIntro() { lake3.draw(screen, lakeCtr, Common::Point(0, yCtr)); } } - + xeen.draw(screen, 0); screen.update(); WAIT(1); @@ -218,7 +218,7 @@ bool CloudsCutscenes::showCloudsIntro() { groupo.draw(screen, 1, Common::Point(160, 0)); crodo.draw(screen, 0, Common::Point(0, -5)); screen._windows[0].writeString(Res.CLOUDS_INTRO1); - + // Unroll a scroll if (doScroll(false, true)) return false; @@ -273,10 +273,10 @@ bool CloudsCutscenes::showCloudsIntro() { } group.draw(screen, ctr4 + 5, Common::Point(0, 99)); - group.draw(screen, ctr2 + 24, Common::Point(202, 12)); + group.draw(screen, ctr2 + 24, Common::Point(202, 12)); if ((++totalCtr % 30) == 0) group.draw(screen, 43, Common::Point(178, 134)); - + switch (lineCtr) { case 2: case 4: diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp index e40fee680f..9aad9b1d18 100644 --- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp +++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp @@ -135,7 +135,7 @@ bool DarkSideCutscenes::showDarkSideTitle() { screen.loadBackground("jvc.raw"); screen.draw(); screen.fadeIn(); - + WAIT(60); return true; } @@ -262,7 +262,7 @@ bool DarkSideCutscenes::showDarkSideIntro() { title.clear(); pyraTop.clear(); pyramid.clear(); - + // SpriteResource dragon("dragon.int"); const int XLIST3[10] = { 102, 103, 104, 104, 104, 103, 102, 101, 101, 101 }; @@ -574,7 +574,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { sc08.draw(screen, 0); showSubtitles(); } while (_subtitleSize); - + sc08.clear(); // Nowhere to run to @@ -600,7 +600,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { screen.restoreBackground(); showSubtitles(); } while (_subtitleSize); - + sc09.clear(); // Nor do you! @@ -760,7 +760,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { screen.loadBackground("sc170001.raw"); screen.saveBackground(); screen.horizMerge(0); - sc16.draw(screen, 0, Common::Point(7, 29)); + sc16.draw(screen, 0, Common::Point(7, 29)); showSubtitles(); sound.playSound("fail1.voc"); @@ -834,7 +834,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { for (int idx = 0; idx < 4; ++idx) sc18[idx].clear(); - + // Closeup of Corak bleeding SpriteResource sc19("sc19.end"); screen.loadBackground("sc190001.raw"); @@ -1013,7 +1013,7 @@ bool DarkSideCutscenes::showDarkSideEnding() { screen.saveBackground(); sc25.draw(screen, 0, Common::Point(27, 30)); screen.update(); - + for (int struggleNum = 0; struggleNum < 2; ++struggleNum) { for (int idx = 0; idx < 9; ++idx) { if (struggleNum == 0 && idx == 2) @@ -1220,7 +1220,7 @@ void DarkSideCutscenes::showPharaohEndText(const char *msg1, const char *msg2, c idx = (idx + 1) % 32; screen.update(); - + events.pollEventsAndWait(); } while (!_vm->shouldQuit() && !events.isKeyMousePressed()); diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp index f4d8fdbc94..93a0005088 100644 --- a/engines/xeen/worldofxeen/worldofxeen.cpp +++ b/engines/xeen/worldofxeen/worldofxeen.cpp @@ -30,7 +30,7 @@ namespace Xeen { namespace WorldOfXeen { WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc) - : XeenEngine(syst, gameDesc), CloudsCutscenes(this), + : XeenEngine(syst, gameDesc), CloudsCutscenes(this), DarkSideCutscenes(this) { _seenDarkSideIntro = false; } diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h index 41fe4b3b83..7dbb710430 100644 --- a/engines/xeen/worldofxeen/worldofxeen.h +++ b/engines/xeen/worldofxeen/worldofxeen.h @@ -36,11 +36,11 @@ enum WOXGameAction { }; /** - * Implements a descendant of the base Xeen engine to handle + * Implements a descendant of the base Xeen engine to handle * Clouds of Xeen, Dark Side of Xeen, and Worlds of Xeen specific * game code */ -class WorldOfXeenEngine: public XeenEngine, public CloudsCutscenes, +class WorldOfXeenEngine: public XeenEngine, public CloudsCutscenes, public DarkSideCutscenes { protected: /** diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.cpp b/engines/xeen/worldofxeen/worldofxeen_menu.cpp index d3f273784b..ff73cab4bb 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.cpp +++ b/engines/xeen/worldofxeen/worldofxeen_menu.cpp @@ -53,7 +53,7 @@ void WorldOfXeenMenu::execute() { SpriteResource special("special.icn"); Screen &screen = *_vm->_screen; EventsManager &events = *_vm->_events; - + File newBright("newbrigh.m"); _vm->_sound->playSong(newBright); @@ -210,7 +210,7 @@ void WorldOptionsMenu::showContents(SpriteResource &title1, bool waitFlag) { Screen &screen = *_vm->_screen; EventsManager &events = *_vm->_events; events.updateGameCounter(); - + // Draw the background frame in a continous cycle _bgFrame = (_bgFrame + 1) % 5; title1.draw(screen._windows[0], _bgFrame); diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.h b/engines/xeen/worldofxeen/worldofxeen_menu.h index 9b507b7ed1..49553dd10f 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.h +++ b/engines/xeen/worldofxeen/worldofxeen_menu.h @@ -87,7 +87,7 @@ protected: virtual void showContents(SpriteResource &title1, bool mode); public: WorldOptionsMenu(XeenEngine *vm) : DarkSideOptionsMenu(vm), _bgFrame(0) {} - + virtual ~WorldOptionsMenu() {} }; |