diff options
-rw-r--r-- | engines/bladerunner/police_maze.cpp | 19 | ||||
-rw-r--r-- | engines/bladerunner/police_maze.h | 8 | ||||
-rw-r--r-- | engines/bladerunner/scene.cpp | 4 |
3 files changed, 28 insertions, 3 deletions
diff --git a/engines/bladerunner/police_maze.cpp b/engines/bladerunner/police_maze.cpp index 52521caa95..11eeb869fe 100644 --- a/engines/bladerunner/police_maze.cpp +++ b/engines/bladerunner/police_maze.cpp @@ -59,13 +59,25 @@ void PoliceMaze::reset() { _pm_var2 = 0; } +void PoliceMaze::clear(bool isLoadingGame) { + for (int i = 0; i < kNumMazeTracks; i++) { + if (_tracks[i]->isPresent()) + _tracks[i]->clear(isLoadingGame); + } +} + void PoliceMaze::activate() { _needAnnouncement = true; _announcementRead = false; } void PoliceMaze::setPauseState(bool state) { - warning("PoliceMaze::setPauseState(%d)", state); + _isPaused = state; + + uint32 t = _vm->getTotalPlayTime(); + + for (int i = 0; i < kNumMazeTracks; i++) + _tracks[i]->setTime(t); } void PoliceMaze::tick() { @@ -109,6 +121,7 @@ PoliceMazeTargetTrack::PoliceMazeTargetTrack() { } PoliceMazeTargetTrack::~PoliceMazeTargetTrack() { + reset(); } void PoliceMazeTargetTrack::reset() { @@ -130,6 +143,10 @@ void PoliceMazeTargetTrack::reset() { _visible = true; } +void PoliceMazeTargetTrack::clear(bool isLoadingGame) { + reset(); +} + void PoliceMazeTargetTrack::add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int count, void *list, bool a11) { warning("PoliceMazeTargetTrack::add(%d, %f, %f, %f, %f, %f, %f, %d, %p, %d)", trackId, startX, startY, startZ, endX, endY, endZ, count, (void *)list, a11); } diff --git a/engines/bladerunner/police_maze.h b/engines/bladerunner/police_maze.h index 96fac2f034..ce1a40fb0b 100644 --- a/engines/bladerunner/police_maze.h +++ b/engines/bladerunner/police_maze.h @@ -35,7 +35,7 @@ enum { class BladeRunnerEngine; class PoliceMazeTargetTrack { - int _time; + uint32 _time; bool _isPresent; int _itemId; int _count; @@ -58,10 +58,15 @@ public: ~PoliceMazeTargetTrack(); void reset(); + void clear(bool isLoadingGame); void add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int count, void *list, bool a11); void tick(); + bool isPresent() { return _isPresent; } + void setVisible() { _visible = true; } + void resetVisible() { _visible = false; } bool isVisible() { return _visible; } + void setTime(uint32 t) { _time = t; } }; class PoliceMaze { @@ -82,6 +87,7 @@ public: void tick(); void reset(); + void clear(bool isLoadingGame); void setPauseState(bool state); void activate(); }; diff --git a/engines/bladerunner/scene.cpp b/engines/bladerunner/scene.cpp index 123134ed96..6b0404d351 100644 --- a/engines/bladerunner/scene.cpp +++ b/engines/bladerunner/scene.cpp @@ -29,6 +29,7 @@ #include "bladerunner/game_info.h" #include "bladerunner/items.h" #include "bladerunner/overlays.h" +#include "bladerunner/police_maze.h" #include "bladerunner/regions.h" #include "bladerunner/scene_objects.h" #include "bladerunner/screen_effects.h" @@ -187,7 +188,8 @@ bool Scene::close(bool isLoadingGame) { return true; } - //_vm->_policeMaze->clear(!isLoadingGame); + _vm->_policeMaze->clear(!isLoadingGame); + if (isLoadingGame) { _vm->_sceneScript->playerWalkedOut(); } |