diff options
author | Eugene Sandulenko | 2018-03-23 22:40:10 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-24 02:45:26 +0100 |
commit | 5a94c42e80c5454d06614a3c294aa5f28f01303d (patch) | |
tree | c0b6b418f43f90fe2685bc436f1c43d088646fc2 /engines/bladerunner | |
parent | 05144ab3cae69dd2438dd3442c0157ae3a07deaf (diff) | |
download | scummvm-rg350-5a94c42e80c5454d06614a3c294aa5f28f01303d.tar.gz scummvm-rg350-5a94c42e80c5454d06614a3c294aa5f28f01303d.tar.bz2 scummvm-rg350-5a94c42e80c5454d06614a3c294aa5f28f01303d.zip |
BLADERUNNER: Implement PoliceMaze::tick()
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/police_maze.cpp | 41 | ||||
-rw-r--r-- | engines/bladerunner/police_maze.h | 5 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/script.h | 2 |
4 files changed, 47 insertions, 3 deletions
diff --git a/engines/bladerunner/police_maze.cpp b/engines/bladerunner/police_maze.cpp index 8c79fc7e14..52521caa95 100644 --- a/engines/bladerunner/police_maze.cpp +++ b/engines/bladerunner/police_maze.cpp @@ -21,8 +21,10 @@ */ #include "bladerunner/bladerunner.h" - +#include "bladerunner/game_constants.h" #include "bladerunner/police_maze.h" +#include "bladerunner/scene.h" +#include "bladerunner/script/scene_script.h" namespace BladeRunner { @@ -45,7 +47,7 @@ PoliceMaze::~PoliceMaze() { } void PoliceMaze::reset() { - _isActive = false; + _isPaused = false; _needAnnouncement = false; _announcementRead = false; @@ -67,6 +69,39 @@ void PoliceMaze::setPauseState(bool state) { } void PoliceMaze::tick() { + if (_isPaused) + return; + + if (_vm->_scene->getSetId() != kSetPS10_PS11_PS12_PS13) + return; + + if (_announcementRead) { + _needAnnouncement = false; + + return; + } + + for (int i = 0; i < kNumMazeTracks; i++) + _tracks[i]->tick(); + + bool notFound = true; + for (int i = 0; i < kNumMazeTracks; i++) { + if (!_tracks[i]->isVisible()) { + notFound = false; + break; + } + } + + if (notFound && _needAnnouncement && !_announcementRead) { + _needAnnouncement = false; + _announcementRead = true; + + if (_vm->_scene->getSceneId() == kScenePS13) { + _vm->_sceneScript->actorVoiceOver(320, kActorAnsweringMachine); + } else { + _vm->_sceneScript->actorVoiceOver(310, kActorAnsweringMachine); + } + } } PoliceMazeTargetTrack::PoliceMazeTargetTrack() { @@ -99,5 +134,7 @@ void PoliceMazeTargetTrack::add(int trackId, float startX, float startY, float s warning("PoliceMazeTargetTrack::add(%d, %f, %f, %f, %f, %f, %f, %d, %p, %d)", trackId, startX, startY, startZ, endX, endY, endZ, count, (void *)list, a11); } +void PoliceMazeTargetTrack::tick() { +} } // End of namespace BladeRunner diff --git a/engines/bladerunner/police_maze.h b/engines/bladerunner/police_maze.h index ef49161c24..96fac2f034 100644 --- a/engines/bladerunner/police_maze.h +++ b/engines/bladerunner/police_maze.h @@ -59,12 +59,15 @@ public: void reset(); 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 isVisible() { return _visible; } }; class PoliceMaze { BladeRunnerEngine *_vm; - bool _isActive; + bool _isPaused; bool _needAnnouncement; bool _announcementRead; int _pm_var1; diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h index 54047ed8a8..f9f08050e3 100644 --- a/engines/bladerunner/script/scene_script.h +++ b/engines/bladerunner/script/scene_script.h @@ -546,6 +546,8 @@ public: void playerWalkedOut(); void dialogueQueueFlushed(int a1); bool isInsideScript() const { return _inScriptCounter > 0; } + + void actorVoiceOver(int sentenceId, int actorId) { _currentScript->Actor_Voice_Over(sentenceId, actorId); } }; } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index 07b503979a..8e7ac9e50a 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -33,6 +33,8 @@ namespace BladeRunner { class BladeRunnerEngine; class ScriptBase { +friend class SceneScript; + protected: BladeRunnerEngine *_vm; |