aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-02-13 00:00:43 +0100
committerStrangerke2014-02-13 00:01:41 +0100
commit12e9c31f415a89b99dc389432afd3f32575be23b (patch)
tree3be779be63e424e1e8d02a5b1742a5f14887aba0
parentaaf9ebfd680dd733ce11fbcd1943f177f4487a40 (diff)
downloadscummvm-rg350-12e9c31f415a89b99dc389432afd3f32575be23b.tar.gz
scummvm-rg350-12e9c31f415a89b99dc389432afd3f32575be23b.tar.bz2
scummvm-rg350-12e9c31f415a89b99dc389432afd3f32575be23b.zip
CGE: Add an option to toggle color blind mode from the launcher
-rw-r--r--NEWS2
-rw-r--r--engines/cge/detection.cpp50
-rw-r--r--engines/cge/vga13h.cpp5
3 files changed, 41 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 8abd763a9e..8821dfe20a 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ For a more comprehensive changelog of the latest experimental code, see:
Broken Sword 2:
- Added back support for MPEG-2 videos.
+ CGE:
+ - Added an option to enable Color Blind deom the ScummVM GUI.
Gob:
- Improved video quality in Urban Runner.
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp
index 0c7c2e2d64..11f2a43854 100644
--- a/engines/cge/detection.cpp
+++ b/engines/cge/detection.cpp
@@ -24,10 +24,22 @@
#include "engines/advancedDetector.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/translation.h"
#include "base/plugins.h"
#include "graphics/thumbnail.h"
#include "cge/cge.h"
+namespace CGE {
+
+struct CgeGameDescription {
+ ADGameDescription desc;
+ GameType gameType;
+};
+
+#define GAMEOPTION_COLOR_BLIND_DEFAULT_OFF GUIO_GAMEOPTIONS1
+
+} // End of namespace CGE
+
static const PlainGameDescriptor CGEGames[] = {
{ "soltys", "Soltys" },
{ "sfinx", "Sfinx" },
@@ -36,11 +48,6 @@ static const PlainGameDescriptor CGEGames[] = {
namespace CGE {
-struct CgeGameDescription {
- ADGameDescription desc;
- GameType gameType;
-};
-
static const CgeGameDescription gameDescriptions[] = {
{
@@ -63,7 +70,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "f9ae2e7f8f7cac91378cdafca43faf1e", 8437676},
AD_LISTEND
},
- Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO0()
+ Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSoltys
},
@@ -75,7 +82,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "75d385a6074c58b69f7730481f256051", 1796710},
AD_LISTEND
},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO , GUIO0()
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO , GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSoltys
},
@@ -87,7 +94,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "c5d9b15863cab61dc125551576dece04", 1075272},
AD_LISTEND
},
- Common::PL_POL, Common::kPlatformDOS, ADGF_DEMO , GUIO0()
+ Common::PL_POL, Common::kPlatformDOS, ADGF_DEMO , GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSoltys
},
@@ -99,7 +106,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "4ffeff4abc99ac5999b55ccfc56ab1df", 8430868},
AD_LISTEND
},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS , GUIO0()
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS , GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSoltys
},
@@ -111,7 +118,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "0e43331c846094d77f5dd201827e0a3b", 8439339},
AD_LISTEND
},
- Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO0()
+ Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSoltys
},
@@ -123,7 +130,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "ff10d54acc2c95696c57e05819b6906f", 8450151},
AD_LISTEND
},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_NO_FLAGS , GUIO0()
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_NO_FLAGS , GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSoltys
},
@@ -136,7 +143,7 @@ static const CgeGameDescription gameDescriptions[] = {
{"vol.dat", 0, "de14291869a8eb7c2732ab783c7542ef", 34180844},
AD_LISTEND
},
- Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO0()
+ Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
kGameTypeSfinx
},
@@ -148,12 +155,25 @@ static const ADFileBasedFallback fileBasedFallback[] = {
{ &gameDescriptions[0].desc, { "vol.cat", "vol.dat", 0 } },
{ 0, { 0 } }
};
-
} // End of namespace CGE
+static const ADExtraGuiOptionsMap optionsList[] = {
+ {
+ GAMEOPTION_COLOR_BLIND_DEFAULT_OFF,
+ {
+ _s("Color Blind Mode"),
+ _s("Enable Color Blind Mode by default"),
+ "enable_color_blind",
+ false
+ }
+ },
+
+ AD_EXTRA_GUI_OPTIONS_TERMINATOR
+};
+
class CGEMetaEngine : public AdvancedMetaEngine {
public:
- CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(CGE::CgeGameDescription), CGEGames) {
+ CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(CGE::CgeGameDescription), CGEGames, optionsList) {
_singleid = "soltys";
}
@@ -169,8 +189,6 @@ public:
return "Soltys (c) 1994-1996 L.K. Avalon";
}
-
-
virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
virtual int getMaximumSaveSlot() const;
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index 2022b803a5..b469c7197d 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -26,6 +26,7 @@
*/
#include "common/array.h"
+#include "common/config-manager.h"
#include "common/rect.h"
#include "graphics/palette.h"
#include "cge/general.h"
@@ -637,6 +638,10 @@ Vga::Vga(CGEEngine *vm) : _frmCnt(0), _msg(NULL), _name(NULL), _setPal(false), _
_page[idx]->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
}
+ if (ConfMan.getBool("enable_color_blind"))
+ _mono = 1;
+
+
_oldColors = (Dac *)malloc(sizeof(Dac) * kPalCount);
_newColors = (Dac *)malloc(sizeof(Dac) * kPalCount);
getColors(_oldColors);