diff options
author | Matthew Stewart | 2018-05-25 21:53:18 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | 9e314e19d98bfb952c5fb1eb216fa97d0e95179f (patch) | |
tree | cb56aa3cb3170b8d25ff3c48d4038dadda4b4829 /engines/startrek/room.cpp | |
parent | 45ae72b763268d87a5a6613231b7a11a2fbd8168 (diff) | |
download | scummvm-rg350-9e314e19d98bfb952c5fb1eb216fa97d0e95179f.tar.gz scummvm-rg350-9e314e19d98bfb952c5fb1eb216fa97d0e95179f.tar.bz2 scummvm-rg350-9e314e19d98bfb952c5fb1eb216fa97d0e95179f.zip |
STARTREK: Demon2, half of Demon3 done
Diffstat (limited to 'engines/startrek/room.cpp')
-rw-r--r-- | engines/startrek/room.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index f6e94f7338..1de12153f1 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -21,6 +21,7 @@ */ #include "startrek/filestream.h" +#include "startrek/iwfile.h" #include "startrek/room.h" #include "startrek/startrek.h" @@ -44,6 +45,14 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) { _roomActionList = demon1ActionList; _numRoomActions = sizeof(demon1ActionList) / sizeof(RoomAction); } + else if (name == "DEMON2") { + _roomActionList = demon2ActionList; + _numRoomActions = sizeof(demon2ActionList) / sizeof(RoomAction); + } + else if (name == "DEMON3") { + _roomActionList = demon3ActionList; + _numRoomActions = sizeof(demon3ActionList) / sizeof(RoomAction); + } else { warning("Room \"%s\" unimplemented", name.c_str()); _numRoomActions = 0; @@ -199,7 +208,7 @@ void Room::loadRoomIndex(int roomIndex, int spawnIndex) { } void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finishedAnimActionParam) { - if (!(actorIndex >= OBJECT_KIRK && actorIndex < OBJECT_REDSHIRT)) + if (!(actorIndex >= OBJECT_KIRK && actorIndex <= OBJECT_REDSHIRT)) error("Tried to walk a non PC"); Actor *actor = &_vm->_actorList[actorIndex]; @@ -212,6 +221,21 @@ void Room::walkCrewman(int actorIndex, int16 destX, int16 destY, uint16 finished } } +/** + * Loads a pair of .map and .iw files to change the room's collisions and pathfinding. + */ +void Room::loadMapFile(const Common::String &name) { + _vm->_mapFilename = name; + _vm->_iwFile.reset(); + _vm->_mapFile.reset(); + _vm->_iwFile = SharedPtr<IWFile>(new IWFile(_vm, name + ".iw")); + _vm->_mapFile = _vm->loadFile(name + ".map"); +} + +Common::Point Room::getActorPos(int actorIndex) { + return _vm->_actorList[actorIndex].pos; +} + void Room::playSoundEffectIndex(int soundEffect) { _vm->playSoundEffectIndex(soundEffect); } |