diff options
author | Matthew Stewart | 2018-06-10 22:01:39 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | 487c3fda3252536fdd57e9db4020d23f20069aae (patch) | |
tree | f840cbd96bf99ada9d89e3bcea40bd0a37ddbbe2 /engines/startrek/room.cpp | |
parent | 41997ebc20a9d1de7225e589bad5472de5c9c132 (diff) | |
download | scummvm-rg350-487c3fda3252536fdd57e9db4020d23f20069aae.tar.gz scummvm-rg350-487c3fda3252536fdd57e9db4020d23f20069aae.tar.bz2 scummvm-rg350-487c3fda3252536fdd57e9db4020d23f20069aae.zip |
STARTREK: TUG2
Diffstat (limited to 'engines/startrek/room.cpp')
-rw-r--r-- | engines/startrek/room.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index 8e1de88385..cc07488747 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -73,6 +73,10 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) { _roomActionList = tug1ActionList; _numRoomActions = sizeof(tug1ActionList) / sizeof(RoomAction); } + else if (name == "TUG2") { + _roomActionList = tug2ActionList; + _numRoomActions = sizeof(tug2ActionList) / sizeof(RoomAction); + } else { warning("Room \"%s\" unimplemented", name.c_str()); _numRoomActions = 0; @@ -289,6 +293,32 @@ void Room::loadMapFile(const Common::String &name) { _vm->_mapFile = _vm->loadFile(name + ".map"); } +void Room::showBitmapFor5Ticks(const Common::String &bmpName, int priority) { + if (priority < 0 || priority > 15) + priority = 5; + + Sprite sprite; + _vm->_gfx->addSprite(&sprite); + sprite.setXYAndPriority(0, 0, priority); + sprite.setBitmap(_vm->_gfx->loadBitmap(bmpName)); + + _vm->_gfx->drawAllSprites(); + + TrekEvent event; + int ticks = 0; + + while (ticks < 5) { + while (!_vm->popNextEvent(&event)); + + if (event.type == TREKEVENT_TICK) + ticks++; + } + + sprite.dontDrawNextFrame(); + _vm->_gfx->drawAllSprites(); + _vm->_gfx->delSprite(&sprite); +} + Common::Point Room::getActorPos(int actorIndex) { return _vm->_actorList[actorIndex].pos; } @@ -334,4 +364,26 @@ void Room::playVoc(Common::String filename) { _vm->_sound->playVoc(filename); } +void Room::spockScan(int direction, int text) { + const char *dirs = "nsew"; + Common::String anim = "sscan_"; + anim.setChar(dirs[direction], 5); + + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = direction; + loadActorAnim2(OBJECT_SPOCK, anim, -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_SPOCK, text); +} + +void Room::mccoyScan(int direction, int text) { + const char *dirs = "nsew"; + Common::String anim = "mscan_"; + anim.setChar(dirs[direction], 5); + + _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = direction; + loadActorAnim2(OBJECT_MCCOY, anim, -1, -1, 0); + playSoundEffectIndex(SND_TRICORDER); + showText(TX_SPEAKER_MCCOY, text); +} + } |