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

dreammaster noreply at scummvm.org
Sun Jan 14 23:17:30 UTC 2024


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:
fff714de9d M4: Add better detection for non interactive Burger demo


Commit: fff714de9d123ca4e40577f395cd101a942f473b
    https://github.com/scummvm/scummvm/commit/fff714de9d123ca4e40577f395cd101a942f473b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-01-14T15:17:14-08:00

Commit Message:
M4: Add better detection for non interactive Burger demo

Changed paths:
    engines/m4/burger/vars.cpp
    engines/m4/detection.h
    engines/m4/detection_tables.h
    engines/m4/fileio/sys_file.cpp
    engines/m4/m4.cpp
    engines/m4/m4.h


diff --git a/engines/m4/burger/vars.cpp b/engines/m4/burger/vars.cpp
index 6a9aea40c40..ed721eaa100 100644
--- a/engines/m4/burger/vars.cpp
+++ b/engines/m4/burger/vars.cpp
@@ -95,7 +95,17 @@ void Vars::main_cold_data_init() {
 	debugC(1, kDebugCore, "executing - %s", GAME_MODES[_executing]);
 
 	// Set up game mode and starting room
-	_executing = !g_engine->isDemo() ? WHOLE_GAME : INTERACTIVE_DEMO;
+	switch (g_engine->isDemo()) {
+	case GStyle_Demo:
+		_executing = INTERACTIVE_DEMO;
+		break;
+	case GStyle_NonInteractiveDemo:
+		_executing = MAGAZINE_DEMO;
+		break;
+	default:
+		_executing = WHOLE_GAME;
+		break;
+	}
 
 	switch (_executing) {
 	case JUST_OVERVIEW:
diff --git a/engines/m4/detection.h b/engines/m4/detection.h
index 44acdebfb46..b4f80d29f6c 100644
--- a/engines/m4/detection.h
+++ b/engines/m4/detection.h
@@ -41,10 +41,17 @@ enum M4GameType {
 	GType_Burger = 2
 };
 
+enum M4GameStyle {
+	GStyle_Game = 0,
+	GStyle_Demo = 1,
+	GStyle_NonInteractiveDemo = 2
+};
+
 enum Features {
 	kFeaturesNone = 0,
 	kFeaturesCD = 1 << 0,
-	kFeaturesDemo = 1 << 1
+	kFeaturesDemo = 1 << 1,
+	kFeaturesNonInteractiveDemo = 1 << 2
 };
 
 struct M4GameDescription {
diff --git a/engines/m4/detection_tables.h b/engines/m4/detection_tables.h
index 19884d62f5e..da67c7019a7 100644
--- a/engines/m4/detection_tables.h
+++ b/engines/m4/detection_tables.h
@@ -84,15 +84,15 @@ static const M4GameDescription gameDescriptions[] = {
 	{
 		{
 			"burger",
-			"Demo",
+			"Non-Interactive Demo",
 			AD_ENTRY1s("overview.has", "57aa43a3ef88a934a43e9b1890ef5e17", 10519),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
-			ADGF_DEMO | ADGF_TESTING,
+			ADGF_DEMO | ADGF_UNSTABLE,
 			GUIO1(GUIO_NOASPECT)
 		},
 		GType_Burger,
-		kFeaturesDemo
+		kFeaturesNonInteractiveDemo
 	},
 	{
 		{
diff --git a/engines/m4/fileio/sys_file.cpp b/engines/m4/fileio/sys_file.cpp
index 114ffa9e8d2..d6634c12edf 100644
--- a/engines/m4/fileio/sys_file.cpp
+++ b/engines/m4/fileio/sys_file.cpp
@@ -647,8 +647,13 @@ void sysfile_init(bool in_hag_mode) {
 	_G(hag).hag_flag = in_hag_mode;
 
 	if (in_hag_mode) {
-		_G(hag).hash_file = Common::Path(Common::String::format("%s.has",
-			g_engine->getGameType() == GType_Riddle ? "ripley" : "burger"));
+		const char *name = "burger";
+		if (g_engine->getGameType() == GType_Riddle)
+			name = "ripley";
+		else if (g_engine->isDemo() == GStyle_NonInteractiveDemo)
+			name = "overview";
+
+		_G(hag).hash_file = Common::Path(Common::String::format("%s.has", name));
 		term_message("Initialized in hag mode");
 	} else {
 		term_message("Initialized in file mode");
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 1dad881a226..3dae664ba63 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -74,8 +74,13 @@ Common::Language M4Engine::getLanguage() const {
 	return _gameDescription->desc.language;
 }
 
-bool M4Engine::isDemo() const {
-	return (getFeatures() & ADGF_DEMO) != 0;
+int M4Engine::isDemo() const {
+	if ((getFeatures() & ADGF_DEMO) == 0)
+		return GStyle_Game;
+	else if (_gameDescription->features & kFeaturesNonInteractiveDemo)
+		return GStyle_NonInteractiveDemo;
+	else
+		return GStyle_Demo;
 }
 
 Common::Error M4Engine::run() {
diff --git a/engines/m4/m4.h b/engines/m4/m4.h
index 7143742107c..c041b661074 100644
--- a/engines/m4/m4.h
+++ b/engines/m4/m4.h
@@ -82,6 +82,7 @@ public:
 	~M4Engine() override;
 
 	uint32 getFeatures() const;
+
 	bool useOriginalSaveLoad() const {
 		return _useOriginalSaveLoad;
 	}
@@ -104,7 +105,7 @@ public:
 	/**
 	 * Return if it's a demo
 	 */
-	bool isDemo() const;
+	int isDemo() const;
 
 	/**
 	 * Gets a random number




More information about the Scummvm-git-logs mailing list