diff options
Diffstat (limited to 'engines/kyra/sprites_eob.cpp')
-rw-r--r-- | engines/kyra/sprites_eob.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp index 3447b6bc7f..802ba4e4c8 100644 --- a/engines/kyra/sprites_eob.cpp +++ b/engines/kyra/sprites_eob.cpp @@ -54,7 +54,11 @@ int LolEobBaseEngine::getBlockDistance(uint16 block1, uint16 block2) { namespace Kyra { void EobCoreEngine::loadMonsterShapes(const char *filename, int monsterIndex, bool hasDecorations, int encodeTableIndex) { - _screen->loadEobBitmap(filename, 3, 3); + Common::String s = _flags.gameID == GI_EOB1 && !scumm_stricmp(filename, "spider") ? "spider1" : filename; + if (GI_EOB1 && !scumm_stricmp(filename, "rust")) + s += "1"; + + _screen->loadShapeSetBitmap(s.c_str(), 3, 3); const uint16 *enc = &_encodeMonsterShpTable[encodeTableIndex << 2]; for (int i = 0; i < 6; i++, enc += 4) @@ -275,14 +279,14 @@ void EobCoreEngine::updateAttackingMonsterFlags() { } const int8 *EobCoreEngine::getMonsterBlockPositions(uint16 block) { - static int8 pos[6]; - memset(pos, -1, sizeof(pos)); + memset(_monsterBlockPosArray, -1, sizeof(_monsterBlockPosArray)); for (int8 i = 0; i < 30; i++) { if (_monsters[i].block != block) continue; - pos[_monsters[i].pos] = i; + assert(_monsters[i].pos < sizeof(_monsterBlockPosArray)); + _monsterBlockPosArray[_monsters[i].pos] = i; } - return pos; + return _monsterBlockPosArray; } int EobCoreEngine::getClosestMonsterPos(int charIndex, int block) { @@ -770,6 +774,11 @@ void EobCoreEngine::updateMonsterDest2(EobMonsterInPlay *m) { m->dest = _currentBlock; } +void EobCoreEngine::updateAllMonsterDests() { + for (int i = 0; i < 30; i++) + updateMonsterDest(&_monsters[i]); +} + void EobCoreEngine::turnFriendlyMonstersHostile() { EobMonsterInPlay *m = 0; for (int i = 0; i < 30; i++) { |