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
This commit is contained in:
Paul Gilbert 2019-02-23 12:16:27 -08:00
parent eacc4e52d1
commit bedab5bd46
3 changed files with 16 additions and 10 deletions

View File

@ -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);

View File

@ -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

View File

@ -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;
}