[Scummvm-cvs-logs] scummvm master -> 6bcc8dfee62b9781758017a3a54df0b69c77479e

Strangerke Strangerke at scummvm.org
Sun Feb 2 16:22:08 CET 2014


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:
6bcc8dfee6 HOPKINS: Initialize censorship based on per-engine GUI option instead of optional text flag


Commit: 6bcc8dfee62b9781758017a3a54df0b69c77479e
    https://github.com/scummvm/scummvm/commit/6bcc8dfee62b9781758017a3a54df0b69c77479e
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-02T07:20:17-08:00

Commit Message:
HOPKINS: Initialize censorship based on per-engine GUI option instead of optional text flag

Changed paths:
    engines/hopkins/detection.cpp
    engines/hopkins/detection_tables.h
    engines/hopkins/files.cpp



diff --git a/engines/hopkins/detection.cpp b/engines/hopkins/detection.cpp
index c617a5a..b81f51e 100644
--- a/engines/hopkins/detection.cpp
+++ b/engines/hopkins/detection.cpp
@@ -29,6 +29,7 @@
 #include "common/memstream.h"
 #include "engines/advancedDetector.h"
 #include "common/system.h"
+#include "common/translation.h"
 #include "graphics/colormasks.h"
 #include "graphics/surface.h"
 
@@ -69,6 +70,30 @@ static const PlainGameDescriptor hopkinsGames[] = {
 
 #include "hopkins/detection_tables.h"
 
+static const ADExtraGuiOptionsMap optionsList[] = {
+	{
+		GAMEOPTION_GORE_DEFAULT_OFF,
+		{
+			_s("Gore Mode"),
+			_s("Enable Gore Mode when available"),
+			"enable_gore",
+			false
+		}
+	},
+
+	{
+		GAMEOPTION_GORE_DEFAULT_ON,
+		{
+			_s("Gore Mode"),
+			_s("Enable Gore Mode when available"),
+			"enable_gore",
+			true
+		}
+	},
+
+	AD_EXTRA_GUI_OPTIONS_TERMINATOR
+};
+
 const static char *directoryGlobs[] = {
 	"voice",
 	"link",
@@ -77,7 +102,7 @@ const static char *directoryGlobs[] = {
 
 class HopkinsMetaEngine : public AdvancedMetaEngine {
 public:
-	HopkinsMetaEngine() : AdvancedMetaEngine(Hopkins::gameDescriptions, sizeof(Hopkins::HopkinsGameDescription), hopkinsGames) {
+	HopkinsMetaEngine() : AdvancedMetaEngine(Hopkins::gameDescriptions, sizeof(Hopkins::HopkinsGameDescription), hopkinsGames, optionsList) {
 		_maxScanDepth = 3;
 		_directoryGlobs = directoryGlobs;
 	}
diff --git a/engines/hopkins/detection_tables.h b/engines/hopkins/detection_tables.h
index 00fee57..c6db7ab 100644
--- a/engines/hopkins/detection_tables.h
+++ b/engines/hopkins/detection_tables.h
@@ -22,6 +22,9 @@
 
 namespace Hopkins {
 
+#define GAMEOPTION_GORE_DEFAULT_ON  GUIO_GAMEOPTIONS1
+#define GAMEOPTION_GORE_DEFAULT_OFF GUIO_GAMEOPTIONS2
+
 static const HopkinsGameDescription gameDescriptions[] = {
 	{
 		// Hopkins FBI Linux Demo UK 1.00 and 1.02
@@ -35,7 +38,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformLinux,
 			ADGF_DEMO,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -51,7 +54,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformOS2,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -66,7 +69,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformBeOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -81,7 +84,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::ES_ESP,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -96,7 +99,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_OFF)
 		},
 	},
 	{
@@ -111,7 +114,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::RU_RUS,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -126,7 +129,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::FR_FRA,
 			Common::kPlatformLinux,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -141,7 +144,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformLinux,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -156,7 +159,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::FR_FRA,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 
 	},
@@ -172,7 +175,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::PL_POL,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_OFF)
 		},
 	},
 
@@ -189,7 +192,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_DEMO,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_ON)
 		},
 	},
 	{
@@ -204,7 +207,7 @@ static const HopkinsGameDescription gameDescriptions[] = {
 			Common::PL_POL,
 			Common::kPlatformWindows,
 			ADGF_DEMO,
-			GUIO1(GUIO_NONE)
+			GUIO1(GAMEOPTION_GORE_DEFAULT_OFF)
 		},
 	},
 	{ AD_TABLE_END_MARKER }
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp
index 2390ebb..51d11af 100644
--- a/engines/hopkins/files.cpp
+++ b/engines/hopkins/files.cpp
@@ -25,6 +25,7 @@
 #include "hopkins/hopkins.h"
 #include "hopkins/globals.h"
 
+#include "common/config-manager.h"
 #include "common/system.h"
 #include "common/debug.h"
 #include "common/file.h"
@@ -68,20 +69,11 @@ int FileManager::readStream(Common::ReadStream &stream, void *buf, size_t nbytes
 }
 
 /**
- * Initialize censorship based on blood.dat file
+ * The original censorship was based on blood.dat file.
+ * It's now using the config manager and a per-engine GUI option.
  */
 void FileManager::initCensorship() {
-	_vm->_globals->_censorshipFl = false;
-
-	// If file doesn't exist, fallback to uncensored
-	if (fileExists("BLOOD.DAT")) {
-		char *data = (char *)loadFile("BLOOD.DAT");
-
-		if ((data[6] == 'u' && data[7] == 'k') || (data[6] == 'U' && data[7] == 'K'))
-			_vm->_globals->_censorshipFl = true;
-
-		_vm->_globals->freeMemory((byte *)data);
-	}
+	_vm->_globals->_censorshipFl = ConfMan.getBool("enable_gore");
 }
 
 /**






More information about the Scummvm-git-logs mailing list