[Scummvm-cvs-logs] scummvm master -> 12e9c31f415a89b99dc389432afd3f32575be23b

Strangerke Strangerke at scummvm.org
Thu Feb 13 00:04:18 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:
12e9c31f41 CGE: Add an option to toggle color blind mode from the launcher


Commit: 12e9c31f415a89b99dc389432afd3f32575be23b
    https://github.com/scummvm/scummvm/commit/12e9c31f415a89b99dc389432afd3f32575be23b
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-12T15:01:41-08:00

Commit Message:
CGE: Add an option to toggle color blind mode from the launcher

Changed paths:
    NEWS
    engines/cge/detection.cpp
    engines/cge/vga13h.cpp



diff --git a/NEWS b/NEWS
index 8abd763..8821dfe 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 0c7c2e2..11f2a43 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 2022b80..b469c71 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);






More information about the Scummvm-git-logs mailing list