diff --git a/common/fractint.cpp b/common/fractint.cpp index 469f6f50c..f0d3a874e 100644 --- a/common/fractint.cpp +++ b/common/fractint.cpp @@ -81,7 +81,7 @@ long g_l_at_rad; // finite attractor radius double g_f_at_rad; // finite attractor radius int g_bit_shift; // fudgefactor -int g_bad_config = 0; // 'fractint.cfg' ok? +config_status g_bad_config{}; // 'fractint.cfg' ok? bool g_has_inverse = false; // note that integer grid is set when integerfractal && !invert; // otherwise the floating point grid is set; never both at once @@ -218,7 +218,7 @@ static void main_restart(int const argc, char const *const argv[], bool &stacked g_save_dac = 0; // don't save the VGA DAC #ifndef XFRACT - if (g_bad_config < 0) // fractint.cfg bad, no msg yet + if (g_bad_config == config_status::BAD_NO_MESSAGE) { bad_fractint_cfg_msg(); } diff --git a/common/miscovl.cpp b/common/miscovl.cpp index d44a0a691..143f92463 100644 --- a/common/miscovl.cpp +++ b/common/miscovl.cpp @@ -2007,7 +2007,7 @@ int select_video_mode(int curmode) { // update fractint.cfg for new key assignments if (modes_changed - && g_bad_config == 0 + && g_bad_config == config_status::OK && stopmsg(STOPMSG_CANCEL | STOPMSG_NO_BUZZER | STOPMSG_INFO_ONLY, "Save new function key assignments or cancel changes?") == 0) { @@ -2041,7 +2041,7 @@ int select_video_mode(int curmode) } // update fractint.cfg for new key assignments - if (modes_changed && g_bad_config == 0) + if (modes_changed && g_bad_config == config_status::OK) { update_fractint_cfg(); } @@ -2089,7 +2089,7 @@ static int check_modekey(int curkey, int choice) if ((curkey == '-' || curkey == '+') && (g_video_table[i].keynum == 0 || g_video_table[i].keynum >= 1084)) { - if (g_bad_config) + if (g_bad_config != config_status::OK) { stopmsg(STOPMSG_NONE, "Missing or bad FRACTINT.CFG file. Can't reassign keys."); } diff --git a/common/realdos.cpp b/common/realdos.cpp index 35eef39a1..7c629dcad 100644 --- a/common/realdos.cpp +++ b/common/realdos.cpp @@ -2069,7 +2069,7 @@ void load_fractint_config() return; bad_fractint_cfg: - g_bad_config = -1; // bad, no message issued yet + g_bad_config = config_status::BAD_NO_MESSAGE; } void bad_fractint_cfg_msg() @@ -2078,7 +2078,7 @@ void bad_fractint_cfg_msg() "File FRACTINT.CFG is missing or invalid.\n" "See Hardware Support and Video Modes in the full documentation for help.\n" "I will continue with only the built-in video modes available."); - g_bad_config = 1; // bad, message issued + g_bad_config = config_status::BAD_WITH_MESSAGE; } int check_vidmode_key(int option, int k) diff --git a/headers/id_data.h b/headers/id_data.h index 796a6df3b..6e7271b4a 100644 --- a/headers/id_data.h +++ b/headers/id_data.h @@ -16,11 +16,18 @@ enum class calc_status_value COMPLETED = 4 }; +enum class config_status +{ + OK = 0, + BAD_WITH_MESSAGE = 1, + BAD_NO_MESSAGE = -1 +}; + enum class help_labels; extern int g_adapter; // index into g_video_table[] extern bool g_auto_browse; -extern int g_bad_config; +extern config_status g_bad_config; extern int g_bit_shift; extern int g_box_count; extern std::string g_browse_mask;