From eacc4e52d14a4929323df30da6346b6bbacda9b8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Feb 2019 11:13:19 -0800 Subject: GLK: FROTZ: Fix initialization of zcolors array --- engines/glk/frotz/glk_interface.cpp | 4 ++-- engines/glk/frotz/glk_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/glk') diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp index 48203bf7e5..dda932dc3d 100644 --- a/engines/glk/frotz/glk_interface.cpp +++ b/engines/glk/frotz/glk_interface.cpp @@ -68,8 +68,8 @@ void GlkInterface::initialize() { 0x2D6B, ///< 12 = dark grey }; - zcolors[0] = -2; // Current - zcolors[1] = -1; // Default + zcolors[0] = zcolor_Current; // Current + zcolors[1] = zcolor_Default; // Default for (int i = 2; i < zcolor_NUMCOLORS; ++i) zcolors[i] = zRGB(COLOR_MAP[i - 2]); diff --git a/engines/glk/frotz/glk_interface.h b/engines/glk/frotz/glk_interface.h index ea7a104b8a..b52fdc4e6d 100644 --- a/engines/glk/frotz/glk_interface.h +++ b/engines/glk/frotz/glk_interface.h @@ -61,7 +61,7 @@ private: public: Pics *_pics; zchar statusline[256]; - int zcolors[zcolor_NUMCOLORS]; + uint zcolors[zcolor_NUMCOLORS]; int oldstyle; int curstyle; int cury; -- cgit v1.2.3 From bedab5bd460452ad34ea3c820722a85f015695b0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Feb 2019 12:16:27 -0800 Subject: GLK: FROTZ: Fix colors for Beyond Zork As part of that, I've made the default bg Black rather than blue, since it provides better contrast for the upper area & minimap --- engines/glk/frotz/config.cpp | 5 ++++- engines/glk/frotz/config.h | 2 +- engines/glk/frotz/glk_interface.cpp | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'engines/glk') diff --git a/engines/glk/frotz/config.cpp b/engines/glk/frotz/config.cpp index 6948d1c14d..24f6b1d9e2 100644 --- a/engines/glk/frotz/config.cpp +++ b/engines/glk/frotz/config.cpp @@ -150,7 +150,7 @@ UserOptions::UserOptions() : _undo_slots(MAX_UNDO_SLOTS), _sound(true), _quetzal _piracy(false), _script_cols(0), _left_margin(0), _right_margin(0), _defaultBackground(0), _defaultForeground(0) { } -void UserOptions::initialize(uint hVersion) { +void UserOptions::initialize(uint hVersion, uint storyId) { _err_report_mode = getConfigInt("err_report_mode", ERR_REPORT_ONCE, ERR_REPORT_FATAL); _ignore_errors = getConfigBool("ignore_errors"); _expand_abbreviations = getConfigBool("expand_abbreviations"); @@ -168,6 +168,9 @@ void UserOptions::initialize(uint hVersion) { int defaultFg = hVersion == V6 ? 0 : 0xffffff; int defaultBg = hVersion == V6 ? 0xffffff : 0x80; + if (storyId == BEYOND_ZORK) + defaultBg = 0; + defaultFg = getConfigInt("foreground", defaultFg, 0xffffff); defaultBg = getConfigInt("background", defaultBg, 0xffffff); diff --git a/engines/glk/frotz/config.h b/engines/glk/frotz/config.h index 80dd6ebf2c..212d11fb22 100644 --- a/engines/glk/frotz/config.h +++ b/engines/glk/frotz/config.h @@ -160,7 +160,7 @@ struct UserOptions { /** * Initializes the options */ - void initialize(uint hVersion); + void initialize(uint hVersion, uint storyId); /** * Returns true if the game being played is one of the original Infocom releases diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp index dda932dc3d..aa5139f7c1 100644 --- a/engines/glk/frotz/glk_interface.cpp +++ b/engines/glk/frotz/glk_interface.cpp @@ -51,7 +51,7 @@ void GlkInterface::initialize() { uint width, height; /* Setup options */ - UserOptions::initialize(h_version); + UserOptions::initialize(h_version, _storyId); /* Setup colors array */ const int COLOR_MAP[zcolor_NUMCOLORS - 2] = { @@ -158,23 +158,26 @@ void GlkInterface::initialize() { h_interpreter_number = h_version == 6 ? INTERP_MSDOS : INTERP_AMIGA; h_interpreter_version = 'F'; + // Set these per spec 8.3.2. + h_default_foreground = WHITE_COLOUR; + h_default_background = BLACK_COLOUR; + // Set up the foreground & background _color_enabled = ((h_version >= 5) && (h_flags & COLOUR_FLAG)) - || (_defaultForeground != zcolor_Transparent) || (_defaultBackground != zcolor_Transparent); + || (_defaultForeground != zcolor_Transparent) || (_defaultBackground != zcolor_Transparent); if (_color_enabled) { h_config |= CONFIG_COLOUR; h_flags |= COLOUR_FLAG; // FIXME: beyond zork handling? - h_default_foreground = BLACK_COLOUR; - h_default_background = WHITE_COLOUR; + if (h_version == 6) { + h_default_foreground = BLACK_COLOUR; + h_default_background = WHITE_COLOUR; + } + zcolors[h_default_foreground] = _defaultForeground; zcolors[h_default_background] = _defaultBackground; } else { - // Set these per spec 8.3.2. - h_default_foreground = WHITE_COLOUR; - h_default_background = BLACK_COLOUR; - if (h_flags & COLOUR_FLAG) h_flags &= ~COLOUR_FLAG; } -- cgit v1.2.3