From 8f869c74c09858dd3fd553c30ca645d942b4cdb0 Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 9 Jul 2014 11:55:27 +0200 Subject: CGE2: Add option for enabling color blind mode from the Launcher. --- engines/cge2/detection.cpp | 2 +- engines/cge2/detection.h | 21 +++++++++++++++++++-- engines/cge2/vga13h.cpp | 6 ++---- 3 files changed, 22 insertions(+), 7 deletions(-) (limited to 'engines/cge2') diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp index 6d4f6339d9..5fcbe2ed7a 100644 --- a/engines/cge2/detection.cpp +++ b/engines/cge2/detection.cpp @@ -64,7 +64,7 @@ const ADGameDescription *CGE2MetaEngine::fallbackDetect(const FileMap &allFiles, desc.language = Common::EN_ANY; desc.platform = Common::kPlatformDOS; desc.flags = ADGF_NO_FLAGS; - desc.guioptions = GUIO0(); + desc.guioptions = GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF); return (const ADGameDescription *)&desc; } diff --git a/engines/cge2/detection.h b/engines/cge2/detection.h index 556980774a..51e2988c86 100644 --- a/engines/cge2/detection.h +++ b/engines/cge2/detection.h @@ -30,9 +30,12 @@ #include "cge2/cge2.h" #include "engines/advancedDetector.h" +#include "common/translation.h" namespace CGE2 { +#define GAMEOPTION_COLOR_BLIND_DEFAULT_OFF GUIO_GAMEOPTIONS1 + static const PlainGameDescriptor CGE2Games[] = { { "sfinx", "Sfinx" }, { 0, 0 } @@ -46,14 +49,28 @@ static const ADGameDescription 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) }, AD_TABLE_END_MARKER }; +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 CGE2MetaEngine : public AdvancedMetaEngine { public: - CGE2MetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), CGE2Games) { + CGE2MetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), CGE2Games, optionsList) { _singleid = "sfinx"; } diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index 069c2672ae..10c6bbd5a4 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -840,10 +840,8 @@ Vga::Vga(CGE2Engine *vm) : _frmCnt(0), _msg(nullptr), _name(nullptr), _setPal(fa _page[idx]->create(kScrWidth, kScrHeight, Graphics::PixelFormat::createFormatCLUT8()); } - /*if (ConfMan.getBool("enable_color_blind")) - _mono = 1;*/ - - warning("STUB: Vga::Vga()"); + if (ConfMan.getBool("enable_color_blind")) + _mono = 1; _oldColors = (Dac *)malloc(sizeof(Dac) * kPalCount); _newColors = (Dac *)malloc(sizeof(Dac) * kPalCount); -- cgit v1.2.3