From cfa649d7ac04ea087537f03da9a59b1c5aedcdb2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 23 Jun 2018 16:01:43 +0200 Subject: MOHAWK: RIVEN: Restrict new menu to 25th Anniversary games --- engines/mohawk/detection_tables.h | 16 ++++++++-------- engines/mohawk/mohawk.h | 6 +++--- engines/mohawk/riven.cpp | 2 +- engines/mohawk/riven_card.cpp | 3 +++ engines/mohawk/riven_scripts.cpp | 3 ++- engines/mohawk/riven_stacks/aspit.cpp | 3 +++ 6 files changed, 20 insertions(+), 13 deletions(-) (limited to 'engines') diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 213bbb0723..0c3eceba1a 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -657,7 +657,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -678,7 +678,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -699,7 +699,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -720,7 +720,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -741,7 +741,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -762,7 +762,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -783,7 +783,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, @@ -804,7 +804,7 @@ static const MohawkGameDescription gameDescriptions[] = { GUI_OPTIONS_RIVEN }, GType_RIVEN, - GF_DVD, + GF_DVD | GF_25TH, 0, }, diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index 3a50a2a14d..ad4ff7b3f0 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -58,11 +58,11 @@ enum MohawkGameType { }; enum MohawkGameFeatures { - GF_ME = (1 << 0), // Myst Masterpiece Edition - GF_25TH = (1 << 1), // Myst Masterpiece Edition - 25th Anniversary + GF_ME = (1 << 0), // Myst Masterpiece Edition + GF_25TH = (1 << 1), // Myst and Riven 25th Anniversary GF_DVD = (1 << 2), GF_DEMO = (1 << 3), - GF_LB_10 = (1 << 4) // very early Living Books 1.0 games + GF_LB_10 = (1 << 4) // very early Living Books 1.0 games }; struct MohawkGameDescription; diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index bbfd139960..a3a71f839b 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -277,7 +277,7 @@ void MohawkEngine_Riven::doFrame() { } break; case Common::KEYCODE_ESCAPE: - if (!_scriptMan->hasQueuedScripts()) { + if (!_scriptMan->hasQueuedScripts() && getFeatures() & GF_25TH) { // Check if we haven't jumped to menu if (_menuSavedStack == -1) { goToMainMenu(); diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp index 6ef833f112..92ed379779 100644 --- a/engines/mohawk/riven_card.cpp +++ b/engines/mohawk/riven_card.cpp @@ -393,6 +393,9 @@ void RivenCard::applyPropertiesPatch22118(uint32 globalId) { } void RivenCard::applyPropertiesPatchE2E(uint32 globalId) { + if (!(_vm->getFeatures() & GF_25TH)) + return; + // The main menu in the Myst 25th anniversary version is patched to include new items: // - Save game if (globalId == 0xE2E) { diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index a2dd69d49a..3547302c88 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -366,7 +366,8 @@ void RivenScript::applyCardPatches(MohawkEngine_Riven *vm, uint32 cardGlobalId, // Override the main menu new game script to call an external command. // This way we can reset all the state when starting a new game while a game is already started. - if (cardGlobalId == 0xE2E && scriptType == kMouseDownScript && hotspotId == 16) { + if (cardGlobalId == 0xE2E && scriptType == kMouseDownScript && hotspotId == 16 + && (vm->getFeatures() & GF_25TH)) { shouldApplyPatches = true; _commands.clear(); diff --git a/engines/mohawk/riven_stacks/aspit.cpp b/engines/mohawk/riven_stacks/aspit.cpp index 3729a1710d..b6cd17bf22 100644 --- a/engines/mohawk/riven_stacks/aspit.cpp +++ b/engines/mohawk/riven_stacks/aspit.cpp @@ -90,6 +90,9 @@ void ASpit::xastartupbtnhide(const ArgumentArray &args) { // The original game hides the start/setup buttons depending on an ini entry. // It's safe to ignore this command. + if (!(_vm->getFeatures() & GF_25TH)) + return; + Common::File file; const char *fontname; -- cgit v1.2.3