diff options
author | Matthew Stewart | 2018-05-14 13:26:47 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | 65d24b04519a5e0bbd7b1efbf6b379d539b424e5 (patch) | |
tree | 068d8ab56ab06648faea3b74b3bd9639c4fc8a20 /engines/startrek/awaymission.cpp | |
parent | 0187c795d5e1569105d4cb49a16810f6a50cc261 (diff) | |
download | scummvm-rg350-65d24b04519a5e0bbd7b1efbf6b379d539b424e5.tar.gz scummvm-rg350-65d24b04519a5e0bbd7b1efbf6b379d539b424e5.tar.bz2 scummvm-rg350-65d24b04519a5e0bbd7b1efbf6b379d539b424e5.zip |
STARTREK: Basic walking
Diffstat (limited to 'engines/startrek/awaymission.cpp')
-rw-r--r-- | engines/startrek/awaymission.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp index 73526eeaa2..77576d295c 100644 --- a/engines/startrek/awaymission.cpp +++ b/engines/startrek/awaymission.cpp @@ -158,10 +158,10 @@ void StarTrekEngine::handleAwayMissionEvents() { _gfx->incPaletteFadeLevel(); break; case TREKEVENT_LBUTTONDOWN: - if (_awayMission.field1d != 0) - break; + //if (_awayMission.field1d != 0) // FIXME: uncomment + // break; switch (_awayMission.mapFileLoaded) { - case 0: + case 1: if (_awayMission.field1c == 0) { _kirkObject->sprite.drawMode = 1; // Hide these objects for function call below? _spockObject->sprite.drawMode = 1; @@ -178,11 +178,9 @@ void StarTrekEngine::handleAwayMissionEvents() { Common::String animFilename = getCrewmanAnimFilename(0, "walk"); Common::Point mousePos = _gfx->getMousePos(); - // objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y); + objectWalkToPosition(0, animFilename, _kirkObject->pos.x, _kirkObject->pos.y, mousePos.x, mousePos.y); } break; - case 1: - break; case 2: break; case 3: @@ -232,6 +230,17 @@ Room *StarTrekEngine::getRoom() { } void StarTrekEngine::runAwayMissionCycle() { + // TODO +} + +/** + * Returns true if the given position in the room is solid (not walkable). + * Reads from a ".map" file which has a bit for each position in the room, which is true + * when that position is solid. + */ +bool StarTrekEngine::isPositionSolid(int16 x, int16 y) { + _mapFile->seek((y * SCREEN_WIDTH + x) / 8, SEEK_SET); + return _mapFile->readByte() & (0x80 >> (x % 8)); } } |