diff options
author | Denis Kasak | 2009-07-02 20:29:14 +0000 |
---|---|---|
committer | Denis Kasak | 2009-07-02 20:29:14 +0000 |
commit | 8bba3e6f10ce68dd9615ab7340fb0c54b3f61e1a (patch) | |
tree | 5539766f3a3db5b21a2b3e566b13a1231e184e50 | |
parent | cac39d8295c7be133d9d51c3e5b9dd7d8b5637cc (diff) | |
download | scummvm-rg350-8bba3e6f10ce68dd9615ab7340fb0c54b3f61e1a.tar.gz scummvm-rg350-8bba3e6f10ce68dd9615ab7340fb0c54b3f61e1a.tar.bz2 scummvm-rg350-8bba3e6f10ce68dd9615ab7340fb0c54b3f61e1a.zip |
Added Game::changeRoom() method and Game::_currentRoom.
svn-id: r42036
-rw-r--r-- | engines/draci/game.cpp | 34 | ||||
-rw-r--r-- | engines/draci/game.h | 4 |
2 files changed, 36 insertions, 2 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 5bcaa1434e..75f55e1798 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -134,7 +134,7 @@ Game::Game(DraciEngine *vm) : _vm(vm) { loadObject(1); _vm->_script->run(getObject(1)->_program, getObject(1)->_init); - // changeRoom(_currentRoom); + changeRoom(_info->_currentRoom); } void Game::loadObject(uint16 objNum) { @@ -189,6 +189,38 @@ GameObject *Game::getObject(uint16 objNum) { return _objects + objNum; } +void Game::changeRoom(uint16 roomNum) { + + // Convert to real index (indexes begin with 1 in the data files) + roomNum -= 1; + + BAFile *f; + f = _vm->_roomsArchive->getFile(roomNum); + Common::MemoryReadStream roomReader(f->_data, f->_length); + + roomReader.readUint32LE(); // Pointer to room program, not used + roomReader.readUint16LE(); // Program length, not used + roomReader.readUint32LE(); // Pointer to room title, not used + + _currentRoom._music = roomReader.readByte(); + _currentRoom._map = roomReader.readByte(); + _currentRoom._palette = roomReader.readByte(); + _currentRoom._numMasks = roomReader.readUint16LE(); + _currentRoom._init = roomReader.readUint16LE(); + _currentRoom._look = roomReader.readUint16LE(); + _currentRoom._use = roomReader.readUint16LE(); + _currentRoom._canUse = roomReader.readUint16LE(); + _currentRoom._imInit = roomReader.readByte(); + _currentRoom._imLook = roomReader.readByte(); + _currentRoom._imUse = roomReader.readByte(); + _currentRoom._mouseOn = roomReader.readByte(); + _currentRoom._heroOn = roomReader.readByte(); + roomReader.read(&_currentRoom._pers0, 12); + roomReader.read(&_currentRoom._persStep, 12); + _currentRoom._escRoom = roomReader.readByte(); + _currentRoom._numGates = roomReader.readByte(); +} + Game::~Game() { delete[] _persons; delete[] _variables; diff --git a/engines/draci/game.h b/engines/draci/game.h index e65de7c771..d3a47902d8 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -105,9 +105,11 @@ private: int16 *_variables; byte *_itemStatus; GameObject *_objects; - + Room _currentRoom; + void loadObject(uint16 numObj); GameObject *getObject(uint16 objNum); + void changeRoom(uint16 roomNum); }; } // End of namespace Draci |