aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorPeter Kohaut2017-08-24 23:43:47 +0200
committerPeter Kohaut2017-08-24 23:43:47 +0200
commit0da18320af79b6ca8a47248442d106674b5ab860 (patch)
tree504d769edcf92fc4cbceddfbcdda038ecc040ced /engines/bladerunner/script
parentc9b4089ccb0b60389446e07f7f9421e3a7180129 (diff)
downloadscummvm-rg350-0da18320af79b6ca8a47248442d106674b5ab860.tar.gz
scummvm-rg350-0da18320af79b6ca8a47248442d106674b5ab860.tar.bz2
scummvm-rg350-0da18320af79b6ca8a47248442d106674b5ab860.zip
BLADERUNNER: Added audio mixer & various fixes
Audio mixer is supporting fading and pan animation Added support for skipping speech by pressing Return Added proper support for ambient sounds Added more code to the dialogue menu Added tooltips to the Spinner Fixed calculation of volume and pan of walk steps Code cleanup & formatting
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/init.cpp20
-rw-r--r--engines/bladerunner/script/script.cpp74
-rw-r--r--engines/bladerunner/script/script.h28
3 files changed, 57 insertions, 65 deletions
diff --git a/engines/bladerunner/script/init.cpp b/engines/bladerunner/script/init.cpp
index 76f68edee3..ed1140582d 100644
--- a/engines/bladerunner/script/init.cpp
+++ b/engines/bladerunner/script/init.cpp
@@ -2642,16 +2642,16 @@ void ScriptInit::Init_CDB() {
}
void ScriptInit::Init_Spinner() {
- Spinner_Set_Selectable_Destination_Flag(0, 1);
- Spinner_Set_Selectable_Destination_Flag(1, 1);
- Spinner_Set_Selectable_Destination_Flag(2, 1);
- Spinner_Set_Selectable_Destination_Flag(3, 0);
- Spinner_Set_Selectable_Destination_Flag(4, 0);
- Spinner_Set_Selectable_Destination_Flag(5, 0);
- Spinner_Set_Selectable_Destination_Flag(6, 0);
- Spinner_Set_Selectable_Destination_Flag(7, 0);
- Spinner_Set_Selectable_Destination_Flag(8, 0);
- Spinner_Set_Selectable_Destination_Flag(9, 0);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationPoliceStation, true);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationMcCoysApartment, true);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationRuncitersAnimals, true);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationChinatown, false);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationAnimoidRow, false);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationTyrellBuilding, false);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationDNARow, false);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationBradburyBuilding, false);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationNightclubRow, false);
+ Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationHysteriaHall, false);
}
void ScriptInit::Init_Actor_Friendliness() {
diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp
index c4352706f5..72f4e50a53 100644
--- a/engines/bladerunner/script/script.cpp
+++ b/engines/bladerunner/script/script.cpp
@@ -22,14 +22,13 @@
#include "bladerunner/script/script.h"
-#include "bladerunner/bladerunner.h"
-
#include "bladerunner/actor.h"
#include "bladerunner/actor_combat.h"
#include "bladerunner/adq.h"
#include "bladerunner/ambient_sounds.h"
#include "bladerunner/audio_player.h"
#include "bladerunner/audio_speech.h"
+#include "bladerunner/bladerunner.h"
#include "bladerunner/crimes_database.h"
#include "bladerunner/combat.h"
#include "bladerunner/dialogue_menu.h"
@@ -39,6 +38,8 @@
#include "bladerunner/items.h"
#include "bladerunner/item_pickup.h"
#include "bladerunner/movement_track.h"
+#include "bladerunner/regions.h"
+#include "bladerunner/set.h"
#include "bladerunner/settings.h"
#include "bladerunner/set_effects.h"
#include "bladerunner/scene.h"
@@ -46,6 +47,7 @@
#include "bladerunner/slice_animations.h"
#include "bladerunner/slice_renderer.h"
#include "bladerunner/spinner.h"
+#include "bladerunner/suspects_database.h"
#include "bladerunner/text_resource.h"
#include "bladerunner/vector.h"
#include "bladerunner/waypoints.h"
@@ -499,7 +501,7 @@ bool ScriptBase::Loop_Actor_Walk_To_XYZ(int actorId, float x, float y, float z,
//TODO:
//PlayerActorIdle = 0;
bool isRunning;
- bool result = _vm->_actors[actorId]->loopWalkToXYZ(Vector3(x, y, z), destinationOffset, a5, run, 1, &isRunning);
+ bool result = _vm->_actors[actorId]->loopWalkToXYZ(Vector3(x, y, z), destinationOffset, a5, run, true, &isRunning);
// if (PlayerActorIdle == 1) {
// result = 1;
@@ -829,12 +831,12 @@ void ScriptBase::Scene_Loop_Set_Default(int loopId) {
_vm->_scene->loopSetDefault(loopId);
}
-void ScriptBase::Scene_Loop_Start_Special(int sceneLoopMode, int loopId, int c) {
- if (sceneLoopMode == 1) {
- c = 1;
+void ScriptBase::Scene_Loop_Start_Special(int sceneLoopMode, int loopId, bool immediately) {
+ if (sceneLoopMode == kSceneLoopModeChangeSet) {
+ immediately = true;
}
- _vm->_scene->loopStartSpecial(sceneLoopMode, loopId, c);
- if (sceneLoopMode == 1) {
+ _vm->_scene->loopStartSpecial(sceneLoopMode, loopId, immediately);
+ if (sceneLoopMode == kSceneLoopModeChangeSet) {
_vm->_settings->clearNewSetAndScene();
}
}
@@ -843,54 +845,44 @@ void ScriptBase::Outtake_Play(int id, int noLocalization, int container) {
_vm->outtakePlay(id, noLocalization, container);
}
-void ScriptBase::Ambient_Sounds_Add_Sound(int id, int time1, int time2, int volume1, int volume2, int pan1begin, int pan1end, int pan2begin, int pan2end, int priority, int unk) {
- _vm->_ambientSounds->addSound(id, time1, time2, volume1, volume2, pan1begin, pan1end, pan2begin, pan2end, priority, unk);
+void ScriptBase::Ambient_Sounds_Add_Sound(int sfxId, int timeMin, int timeMax, int volumeMin, int volumeMax, int panStartMin, int panStartMax, int panEndMin, int panEndMax, int priority, int unk) {
+ _vm->_ambientSounds->addSound(sfxId, timeMin, timeMax, volumeMin, volumeMax, panStartMin, panStartMax, panEndMin, panEndMax, priority, unk);
}
-void ScriptBase::Ambient_Sounds_Remove_Sound(int id, bool a2) {
- //TODO
- warning("Ambient_Sounds_Remove_Sound(%d, %d)", id, a2);
+void ScriptBase::Ambient_Sounds_Remove_Sound(int sfxId, bool stopPlaying) {
+ _vm->_ambientSounds->removeNonLoopingSound(sfxId, stopPlaying);
}
-void ScriptBase::Ambient_Sounds_Add_Speech_Sound(int id, int unk1, int time1, int time2, int volume1, int volume2, int pan1begin, int pan1end, int pan2begin, int pan2end, int priority, int unk2){
- //TODO
- warning("Ambient_Sounds_Add_Speech_Sound(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", id, unk1, time1, time2, volume1, volume2, pan1begin, pan1end, pan2begin, pan2end, priority, unk2);
+void ScriptBase::Ambient_Sounds_Add_Speech_Sound(int actorId, int sentenceId, int timeMin, int timeMax, int volumeMin, int volumeMax, int panStartMin, int panStartMax, int panEndMin, int panEndMax, int priority, int unk){
+ _vm->_ambientSounds->addSpeech(actorId, sentenceId, timeMin, timeMax, volumeMin, volumeMax, panStartMin, panStartMax, panEndMin, panEndMax, priority, unk);
}
// ScriptBase::Ambient_Sounds_Remove_Speech_Sound
-int ScriptBase::Ambient_Sounds_Play_Sound(int a1, int a2, int a3, int a4, int a5) {
- //TODO
- warning("Ambient_Sounds_Remove_Sound(%d, %d, %d, %d, %d)", a1, a2, a3, a4, a5);
- return -1;
+void ScriptBase::Ambient_Sounds_Play_Sound(int sfxId, int volume, int panStart, int panEnd, int priority) {
+ _vm->_ambientSounds->playSound(sfxId, volume, panStart, panEnd, priority);
}
// ScriptBase::Ambient_Sounds_Play_Speech_Sound
-void ScriptBase::Ambient_Sounds_Remove_All_Non_Looping_Sounds(int time) {
- //TODO
- warning("Ambient_Sounds_Remove_All_Non_Looping_Sounds(%d)", time);
- // _vm->_ambientSounds->removeAllNonLoopingSounds(time);
+void ScriptBase::Ambient_Sounds_Remove_All_Non_Looping_Sounds(bool stopPlaying) {
+ _vm->_ambientSounds->removeAllNonLoopingSounds(stopPlaying);
}
-void ScriptBase::Ambient_Sounds_Add_Looping_Sound(int id, int volume, int pan, int fadeInTime) {
- _vm->_ambientSounds->addLoopingSound(id, volume, pan, fadeInTime);
+void ScriptBase::Ambient_Sounds_Add_Looping_Sound(int sfxId, int volume, int pan, int delay) {
+ _vm->_ambientSounds->addLoopingSound(sfxId, volume, pan, delay);
}
-void ScriptBase::Ambient_Sounds_Adjust_Looping_Sound(int id, int panBegin, int panEnd, int a4) {
- //TODO
- warning("Ambient_Sounds_Adjust_Looping_Sound(%d, %d, %d, %d)", id, panBegin, panEnd, a4);
+void ScriptBase::Ambient_Sounds_Adjust_Looping_Sound(int sfxId, int volume, int pan, int delay) {
+ _vm->_ambientSounds->adjustLoopingSound(sfxId, volume, pan, delay);
}
-void ScriptBase::Ambient_Sounds_Remove_Looping_Sound(int id, bool a2){
- //TODO
- warning("Ambient_Sounds_Remove_Looping_Sound(%d, %d)", id, a2);
+void ScriptBase::Ambient_Sounds_Remove_Looping_Sound(int sfxId, int delay){
+ _vm->_ambientSounds->removeLoopingSound(sfxId, delay);
}
-void ScriptBase::Ambient_Sounds_Remove_All_Looping_Sounds(int time) {
- //TODO
- warning("Ambient_Sounds_Remove_All_Looping_Sounds(%d)", time);
- // _vm->_ambientSounds->removeAllLoopingSounds(time);
+void ScriptBase::Ambient_Sounds_Remove_All_Looping_Sounds(int delay) {
+ _vm->_ambientSounds->removeAllLoopingSounds(delay);
}
void ScriptBase::Setup_Scene_Information(float actorX, float actorY, float actorZ, int actorFacing) {
@@ -1067,14 +1059,14 @@ bool ScriptBase::SDB_Add_Other_Clue(int suspectId, int clueId) {
return _vm->_suspectsDatabase->get(suspectId)->addOtherClue(clueId);
}
-void ScriptBase::Spinner_Set_Selectable_Destination_Flag(int a1, int a2) {
- _vm->_spinner->setSelectableDestinationFlag(a1, a2);
+void ScriptBase::Spinner_Set_Selectable_Destination_Flag(int destination, bool selectable) {
+ _vm->_spinner->setSelectableDestinationFlag(destination, selectable);
}
// ScriptBase::Spinner_Query_Selectable_Destination_Flag
-int ScriptBase::Spinner_Interface_Choose_Dest(int a1, int a2) {
- return _vm->_spinner->interfaceChooseDest(a1, a2);
+int ScriptBase::Spinner_Interface_Choose_Dest(int loopId, bool immediately) {
+ return _vm->_spinner->chooseDestination(loopId, immediately);
}
void ScriptBase::ESPER_Flag_To_Activate() {
@@ -1131,7 +1123,7 @@ void ScriptBase::Actor_Retired_Here(int actorId, int width, int height, int reti
Vector3 actorPosition;
actor->getXYZ(&actorPosition.x, &actorPosition.y, &actorPosition.z);
actor->retire(retired, width, height, retiredByActorId);
- actor->setAtXYZ(actorPosition, actor->getFacing(), true, 0, true);
+ actor->setAtXYZ(actorPosition, actor->getFacing(), true, false, true);
_vm->_sceneObjects->setRetired(actorId + SCENE_OBJECTS_ACTORS_OFFSET, true);
}
diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h
index 61cee3aa9b..c282bccd1d 100644
--- a/engines/bladerunner/script/script.h
+++ b/engines/bladerunner/script/script.h
@@ -567,20 +567,20 @@ protected:
bool Music_Is_Playing();
void Overlay_Play(const char *overlay, int a2, int a3, int a4, int a5);
void Overlay_Remove(const char *overlay);
- void Scene_Loop_Set_Default(int);
- void Scene_Loop_Start_Special(int, int, int);
+ void Scene_Loop_Set_Default(int loopId);
+ void Scene_Loop_Start_Special(int sceneLoopMode, int loopId, bool immediately);
void Outtake_Play(int id, int noLocalization = false, int container = -1);
- void Ambient_Sounds_Add_Sound(int id, int time1, int time2, int volume1, int volume2, int pan1begin, int pan1end, int pan2begin, int pan2end, int priority, int unk);
- void Ambient_Sounds_Remove_Sound(int id, bool a2);
- void Ambient_Sounds_Add_Speech_Sound(int id, int unk1, int time1, int time2, int volume1, int volume2, int pan1begin, int pan1end, int pan2begin, int pan2end, int priority, int unk2);
+ void Ambient_Sounds_Add_Sound(int sfxId, int timeMin, int timeMax, int volumeMin, int volumeMax, int panStartMin, int panStartMax, int panEndMin, int panEndMax, int priority, int unk);
+ void Ambient_Sounds_Remove_Sound(int sfxId, bool stopPlaying);
+ void Ambient_Sounds_Add_Speech_Sound(int actorId, int sentenceId, int timeMin, int timeMax, int volumeMin, int volumeMax, int panStartMin, int panStartMax, int panEndMin, int panEndMax, int priority, int unk);
// Ambient_Sounds_Remove_Speech_Sound
- int Ambient_Sounds_Play_Sound(int a1, int a2, int a3, int a4, int a5);
+ void Ambient_Sounds_Play_Sound(int sfxId, int volume, int panStart, int panEnd, int priority);
// Ambient_Sounds_Play_Speech_Sound
- void Ambient_Sounds_Remove_All_Non_Looping_Sounds(int time);
- void Ambient_Sounds_Add_Looping_Sound(int id, int volume, int pan, int fadeInTime);
- void Ambient_Sounds_Adjust_Looping_Sound(int id, int panBegin, int panEnd, int a4);
- void Ambient_Sounds_Remove_Looping_Sound(int id, bool a2);
- void Ambient_Sounds_Remove_All_Looping_Sounds(int time);
+ void Ambient_Sounds_Remove_All_Non_Looping_Sounds(bool stopPlaying);
+ void Ambient_Sounds_Add_Looping_Sound(int sfxId, int volume, int pan, int delay);
+ void Ambient_Sounds_Adjust_Looping_Sound(int sfxId, int volume, int pan, int delay);
+ void Ambient_Sounds_Remove_Looping_Sound(int sfxId, int delay);
+ void Ambient_Sounds_Remove_All_Looping_Sounds(int delay);
void Setup_Scene_Information(float actorX, float actorY, float actorZ, int actorFacing);
bool Dialogue_Menu_Appear(int x, int y);
bool Dialogue_Menu_Disappear();
@@ -625,9 +625,9 @@ protected:
bool SDB_Add_Replicant_Clue(int suspectId, int clueId);
bool SDB_Add_Non_Replicant_Clue(int suspectId, int clueId);
bool SDB_Add_Other_Clue(int suspectId, int clueId);
- void Spinner_Set_Selectable_Destination_Flag(int a1, int a2);
- // Spinner_Query_Selectable_Destination_Flag
- int Spinner_Interface_Choose_Dest(int a1, int a2);
+ void Spinner_Set_Selectable_Destination_Flag(int destination, bool selectable);
+ // Spinner_Query_Selectable_Destination_Flag(int destination);
+ int Spinner_Interface_Choose_Dest(int loopId, bool immediately);
void ESPER_Flag_To_Activate();
bool Voight_Kampff_Activate(int a1, int a2);
int Elevator_Activate(int elevatorId);