diff options
author | Peter Kohaut | 2018-01-31 00:37:19 +0100 |
---|---|---|
committer | Peter Kohaut | 2018-02-04 17:34:43 +0100 |
commit | 6e9a340640686fe7dd95efbea34cbf3b7f4209af (patch) | |
tree | fe0adec0b85f3e2b387097c4378ce8337b731460 /engines/bladerunner/script | |
parent | 0300979bdd8d2ca451110d77cb8e05c84365bbec (diff) | |
download | scummvm-rg350-6e9a340640686fe7dd95efbea34cbf3b7f4209af.tar.gz scummvm-rg350-6e9a340640686fe7dd95efbea34cbf3b7f4209af.tar.bz2 scummvm-rg350-6e9a340640686fe7dd95efbea34cbf3b7f4209af.zip |
BLADERUNNER: ESPER interface
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/esper.cpp | 21 | ||||
-rw-r--r-- | engines/bladerunner/script/esper.h | 9 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/rc01.cpp | 5 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 19 | ||||
-rw-r--r-- | engines/bladerunner/script/script.h | 2 |
5 files changed, 41 insertions, 15 deletions
diff --git a/engines/bladerunner/script/esper.cpp b/engines/bladerunner/script/esper.cpp index ca779d6e3d..e6c0390cbb 100644 --- a/engines/bladerunner/script/esper.cpp +++ b/engines/bladerunner/script/esper.cpp @@ -23,9 +23,28 @@ #include "bladerunner/script/esper.h" #include "bladerunner/bladerunner.h" +#include "bladerunner/mouse.h" namespace BladeRunner { +void ESPERScript::initialize() { + _vm->_mouse->disable(); + SCRIPT_ESPER_DLL_Initialize(); + _vm->_mouse->enable(); +} + +void ESPERScript::photoSelected(int photoId) { + _vm->_mouse->disable(); + SCRIPT_ESPER_DLL_Photo_Selected(photoId); + _vm->_mouse->enable(); +} + +void ESPERScript::specialRegionSelected(int photoId, int regionId) { + _vm->_mouse->disable(); + SCRIPT_ESPER_DLL_Special_Region_Selected(photoId, regionId); + _vm->_mouse->enable(); +} + void ESPERScript::SCRIPT_ESPER_DLL_Initialize() { int v0 = 0; if (Actor_Clue_Query(kActorMcCoy, kClueRuncitersVideo)) { @@ -39,7 +58,7 @@ void ESPERScript::SCRIPT_ESPER_DLL_Initialize() { if (!Actor_Clue_Query(kActorMcCoy, kClueRuncitersViewB)) { Actor_Clue_Acquire(kActorMcCoy, kClueRuncitersViewB, 1, kActorRunciter); } - ESPER_Add_Photo("RC02_FA.IMG", 1, 1); + ESPER_Add_Photo("RC02_RA.IMG", 1, 1); } if (Actor_Clue_Query(kActorMcCoy, kClueEarlyQsClub)) { if (!Actor_Clue_Query(kActorMcCoy, kClueOuterDressingRoom)) { diff --git a/engines/bladerunner/script/esper.h b/engines/bladerunner/script/esper.h index 683ecf6998..63e30e55e0 100644 --- a/engines/bladerunner/script/esper.h +++ b/engines/bladerunner/script/esper.h @@ -31,10 +31,13 @@ class BladeRunnerEngine; class ESPERScript : ScriptBase { public: - ESPERScript(BladeRunnerEngine *vm) - : ScriptBase(vm) { - } + ESPERScript(BladeRunnerEngine *vm) : ScriptBase(vm) {} + void initialize(); + void photoSelected(int photoId); + void specialRegionSelected(int photoId, int regionId); + +private: void SCRIPT_ESPER_DLL_Initialize(); void SCRIPT_ESPER_DLL_Photo_Selected(int photo); bool SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region); diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp index dd793ad440..347f0e8dcb 100644 --- a/engines/bladerunner/script/scene/rc01.cpp +++ b/engines/bladerunner/script/scene/rc01.cpp @@ -30,8 +30,9 @@ void SceneScriptRC01::InitializeScene() { Game_Flag_Set(kFlagIntroPlayed); // force skip intro Game_Flag_Set(kFlagRC02toRC01); // no landing // Game_Flag_Set(kFlagRC01PoliceDone); - // Game_Flag_Set(249); - Game_Flag_Set(kFlagKIAPrivacyAddon); + // Game_Flag_Set(kFlagKIAPrivacyAddon); + + // ESPER_Flag_To_Activate(); #endif if (!Game_Flag_Query(kFlagIntroPlayed)) { diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 91a755bb41..3c0c8e1866 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -50,6 +50,7 @@ #include "bladerunner/suspects_database.h" #include "bladerunner/text_resource.h" #include "bladerunner/ui/elevator.h" +#include "bladerunner/ui/esper.h" #include "bladerunner/ui/kia.h" #include "bladerunner/ui/spinner.h" #include "bladerunner/vector.h" @@ -1076,8 +1077,12 @@ int ScriptBase::Spinner_Interface_Choose_Dest(int loopId, bool immediately) { } void ScriptBase::ESPER_Flag_To_Activate() { - //TODO - warning("ESPER_Flag_To_Activate()"); + if (!_vm->_esper->isOpen()) { + _vm->_esper->open(&_vm->_surfaceBack); + while (_vm->_esper->isOpen()) { + _vm->gameTick(); + } + } } bool ScriptBase::Voight_Kampff_Activate(int a1, int a2){ @@ -1282,14 +1287,12 @@ void ScriptBase::KIA_Play_Photograph(int photographId) { _vm->_kia->playPhotograph(photographId); } -void ScriptBase::ESPER_Add_Photo(const char *fileName, int a2, int a3) { - //TODO - warning("ESPER_Add_Photo(%s, %d, %d)", fileName, a2, a3); +void ScriptBase::ESPER_Add_Photo(const char *name, int photoId, int shapeId) { + _vm->_esper->addPhoto(name, photoId, shapeId); } -void ScriptBase::ESPER_Define_Special_Region(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, const char *name) { - //TODO - warning("ESPER_Define_Special_Region(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s)", a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, name); +void ScriptBase::ESPER_Define_Special_Region(int regionId, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, const char *name) { + _vm->_esper->defineRegion(regionId, Common::Rect(a2, a3, a4, a5), Common::Rect(a6, a7, a8, a9), Common::Rect(a10, a11, a12, a13), name); } void ScriptBase::VK_Add_Question(int a1, int a2, int a3) { diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index dabdec6b59..574f3a8f65 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -272,7 +272,7 @@ protected: void AI_Movement_Track_Append(int actorId, int waypointId, int delay); void AI_Movement_Track_Flush(int actorId); - void ESPER_Add_Photo(const char *fileName, int a2, int a3); + void ESPER_Add_Photo(const char *name, int photoId, int shapeId); void ESPER_Define_Special_Region(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, const char *name); void KIA_Play_Actor_Dialogue(int actorId, int sentenceId); |