[Scummvm-git-logs] scummvm master -> b9c7730a167ce7e7db5b843b2beb6e4df2de9cf6

elasota noreply at scummvm.org
Mon May 8 00:09:33 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b9c7730a16 VCRUISE: Fix detection of German version and detect it separate from English version.


Commit: b9c7730a167ce7e7db5b843b2beb6e4df2de9cf6
    https://github.com/scummvm/scummvm/commit/b9c7730a167ce7e7db5b843b2beb6e4df2de9cf6
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-07T20:09:13-04:00

Commit Message:
VCRUISE: Fix detection of German version and detect it separate from English version.

Changed paths:
    engines/vcruise/detection.cpp
    engines/vcruise/detection.h
    engines/vcruise/detection_tables.h
    engines/vcruise/runtime.cpp
    engines/vcruise/runtime.h
    engines/vcruise/vcruise.cpp


diff --git a/engines/vcruise/detection.cpp b/engines/vcruise/detection.cpp
index b42a723838a..01b79a60039 100644
--- a/engines/vcruise/detection.cpp
+++ b/engines/vcruise/detection.cpp
@@ -28,20 +28,26 @@
 
 #include "vcruise/detection.h"
 
-static const PlainGameDescriptor vCruiseGames[] = {
+static const PlainGameDescriptor g_vcruiseGames[] = {
 	{"reah", "Reah: Face the Unknown"},
 	{"schizm", "Schizm: Mysterious Journey"},
 	{nullptr, nullptr}
 };
 
+static const char *g_vcruiseDirectoryGlobs[] = {
+	"Sfx",
+	"Waves-22",
+	nullptr
+};
+
 #include "vcruise/detection_tables.h"
 
 class VCruiseMetaEngineDetection : public AdvancedMetaEngineDetection {
 public:
-	VCruiseMetaEngineDetection() : AdvancedMetaEngineDetection(VCruise::gameDescriptions, sizeof(VCruise::VCruiseGameDescription), vCruiseGames) {
+	VCruiseMetaEngineDetection() : AdvancedMetaEngineDetection(VCruise::gameDescriptions, sizeof(VCruise::VCruiseGameDescription), g_vcruiseGames) {
 		_guiOptions = GUIO4(GAMEOPTION_FAST_ANIMATIONS, GAMEOPTION_INCREASE_DRAG_DISTANCE, GAMEOPTION_LAUNCH_DEBUG, GAMEOPTION_SKIP_MENU);
-		_maxScanDepth = 1;
-		_directoryGlobs = nullptr;
+		_maxScanDepth = 3;
+		_directoryGlobs = g_vcruiseDirectoryGlobs;
 		_flags = kADFlagCanPlayUnknownVariants;
 	}
 
diff --git a/engines/vcruise/detection.h b/engines/vcruise/detection.h
index 205aef97608..e8aa74d36e6 100644
--- a/engines/vcruise/detection.h
+++ b/engines/vcruise/detection.h
@@ -43,6 +43,10 @@ struct VCruiseGameDescription {
 	ADGameDescription desc;
 
 	VCruiseGameID gameID;
+
+	// Specifying the language in the ADGameDescription causes AD to fail to detect the game as a match,
+	// so we have to specify it as UNK_LANG and specify the default language here.
+	Common::Language defaultLanguage;
 };
 
 
diff --git a/engines/vcruise/detection_tables.h b/engines/vcruise/detection_tables.h
index f8f02e0dab9..8705bf5a3d4 100644
--- a/engines/vcruise/detection_tables.h
+++ b/engines/vcruise/detection_tables.h
@@ -30,31 +30,50 @@ namespace VCruise {
 
 static const VCruiseGameDescription gameDescriptions[] = {
 
-	{ // Reah: Face the Unknown, DVD/digital version
+	{ // Reah: Face the Unknown, English DVD/digital version
 		{
 			"reah",
-			"DVD",
-			AD_ENTRY1s("Reah.exe", "60ec19c53f1323cc7f0314f98d396283", 304128),
+			"English DVD",
+			AD_ENTRY2s("Reah.exe", "60ec19c53f1323cc7f0314f98d396283", 304128,
+					   "0170_b.wav", "5b705300b4fee3ceb821a1b55884a722", 129248),
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			ADGF_TESTING | VCRUISE_GF_WANT_MP3,
 			GUIO0()
 		},
 		GID_REAH,
+		Common::EN_ANY,
+	},
+	{ // Reah: Face the Unknown, English 6 CD Version
+		{
+			"reah",
+			"English CD",
+			AD_ENTRY2s("Reah.exe", "77bc7f7819cdd443f52b193529138c87", 305664,
+					   "0170_b.wav", "5b705300b4fee3ceb821a1b55884a722", 129248),
+			Common::UNK_LANG,
+			Common::kPlatformWindows,
+			ADGF_TESTING,
+			GUIO0()
+		},
+		GID_REAH,
+		Common::EN_ANY,
 	},
-	{ // Reah: Face the Unknown, 6 CD Version
+	{
+		// Reah: Face the Unknown, German 6 CD Version
 		{
 			"reah",
-			"CD",
-			AD_ENTRY1s("Reah.exe", "77bc7f7819cdd443f52b193529138c87", 305664),
+			"German CD",
+			AD_ENTRY2s("Reah.exe", "be29f9f9fc9a454488f9d2fb68e26326", 305664,
+					   "0170_b.wav", "117890A4A74815D704FC5064D92F58D1", 1),
 			Common::UNK_LANG,
 			Common::kPlatformWindows,
 			ADGF_TESTING,
 			GUIO0()
 		},
 		GID_REAH,
+		Common::DE_DEU,
 	},
-	{ // Schizm, DVD/digital Version
+	{ // Schizm: Mysterious Journey, English DVD/digital Version
 		{
 			"schizm",
 			"DVD",
@@ -65,6 +84,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
 			GUIO0()
 		},
 		GID_SCHIZM,
+		Common::EN_GRB,
 	},
 	{ AD_TABLE_END_MARKER, GID_UNKNOWN }
 };
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 058a2ee1ab9..02f8732b057 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -962,7 +962,7 @@ void SaveGameSnapshot::writeString(Common::WriteStream *stream, const Common::St
 FontCacheItem::FontCacheItem() : font(nullptr), size(0) {
 }
 
-Runtime::Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &rootFSNode, VCruiseGameID gameID)
+Runtime::Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &rootFSNode, VCruiseGameID gameID, Common::Language defaultLanguage)
 	: _system(system), _mixer(mixer), _roomNumber(1), _screenNumber(0), _direction(0), _hero(0), _haveHorizPanAnimations(false), _loadedRoomNumber(0), _activeScreenNumber(0),
 	  _gameState(kGameStateBoot), _gameID(gameID), _havePendingScreenChange(false), _forceScreenChange(false), _havePendingReturnToIdleState(false), _havePendingCompletionCheck(false),
 	  _havePendingPlayAmbientSounds(false), _ambientSoundFinishTime(0), _escOn(false), _debugMode(false), _fastAnimationMode(false),
@@ -977,7 +977,7 @@ Runtime::Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &roo
 	  _panoramaState(kPanoramaStateInactive),
 	  _listenerX(0), _listenerY(0), _listenerAngle(0), _soundCacheIndex(0),
 	  _isInGame(false),
-	  _subtitleFont(nullptr), _isDisplayingSubtitles(false), _languageIndex(0),
+	  _subtitleFont(nullptr), _isDisplayingSubtitles(false), _languageIndex(0), _defaultLanguage(defaultLanguage),
 	  _isCDVariant(false) {
 
 	for (uint i = 0; i < kNumDirections; i++) {
@@ -1252,13 +1252,8 @@ bool Runtime::bootGame(bool newGame) {
 		}
 	}
 
-	if (!foundLang) {
-		// Maybe should pick this differently
-		if (_gameID == GID_REAH)
-			lang = Common::EN_ANY;
-		else if (_gameID == GID_SCHIZM)
-			lang = Common::EN_GRB;
-	}
+	if (!foundLang)
+		lang = _defaultLanguage;
 
 	Common::CodePage codePage = Common::CodePage::kWindows1252;
 
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index af2f2999019..45810b9e39d 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -536,7 +536,7 @@ class Runtime {
 public:
 	friend class RuntimeMenuInterface;
 
-	Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &rootFSNode, VCruiseGameID gameID);
+	Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &rootFSNode, VCruiseGameID gameID, Common::Language defaultLanguage);
 	virtual ~Runtime();
 
 	void initSections(const Common::Rect &gameRect, const Common::Rect &menuRect, const Common::Rect &trayRect, const Common::Rect &fullscreenMenuRect, const Graphics::PixelFormat &pixFmt);
@@ -1235,6 +1235,8 @@ private:
 	bool _isCDVariant;
 	StartConfigDef _startConfigs[kNumStartConfigs];
 
+	Common::Language _defaultLanguage;
+
 	typedef Common::HashMap<uint, SubtitleDef> FrameToSubtitleMap_t;
 	typedef Common::HashMap<uint, FrameToSubtitleMap_t> AnimSubtitleMap_t;
 	typedef Common::HashMap<Common::String, SubtitleDef> WaveSubtitleMap_t;
diff --git a/engines/vcruise/vcruise.cpp b/engines/vcruise/vcruise.cpp
index 41f96302975..2ca0dd5f5f7 100644
--- a/engines/vcruise/vcruise.cpp
+++ b/engines/vcruise/vcruise.cpp
@@ -164,7 +164,7 @@ Common::Error VCruiseEngine::run() {
 
 	_system->fillScreen(0);
 
-	_runtime.reset(new Runtime(_system, _mixer, _rootFSNode, _gameDescription->gameID));
+	_runtime.reset(new Runtime(_system, _mixer, _rootFSNode, _gameDescription->gameID, _gameDescription->defaultLanguage));
 	_runtime->initSections(_videoRect, _menuBarRect, _trayRect, Common::Rect(640, 480), _system->getScreenFormat());
 
 	const char *exeName = _gameDescription->desc.filesDescriptions[0].fileName;




More information about the Scummvm-git-logs mailing list