diff options
Diffstat (limited to 'engines/kyra/eobcommon.cpp')
-rw-r--r-- | engines/kyra/eobcommon.cpp | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index fadb1066e0..d477209e5b 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -57,7 +57,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags) _configMouse = true; _loading = false; - _useHiResDithering = false; + _enableHiResDithering = false; _envAudioTimer = 0; _flashShapeTimer = 0; @@ -364,14 +364,14 @@ void EoBCoreEngine::initKeymap() { } Common::Error EoBCoreEngine::init() { - // In EOB the timer proc is directly invoked via interrupt 0x1c, 18.2 times per second. + // In EOB the timer proc is directly invoked via interrupt 0x1C, 18.2 times per second. // This makes a tick length of 54.94. _tickLength = 55; if (ConfMan.hasKey("render_mode")) _configRenderMode = Common::parseRenderMode(ConfMan.get("render_mode")); - _useHiResDithering = (_configRenderMode == Common::kRenderEGA && _flags.useHiRes); + _enableHiResDithering = (_configRenderMode == Common::kRenderEGA && _flags.useHiRes); _screen = new Screen_EoB(this, _system); assert(_screen); @@ -417,12 +417,6 @@ Common::Error EoBCoreEngine::init() { _screen->loadFont(Screen::FID_6_FNT, "FONT6.FNT"); _screen->loadFont(Screen::FID_8_FNT, "FONT8.FNT"); - if (_useHiResDithering) { - _vcnBlockWidth <<= 1; - _vcnBlockHeight <<= 1; - SWAP(_vcnFlip0, _vcnFlip1); - } - Common::Error err = KyraRpgEngine::init(); if (err.getCode() != Common::kNoError) return err; @@ -494,8 +488,8 @@ Common::Error EoBCoreEngine::init() { _monsterFlashOverlay = new uint8[16]; _monsterStoneOverlay = new uint8[16]; - memset(_monsterFlashOverlay, (_configRenderMode == Common::kRenderCGA) ? 0xff : 0x0f, 16 * sizeof(uint8)); - memset(_monsterStoneOverlay, 0x0d, 16 * sizeof(uint8)); + memset(_monsterFlashOverlay, (_configRenderMode == Common::kRenderCGA) ? 0xFF : 0x0F, 16 * sizeof(uint8)); + memset(_monsterStoneOverlay, 0x0D, 16 * sizeof(uint8)); _monsterFlashOverlay[0] = _monsterStoneOverlay[0] = 0; // Prevent autosave on game startup @@ -991,7 +985,7 @@ void EoBCoreEngine::recalcArmorClass(int index) { int tp = _items[itm].type; - if (!(_itemTypes[tp].allowedClasses & _classModifierFlags[c->cClass]) || (_itemTypes[tp].extraProperties & 0x7f) || (i >= 1 && i <= 2 && tp != 27 && !(_flags.gameID == GI_EOB2 && tp == 57))) + if (!(_itemTypes[tp].allowedClasses & _classModifierFlags[c->cClass]) || (_itemTypes[tp].extraProperties & 0x7F) || (i >= 1 && i <= 2 && tp != 27 && !(_flags.gameID == GI_EOB2 && tp == 57))) continue; c->armorClass += _itemTypes[tp].armorClass; @@ -1003,12 +997,12 @@ void EoBCoreEngine::recalcArmorClass(int index) { int8 m2 = 0; if (c->inventory[25]) { - if (!(_itemTypes[_items[c->inventory[25]].type].extraProperties & 0x7f)) + if (!(_itemTypes[_items[c->inventory[25]].type].extraProperties & 0x7F)) m1 = _items[c->inventory[25]].value; } if (c->inventory[26]) { - if (!(_itemTypes[_items[c->inventory[26]].type].extraProperties & 0x7f)) + if (!(_itemTypes[_items[c->inventory[26]].type].extraProperties & 0x7F)) m2 = _items[c->inventory[26]].value; } @@ -1060,7 +1054,7 @@ int EoBCoreEngine::validateWeaponSlotItem(int index, int slot) { if (!itm2) return 1; - int f = (_itemTypes[tp2].extraProperties & 0x7f); + int f = (_itemTypes[tp2].extraProperties & 0x7F); if (f <= 0 || f > 3) return r; @@ -1275,12 +1269,12 @@ void EoBCoreEngine::removeCharacterFromParty(int charIndex) { if (i == 16 || !c->inventory[i]) continue; - setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3ff].drawObjects, _currentBlock, c->inventory[i], _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]); + setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3FF].drawObjects, _currentBlock, c->inventory[i], _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]); c->inventory[i] = 0; } while (c->inventory[16]) - setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3ff].drawObjects, _currentBlock, getQueuedItem(&c->inventory[16], 0, -1), _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]); + setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3FF].drawObjects, _currentBlock, getQueuedItem(&c->inventory[16], 0, -1), _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]); c->inventory[16] = 0; @@ -1326,7 +1320,7 @@ void EoBCoreEngine::increaseCharacterExperience(int charIndex, int32 points) { _characters[charIndex].experience[i] += points; uint32 er = getRequiredExperience(cl, i, _characters[charIndex].level[i] + 1); - if (er == 0xffffffff) + if (er == 0xFFFFFFFF) continue; if (_characters[charIndex].experience[i] >= er) @@ -1337,7 +1331,7 @@ void EoBCoreEngine::increaseCharacterExperience(int charIndex, int32 points) { uint32 EoBCoreEngine::getRequiredExperience(int cClass, int levelIndex, int level) { cClass = getCharacterClassType(cClass, levelIndex); if (cClass == -1) - return 0xffffffff; + return 0xFFFFFFFF; const uint32 *tbl = _expRequirementTables[cClass]; return tbl[level - 1]; @@ -1625,7 +1619,7 @@ void EoBCoreEngine::displayParchment(int id) { removeInputTop(); while (!shouldQuit()) { delay(_tickLength); - if (checkInput(0, false, 0) & 0xff) + if (checkInput(0, false, 0) & 0xFF) break; removeInputTop(); } @@ -1658,7 +1652,7 @@ int EoBCoreEngine::countResurrectionCandidates() { if (!inv) continue; - if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[inv].type].extraProperties & 0x7f) != 8)) || (_flags.gameID == GI_EOB2 && _items[inv].type != 33)) + if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[inv].type].extraProperties & 0x7F) != 8)) || (_flags.gameID == GI_EOB2 && _items[inv].type != 33)) continue; _rrNames[_rrCount] = _npcPreset[_items[inv].value - 1].name; @@ -1667,7 +1661,7 @@ int EoBCoreEngine::countResurrectionCandidates() { } if (_itemInHand > 0) { - if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[_itemInHand].type].extraProperties & 0x7f) == 8)) || (_flags.gameID == GI_EOB2 && _items[_itemInHand].type == 33)) { + if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[_itemInHand].type].extraProperties & 0x7F) == 8)) || (_flags.gameID == GI_EOB2 && _items[_itemInHand].type == 33)) { _rrNames[_rrCount] = _npcPreset[_items[_itemInHand].value - 1].name; _rrId[_rrCount++] = -_items[_itemInHand].value; } @@ -1748,7 +1742,7 @@ void EoBCoreEngine::seq_portal() { bool EoBCoreEngine::checkPassword() { char answ[20]; Screen::FontId of = _screen->setFont(Screen::FID_8_FNT); - _screen->copyPage(0, _useHiResDithering ? 4 : 10); + _screen->copyPage(0, 10); _screen->setScreenDim(13); gui_drawBox(_screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, guiSettings()->colors.frame1, guiSettings()->colors.frame2, -1); @@ -1775,7 +1769,7 @@ bool EoBCoreEngine::checkPassword() { _screen->modifyScreenDim(13, _screen->_curDim->sx - 1, _screen->_curDim->sy - 2, _screen->_curDim->w + 2, _screen->_curDim->h + 16); _screen->setFont(of); - _screen->copyPage(_useHiResDithering ? 4 : 10, 0); + _screen->copyPage(10, 0); return true; } @@ -1786,7 +1780,7 @@ void EoBCoreEngine::useSlotWeapon(int charIndex, int slotIndex, Item item) { if (c->effectFlags & 0x40) removeCharacterEffect(10, charIndex, 1); // remove invisibility effect - int ep = _itemTypes[tp].extraProperties & 0x7f; + int ep = _itemTypes[tp].extraProperties & 0x7F; int8 inflict = 0; if (ep == 1) { @@ -1829,14 +1823,14 @@ int EoBCoreEngine::closeDistanceAttack(int charIndex, Item item) { if (r == -1) { uint8 w = _specialWallTypes[_levelBlockProperties[d].walls[_sceneDrawVarDown]]; - if (w == 0xff) { + if (w == 0xFF) { if (_flags.gameID == GI_EOB1) { _levelBlockProperties[d].walls[_sceneDrawVarDown]++; _levelBlockProperties[d].walls[_sceneDrawVarDown ^ 2]++; } else { for (int i = 0; i < 4; i++) { - if (_specialWallTypes[_levelBlockProperties[d].walls[i]] == 0xff) + if (_specialWallTypes[_levelBlockProperties[d].walls[i]] == 0xFF) _levelBlockProperties[d].walls[i]++; } } @@ -1927,7 +1921,7 @@ int EoBCoreEngine::projectileWeaponAttack(int charIndex, Item item) { void EoBCoreEngine::inflictMonsterDamage(EoBMonsterInPlay *m, int damage, bool giveExperience) { m->hitPointsCur -= damage; - m->flags = (m->flags & 0xf7) | 1; + m->flags = (m->flags & 0xF7) | 1; if (_monsterProps[m->type].capsFlags & 0x2000) { explodeMonster(m); @@ -2033,7 +2027,7 @@ bool EoBCoreEngine::characterAttackHitTest(int charIndex, int monsterIndex, int if (charIndex < 0) return true; - int p = item ? (_flags.gameID == GI_EOB1 ? _items[item].type : (_itemTypes[_items[item].type].extraProperties & 0x7f)) : 0; + int p = item ? (_flags.gameID == GI_EOB1 ? _items[item].type : (_itemTypes[_items[item].type].extraProperties & 0x7F)) : 0; if (_monsters[monsterIndex].flags & 0x20) return true;// EOB 2 only ? @@ -2212,7 +2206,7 @@ void EoBCoreEngine::statusAttack(int charIndex, int attackStatusFlags, const cha c->flags |= attackStatusFlags; } - if ((attackStatusFlags & 0x0c) && (_openBookChar == charIndex) && _updateFlags) { + if ((attackStatusFlags & 0x0C) && (_openBookChar == charIndex) && _updateFlags) { Button b; clickedSpellbookAbort(&b); } @@ -2318,7 +2312,7 @@ int EoBCoreEngine::getSaveThrowModifier(int hpModifier, int level, int type) { } bool EoBCoreEngine::calcDamageCheckItemType(int itemType) { - itemType = _itemTypes[itemType].extraProperties & 0x7f; + itemType = _itemTypes[itemType].extraProperties & 0x7F; return (itemType == 2 || itemType == 3) ? true : false; } |