aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2019-02-03 11:42:26 +0100
committerPeter Kohaut2019-02-03 11:44:55 +0100
commita7f1230980674397486af0c8ec4057d83f3ff0dd (patch)
tree0948537495f101066a8f93d1e9aa3523d620c3e5
parent934ba34adb8189535bf121fa3b7041e4f61bfb72 (diff)
downloadscummvm-rg350-a7f1230980674397486af0c8ec4057d83f3ff0dd.tar.gz
scummvm-rg350-a7f1230980674397486af0c8ec4057d83f3ff0dd.tar.bz2
scummvm-rg350-a7f1230980674397486af0c8ec4057d83f3ff0dd.zip
BLADERUNNER: Fixed end credits
Game is completable for blade runner path
-rw-r--r--engines/bladerunner/bladerunner.cpp225
-rw-r--r--engines/bladerunner/game_constants.h2
-rw-r--r--engines/bladerunner/outtake.cpp4
-rw-r--r--engines/bladerunner/ui/elevator.cpp4
-rw-r--r--engines/bladerunner/ui/end_credits.cpp2
-rw-r--r--engines/bladerunner/ui/esper.cpp2
-rw-r--r--engines/bladerunner/ui/scores.cpp4
-rw-r--r--engines/bladerunner/ui/spinner.cpp10
-rw-r--r--engines/bladerunner/ui/vk.cpp12
9 files changed, 131 insertions, 134 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 4768ca5e28..49450e6367 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -340,7 +340,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
_lights = new Lights(this);
- // TODO: outtake player - but this is done bit differently
+ // outtake player was initialized here in the original game - but this is done bit differently
_policeMaze = new PoliceMaze(this);
@@ -383,11 +383,6 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
return false;
}
-
- // TODO: Create datetime - not used
-
- // TODO: Create graphics surfaces 1-4
-
// TODO: Allocate audio cache
if (hasSavegames) {
@@ -434,7 +429,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
_ambientSounds = new AmbientSounds(this);
- // TODO: Read BLADE.INI
+ // BLADE.INI was read here, but it was replaced by ScummVM configuration
_chapters = new Chapters(this);
if (!_chapters)
@@ -546,14 +541,13 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
_crimesDatabase = new CrimesDatabase(this, "CLUES", _gameInfo->getClueCount());
- // TODO: Scene
_scene = new Scene(this);
// Load INIT.DLL
InitScript initScript(this);
initScript.SCRIPT_Initialize_Game();
- // TODO: Load AI-ACT1.DLL
+ // Load AI-ACT1.DLL
_aiScripts = new AIScripts(this, actorCount);
initChapterAndScene();
@@ -594,7 +588,7 @@ void BladeRunnerEngine::initChapterAndScene() {
void BladeRunnerEngine::shutdown() {
_mixer->stopAll();
- // TODO: Write BLADE.INI
+ // BLADE.INI as updated here
delete _vk;
_vk = nullptr;
@@ -721,10 +715,6 @@ void BladeRunnerEngine::shutdown() {
delete _waypoints;
_waypoints = nullptr;
- // TODO: Delete Cover waypoints
-
- // TODO: Delete Flee waypoints
-
delete _scores;
_scores = nullptr;
@@ -743,8 +733,6 @@ void BladeRunnerEngine::shutdown() {
delete _suspectsDatabase;
_suspectsDatabase = nullptr;
- // TODO: Delete datetime - not used
-
int actorCount = (int)_gameInfo->getActorCount();
for (int i = 0; i != actorCount; ++i) {
delete _actors[i];
@@ -846,136 +834,141 @@ void BladeRunnerEngine::gameLoop() {
void BladeRunnerEngine::gameTick() {
handleEvents();
- if (_gameIsRunning && _windowIsActive) {
- if (!_kia->isOpen() && !_sceneScript->isInsideScript() && !_aiScripts->isInsideScript()) {
- _settings->openNewScene();
- }
+ if (!_gameIsRunning || !_windowIsActive) {
+ return;
+ }
- // TODO: Autosave
+ if (!_kia->isOpen() && !_sceneScript->isInsideScript() && !_aiScripts->isInsideScript()) {
+ _settings->openNewScene();
+ }
- //probably not needed, this version of tick is just loading data from buffer
- //_audioMixer->tick();
+ // TODO: Autosave
- if (_kia->isOpen()) {
- _kia->tick();
- return;
- }
+ //probably not needed, this version of tick is just loading data from buffer
+ //_audioMixer->tick();
- if (_spinner->isOpen()) {
- _spinner->tick();
- _ambientSounds->tick();
- return;
- }
+ if (_kia->isOpen()) {
+ _kia->tick();
+ return;
+ }
- if (_esper->isOpen()) {
- _esper->tick();
- return;
- }
+ if (_spinner->isOpen()) {
+ _spinner->tick();
+ _ambientSounds->tick();
+ return;
+ }
- if (_vk->isOpen()) {
- _vk->tick();
- _ambientSounds->tick();
- return;
- }
+ if (_esper->isOpen()) {
+ _esper->tick();
+ return;
+ }
- if (_elevator->isOpen()) {
- _elevator->tick();
- _ambientSounds->tick();
- return;
- }
+ if (_vk->isOpen()) {
+ _vk->tick();
+ _ambientSounds->tick();
+ return;
+ }
- if (_scores->isOpen()) {
- _scores->tick();
- _ambientSounds->tick();
- return;
- }
+ if (_elevator->isOpen()) {
+ _elevator->tick();
+ _ambientSounds->tick();
+ return;
+ }
- _actorDialogueQueue->tick();
- if (_scene->didPlayerWalkIn()) {
- _sceneScript->playerWalkedIn();
- }
- bool inDialogueMenu = _dialogueMenu->isVisible();
- if (!inDialogueMenu) {
- for (int i = 0; i < (int)_gameInfo->getActorCount(); ++i) {
- _actors[i]->tickCombat();
- }
- }
+ if (_scores->isOpen()) {
+ _scores->tick();
+ _ambientSounds->tick();
+ return;
+ }
- _policeMaze->tick();
+ _actorDialogueQueue->tick();
+ if (_scene->didPlayerWalkIn()) {
+ _sceneScript->playerWalkedIn();
+ }
- // TODO: Gun range announcements
- _zbuffer->clean();
+ bool inDialogueMenu = _dialogueMenu->isVisible();
+ if (!inDialogueMenu) {
+ for (int i = 0; i < (int)_gameInfo->getActorCount(); ++i) {
+ _actors[i]->tickCombat();
+ }
+ }
- _ambientSounds->tick();
+ _policeMaze->tick();
- bool backgroundChanged = false;
- int frame = _scene->advanceFrame();
- if (frame >= 0) {
- _sceneScript->sceneFrameAdvanced(frame);
- backgroundChanged = true;
- }
- blit(_surfaceBack, _surfaceFront);
+ // TODO: Gun range announcements
+ _zbuffer->clean();
- _overlays->tick();
+ _ambientSounds->tick();
- if (!inDialogueMenu) {
- actorsUpdate();
- }
+ bool backgroundChanged = false;
+ int frame = _scene->advanceFrame();
+ if (frame >= 0) {
+ _sceneScript->sceneFrameAdvanced(frame);
+ backgroundChanged = true;
+ }
+ blit(_surfaceBack, _surfaceFront);
- if (_settings->getNewScene() == -1 || _sceneScript->isInsideScript() || _aiScripts->isInsideScript()) {
- _sliceRenderer->setView(_view);
-
- // Tick and draw all actors in current set
- int setId = _scene->getSetId();
- for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) {
- if (_actors[i]->getSetId() == setId) {
- Common::Rect screenRect;
- if (_actors[i]->tick(backgroundChanged, &screenRect)) {
- _zbuffer->mark(screenRect);
- }
- }
- }
+ _overlays->tick();
- _items->tick();
+ if (!inDialogueMenu) {
+ actorsUpdate();
+ }
- _itemPickup->tick();
- _itemPickup->draw();
+ if (_settings->getNewScene() != -1 && !_sceneScript->isInsideScript() && !_aiScripts->isInsideScript()) {
+ return;
+ }
- Common::Point p = getMousePos();
+ _sliceRenderer->setView(_view);
- if (_dialogueMenu->isVisible()) {
- _dialogueMenu->tick(p.x, p.y);
- _dialogueMenu->draw(_surfaceFront);
+ // Tick and draw all actors in current set
+ int setId = _scene->getSetId();
+ for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) {
+ if (_actors[i]->getSetId() == setId) {
+ Common::Rect screenRect;
+ if (_actors[i]->tick(backgroundChanged, &screenRect)) {
+ _zbuffer->mark(screenRect);
}
+ }
+ }
- if (_debugger->_viewZBuffer) {
- _surfaceFront.copyRectToSurface(_zbuffer->getData(), 1280, 0, 0, 640, 480);
- }
+ _items->tick();
- _mouse->tick(p.x, p.y);
- _mouse->draw(_surfaceFront, p.x, p.y);
+ _itemPickup->tick();
+ _itemPickup->draw();
- // TODO: Process AUD
+ Common::Point p = getMousePos();
- if (_walkSoundId >= 0) {
- _audioPlayer->playAud(_gameInfo->getSfxTrack(_walkSoundId), _walkSoundVolume, _walkSoundBalance, _walkSoundBalance, 50, 0);
- _walkSoundId = -1;
- }
+ if (_dialogueMenu->isVisible()) {
+ _dialogueMenu->tick(p.x, p.y);
+ _dialogueMenu->draw(_surfaceFront);
+ }
- if (_debugger->_isDebuggerOverlay) {
- _debugger->drawDebuggerOverlay();
- }
+ if (_debugger->_viewZBuffer) {
+ _surfaceFront.copyRectToSurface(_zbuffer->getData(), 1280, 0, 0, 640, 480);
+ }
- if (_debugger->_viewObstacles) {
- _obstacles->draw();
- }
+ _mouse->tick(p.x, p.y);
+ _mouse->draw(_surfaceFront, p.x, p.y);
- _subtitles->tick(_surfaceFront);
+ // TODO: Process AUD
- blitToScreen(_surfaceFront);
- _system->delayMillis(10);
- }
+ if (_walkSoundId >= 0) {
+ _audioPlayer->playAud(_gameInfo->getSfxTrack(_walkSoundId), _walkSoundVolume, _walkSoundBalance, _walkSoundBalance, 50, 0);
+ _walkSoundId = -1;
}
+
+ if (_debugger->_isDebuggerOverlay) {
+ _debugger->drawDebuggerOverlay();
+ }
+
+ if (_debugger->_viewObstacles) {
+ _obstacles->draw();
+ }
+
+ _subtitles->tick(_surfaceFront);
+
+ blitToScreen(_surfaceFront);
+ _system->delayMillis(10);
}
void BladeRunnerEngine::actorsUpdate() {
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 3901347553..bef9b23e8f 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -1275,7 +1275,7 @@ enum AnimationModes {
kAnimationModeDie = 48,
kAnimationModeCombatDie = 49,
kAnimationModeFeeding = 52,
- kAnimationModeSit = 53, // TODO: check
+ kAnimationModeSit = 53,
kAnimationModeClimbUp = 64,
kAnimationModeClimbDown = 65,
kAnimationModeCombatClimbUp = 66,
diff --git a/engines/bladerunner/outtake.cpp b/engines/bladerunner/outtake.cpp
index d4171de3db..f37729fc9b 100644
--- a/engines/bladerunner/outtake.cpp
+++ b/engines/bladerunner/outtake.cpp
@@ -72,6 +72,10 @@ void OuttakePlayer::play(const Common::String &name, bool noLocalization, int co
while (!_vm->_vqaStopIsRequested && !_vm->shouldQuit()) {
_vm->handleEvents();
+ if (!_vm->_windowIsActive) {
+ continue;
+ }
+
int frame = vqaPlayer.update();
blit(_surfaceVideo, _vm->_surfaceFront); // This helps to make subtitles disappear properly, if the video is rendered in separate surface and then pushed to the front surface
if (frame == -3) { // end of video
diff --git a/engines/bladerunner/ui/elevator.cpp b/engines/bladerunner/ui/elevator.cpp
index 759c0e7cb6..a5e0c65fdd 100644
--- a/engines/bladerunner/ui/elevator.cpp
+++ b/engines/bladerunner/ui/elevator.cpp
@@ -204,7 +204,7 @@ int Elevator::handleMouseDown(int x, int y) {
}
void Elevator::tick() {
- if (!_vm->_gameIsRunning) {
+ if (!_vm->_windowIsActive) {
return;
}
@@ -283,8 +283,6 @@ void Elevator::buttonFocus(int buttonId) {
void Elevator::setupDescription(int actorId, int sentenceId) {
_actorId = actorId;
_sentenceId = sentenceId;
-
- // TODO: Use proper timer
_timeSpeakDescription = _vm->_time->current() + 600;
}
diff --git a/engines/bladerunner/ui/end_credits.cpp b/engines/bladerunner/ui/end_credits.cpp
index 096f8988bb..0fc97d09be 100644
--- a/engines/bladerunner/ui/end_credits.cpp
+++ b/engines/bladerunner/ui/end_credits.cpp
@@ -105,7 +105,7 @@ void EndCredits::show() {
//soundSystem::tick(SoundSystem);
_vm->handleEvents();
- if (!_vm->_gameIsRunning) {
+ if (!_vm->_windowIsActive) {
timeLast = _vm->getTotalPlayTime(); // Original game is using system timer
continue;
diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp
index 791dd273ab..51e956cbb2 100644
--- a/engines/bladerunner/ui/esper.cpp
+++ b/engines/bladerunner/ui/esper.cpp
@@ -208,7 +208,7 @@ void ESPER::handleMouseDown(int x, int y, bool mainButton) {
}
void ESPER::tick() {
- if (!_vm->_gameIsRunning) {
+ if (!_vm->_windowIsActive) {
return;
}
diff --git a/engines/bladerunner/ui/scores.cpp b/engines/bladerunner/ui/scores.cpp
index 3879d81c4e..3134299a1d 100644
--- a/engines/bladerunner/ui/scores.cpp
+++ b/engines/bladerunner/ui/scores.cpp
@@ -95,7 +95,7 @@ void Scores::close() {
_vm->closeArchive("MODE.MIX");
- // TODO: Unfreeze game time
+ _vm->_time->resume();
_vm->_scene->resume();
}
@@ -129,7 +129,7 @@ int Scores::handleMouseDown(int x, int y) {
}
void Scores::tick() {
- if (!_vm->_gameIsRunning) {
+ if (!_vm->_windowIsActive) {
return;
}
diff --git a/engines/bladerunner/ui/spinner.cpp b/engines/bladerunner/ui/spinner.cpp
index 32809e8740..eb3b1977f8 100644
--- a/engines/bladerunner/ui/spinner.cpp
+++ b/engines/bladerunner/ui/spinner.cpp
@@ -29,8 +29,9 @@
#include "bladerunner/scene.h"
#include "bladerunner/shape.h"
#include "bladerunner/text_resource.h"
-#include "bladerunner/vqa_player.h"
+#include "bladerunner/time.h"
#include "bladerunner/ui/ui_image_picker.h"
+#include "bladerunner/vqa_player.h"
#include "common/rect.h"
#include "common/system.h"
@@ -155,7 +156,8 @@ int Spinner::chooseDestination(int loopId, bool immediately) {
this
);
- // TODO: Freeze game time
+ _vm->_time->pause();
+
_selectedDestination = -1;
do {
_vm->gameTick();
@@ -176,7 +178,7 @@ int Spinner::chooseDestination(int loopId, bool immediately) {
_isOpen = false;
- // TODO: Unfreeze game time
+ _vm->_time->resume();
_vm->_scene->resume();
return _selectedDestination;
@@ -207,7 +209,7 @@ int Spinner::handleMouseDown(int x, int y) {
}
void Spinner::tick() {
- if (!_vm->_gameIsRunning) {
+ if (!_vm->_windowIsActive) {
return;
}
diff --git a/engines/bladerunner/ui/vk.cpp b/engines/bladerunner/ui/vk.cpp
index 031ba3b093..ab2b5de221 100644
--- a/engines/bladerunner/ui/vk.cpp
+++ b/engines/bladerunner/ui/vk.cpp
@@ -34,14 +34,14 @@
#include "bladerunner/mouse.h"
#include "bladerunner/music.h"
#include "bladerunner/scene.h"
-#include "bladerunner/shape.h"
#include "bladerunner/script/vk_script.h"
+#include "bladerunner/shape.h"
#include "bladerunner/slice_renderer.h"
+#include "bladerunner/subtitles.h"
#include "bladerunner/text_resource.h"
#include "bladerunner/time.h"
#include "bladerunner/ui/ui_image_picker.h"
#include "bladerunner/vqa_player.h"
-#include "bladerunner/subtitles.h"
#include "common/str.h"
#include "common/keyboard.h"
@@ -128,7 +128,7 @@ void VK::open(int actorId, int calibrationRatio) {
_script = new VKScript(_vm);
- //TODO: time->lock()
+ _vm->_time->pause();
init();
}
@@ -184,7 +184,7 @@ void VK::close() {
_vm->_music->setVolume(_volumeMusic);
_vm->_ambientSounds->setVolume(_volumeAmbient);
- // TODO: time->unlock();
+ _vm->_time->resume();
_vm->_scene->resume();
}
@@ -472,7 +472,7 @@ void VK::init() {
}
void VK::draw() {
- if (!_isOpen || !_vm->_gameIsRunning) {
+ if (!_isOpen || !_vm->_windowIsActive) {
return;
}
@@ -895,7 +895,7 @@ void VK::askQuestion(int intensity) {
for (int i = 0; i < (int)_questions[intensity].size(); ++i) {
if (_questions[intensity][i].isPresent && !_questions[intensity][i].wasAsked) {
- // TODO: related questions are not used in game
+ // cut content? related questions are not used in game
// int relatedQuestion = -1;
// if (_questions[intensity][i].relatedSentenceId >= 0) {
// relatedQuestion = vk::findQuestionById(this, questions, relatedQuestionId);