From cfc8ffed8af71714cc6378b412557d5fc03781d4 Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Tue, 20 Sep 2016 00:33:06 +0200 Subject: BLADERUNNER: fixed exit selection, added footstep sounds, added some debugging display (scene objects, regions, exits, walkboxes, lights?) --- engines/bladerunner/script/rc01.cpp | 4 +++ engines/bladerunner/script/script.cpp | 55 ++++++++++++++++++++++++++--------- 2 files changed, 45 insertions(+), 14 deletions(-) (limited to 'engines/bladerunner/script') diff --git a/engines/bladerunner/script/rc01.cpp b/engines/bladerunner/script/rc01.cpp index 7b00b5f550..9d88d2dec3 100644 --- a/engines/bladerunner/script/rc01.cpp +++ b/engines/bladerunner/script/rc01.cpp @@ -25,10 +25,14 @@ namespace BladeRunner { void ScriptRC01::InitializeScene() { +#if _DEBUG //TODO: not part of game, remove Game_Flag_Set(24); // force skip intro // Game_Flag_Set(9); // Force flag 9 so McCoy will be in view + Footstep_Sound_Override_On(0); +#endif + if (!Game_Flag_Query(24)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 4ecec28753..50d56d566c 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -52,7 +52,13 @@ namespace BladeRunner { bool Script::open(const Common::String &name) { delete _currentScript; + if (name == "RC01") { _currentScript = new ScriptRC01(_vm); return true; } + if (name == "RC02") { _currentScript = new ScriptRC02(_vm); return true; } + if (name == "RC03") { _currentScript = new ScriptRC03(_vm); return true; } + if (name == "RC04") { _currentScript = new ScriptRC04(_vm); return true; } + if (name == "RC51") { _currentScript = new ScriptRC51(_vm); return true; } + return false; } @@ -792,40 +798,61 @@ void ScriptBase::Sound_Play_Speech_Line(int actorId, int speechId, int a3, int a } void ScriptBase::Sound_Left_Footstep_Walk(int actorId) { - //TODO - warning("Sound_Left_Footstep_Walk(%d)", actorId); + int walkboxId = _vm->_actors[actorId]->getWalkbox(); + if (walkboxId < 0) { + walkboxId = 0; + } + + _vm->_walkSoundId = _vm->_scene->_set->getWalkboxSoundWalkLeft(walkboxId); + _vm->_walkSoundVolume = _vm->_actors[actorId]->soundVolume(); + _vm->_walkSoundBalance = _vm->_actors[actorId]->soundBalance(); } void ScriptBase::Sound_Right_Footstep_Walk(int actorId) { - //TODO - warning("Sound_Right_Footstep_Walk(%d)", actorId); + int walkboxId = _vm->_actors[actorId]->getWalkbox(); + if (walkboxId < 0) { + walkboxId = 0; + } + + _vm->_walkSoundId = _vm->_scene->_set->getWalkboxSoundWalkRight(walkboxId); + _vm->_walkSoundVolume = _vm->_actors[actorId]->soundVolume(); + _vm->_walkSoundBalance = _vm->_actors[actorId]->soundBalance(); } void ScriptBase::Sound_Left_Footstep_Run(int actorId) { - //TODO - warning("Sound_Left_Footstep_Run(%d)", actorId); + int walkboxId = _vm->_actors[actorId]->getWalkbox(); + if (walkboxId < 0) { + walkboxId = 0; + } + + _vm->_walkSoundId = _vm->_scene->_set->getWalkboxSoundRunLeft(walkboxId); + _vm->_walkSoundVolume = _vm->_actors[actorId]->soundVolume(); + _vm->_walkSoundBalance = _vm->_actors[actorId]->soundBalance(); } void ScriptBase::Sound_Right_Footstep_Run(int actorId) { - //TODO - warning("Sound_Right_Footstep_Run(%d)", actorId); + int walkboxId = _vm->_actors[actorId]->getWalkbox(); + if (walkboxId < 0) { + walkboxId = 0; + } + + _vm->_walkSoundId = _vm->_scene->_set->getWalkboxSoundRunRight(walkboxId); + _vm->_walkSoundVolume = _vm->_actors[actorId]->soundVolume(); + _vm->_walkSoundBalance = _vm->_actors[actorId]->soundBalance(); } // ScriptBase::Sound_Walk_Shuffle_Stop void ScriptBase::Footstep_Sounds_Set(int walkboxId, int stepSound) { - //TODO - warning("Footstep_Sounds_Set(%d, %d)", walkboxId, stepSound); + _vm->_scene->_set->setWalkboxStepSound(walkboxId, stepSound); } void ScriptBase::Footstep_Sound_Override_On(int footstepSoundOverride) { - //TODO - warning("Footstep_Sound_Override_On(%d)", footstepSoundOverride); + _vm->_scene->_set->setFoodstepSoundOverride(footstepSoundOverride); } void ScriptBase::Footstep_Sound_Override_Off() { - //TODO - warning("Footstep_Sound_Override_Off()"); + _vm->_scene->_set->resetFoodstepSoundOverride(); } bool ScriptBase::Music_Play(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { -- cgit v1.2.3