diff options
author | Strangerke | 2014-02-02 16:20:17 +0100 |
---|---|---|
committer | Strangerke | 2014-02-02 16:20:17 +0100 |
commit | 6bcc8dfee62b9781758017a3a54df0b69c77479e (patch) | |
tree | 47f637af72a1596c14ccf9f538f2ba1b39acc7f6 | |
parent | ea9fee35e80bcbb5040da4ea7d8de48d2fa339ae (diff) | |
download | scummvm-rg350-6bcc8dfee62b9781758017a3a54df0b69c77479e.tar.gz scummvm-rg350-6bcc8dfee62b9781758017a3a54df0b69c77479e.tar.bz2 scummvm-rg350-6bcc8dfee62b9781758017a3a54df0b69c77479e.zip |
HOPKINS: Initialize censorship based on per-engine GUI option instead of optional text flag
-rw-r--r-- | engines/hopkins/detection.cpp | 27 | ||||
-rw-r--r-- | engines/hopkins/detection_tables.h | 27 | ||||
-rw-r--r-- | engines/hopkins/files.cpp | 16 |
3 files changed, 45 insertions, 25 deletions
diff --git a/engines/hopkins/detection.cpp b/engines/hopkins/detection.cpp index c617a5aacf..b81f51e607 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 00fee57917..c6db7ab253 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 2390ebbdf8..51d11afd91 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"); } /** |