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

bgK bastien.bouclet at gmail.com
Sat Jun 30 21:57:47 CEST 2018


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:
b40e93e11a MOHAWK: Push down the include of advancedDetector.h


Commit: b40e93e11a77ca5b810ba2e6a6678ef25962f057
    https://github.com/scummvm/scummvm/commit/b40e93e11a77ca5b810ba2e6a6678ef25962f057
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-06-30T21:57:18+02:00

Commit Message:
MOHAWK: Push down the include of advancedDetector.h

So the whole engine is not recompiled when making changes to the
detection code.

Changed paths:
    engines/mohawk/detection.cpp
    engines/mohawk/mohawk.h
    engines/mohawk/riven.cpp
    engines/mohawk/riven.h


diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index c185a63..98783d7 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -46,6 +46,14 @@
 
 namespace Mohawk {
 
+struct MohawkGameDescription {
+	ADGameDescription desc;
+
+	uint8 gameType;
+	uint32 features;
+	const char *appName;
+};
+
 const char* MohawkEngine::getGameId() const {
 	return _gameDescription->desc.gameId;
 }
@@ -99,6 +107,23 @@ bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
 		|| (f == kSupportsSavingDuringRuntime);
 }
 
+Common::String MohawkEngine_Riven::getDatafileLanguageName() const {
+	const ADGameFileDescription *fileDesc;
+	for (fileDesc = _gameDescription->desc.filesDescriptions; fileDesc->fileName; fileDesc++) {
+		if (Common::String(fileDesc->fileName).hasPrefix("a_data_")) {
+			break;
+		}
+	}
+
+	if (!fileDesc->fileName) {
+		warning("Malformed 25th Anniversary Riven entry");
+
+		return "";
+	}
+
+	return Common::String(&fileDesc->fileName[7], strlen(fileDesc->fileName) - 7 - 4);
+}
+
 #endif
 
 } // End of Namespace Mohawk
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index d61512a..ad4ff7b 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -26,7 +26,6 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 
-#include "engines/advancedDetector.h"
 #include "engines/engine.h"
 
 class OSystem;
@@ -66,19 +65,12 @@ enum MohawkGameFeatures {
 	GF_LB_10 = (1 << 4)  // very early Living Books 1.0 games
 };
 
+struct MohawkGameDescription;
 class Sound;
 class PauseDialog;
 class Archive;
 class CursorManager;
 
-struct MohawkGameDescription {
-	ADGameDescription desc;
-
-	uint8 gameType;
-	uint32 features;
-	const char *appName;
-};
-
 class MohawkEngine : public ::Engine {
 protected:
 	Common::Error run() override;
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 163785e..57d7da3 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -506,15 +506,11 @@ Common::String MohawkEngine_Riven::getLanguageDatafile(char prefix) const {
 	if (!(getFeatures() & GF_25TH) || getLanguage() == Common::EN_ANY)
 		return "";
 
-	if (!Common::String(_gameDescription->desc.filesDescriptions[1].fileName).hasPrefix("a_data_")) {
-		warning("Malformed 25th Anniversary Riven entry");
-
+	Common::String language = getDatafileLanguageName();
+	if (language.empty()) {
 		return "";
 	}
 
-	const char *fname = _gameDescription->desc.filesDescriptions[1].fileName;
-	Common::String language(&fname[7], strlen(fname) - 7 - 4);
-
 	return Common::String::format("%c_data_%s.mhk", prefix, language.c_str());
 }
 
diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h
index e2a1162..30c6eb3 100644
--- a/engines/mohawk/riven.h
+++ b/engines/mohawk/riven.h
@@ -111,6 +111,7 @@ private:
 	// Datafiles
 	MohawkArchive *_extrasFile; // We need a separate handle for the extra data
 	const char **listExpectedDatafiles() const;
+	Common::String getDatafileLanguageName() const;
 	Common::String getLanguageDatafile(char prefix) const;
 	bool checkDatafiles();
 





More information about the Scummvm-git-logs mailing list