Skip to content

Commit fef99a6

Browse files
committed
bug: fix monochrome on upgrading version
1 parent 3d39d10 commit fef99a6

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

build/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export MYVER="0.1.4"
1+
export MYVER="0.1.5"

src/game_load.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ std::istream &operator>>(std::istream &in, Bits< Config & > my)
11071107
LOG("Read config: gfx_fullscreen_desktop = %d", my.t.gfx_fullscreen_desktop);
11081108
LOG("Read config: gfx_fullscreen = %d", my.t.gfx_fullscreen);
11091109
LOG("Read config: gfx_inverted = %d", my.t.gfx_inverted);
1110-
LOG("Read config: gfx_monochrome = %d", my.t.gfx_monochrome);
1110+
LOG("Read config: gfx_monochrome = %d", my.t.gfx_monochrome);
11111111
LOG("Read config: gfx_show_hidden = %d", my.t.gfx_show_hidden);
11121112
LOG("Read config: gfx_vsync_enable = %d", my.t.gfx_vsync_enable);
11131113
LOG("Read config: g_opt_ascii = %d", g_opt_ascii);

src/globals.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,28 @@ int DUNGEON_GRID_CHUNK_HEIGHT;
7474
int DUNGEON_GRID_CHUNK_WIDTH;
7575

7676
int g_last_logged_callframes_depth;
77+
78+
void reset_globals(void)
79+
{
80+
g_opt_ascii = false;
81+
g_opt_ascii_override = false;
82+
g_opt_biome_chasms = false;
83+
g_opt_biome_flooded = false;
84+
g_opt_biome_ice = false;
85+
g_opt_biome_lava = false;
86+
g_opt_biome_swamp = false;
87+
g_opt_gfx_monochrome = false;
88+
g_opt_no_slow_log_flush = false;
89+
g_opt_override_debug_level = false;
90+
g_opt_resume = false;
91+
g_opt_silent = false;
92+
g_opt_test_dungeon_gen = false;
93+
g_opt_test_level_start = false;
94+
g_opt_tests = false;
95+
g_opt_test_save_load = false;
96+
g_opt_test_skip_main_menu = false;
97+
g_render_monochrome = false;
98+
g_opt_debug1 = false;
99+
g_opt_debug2 = false;
100+
g_opt_debug3 = false;
101+
}

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,13 @@ int main(int argc, char *argv[])
837837
game->config.version.c_str(), version.c_str());
838838
delete game;
839839
game = new Game(std::string(appdata));
840+
reset_globals();
840841
game->save_config();
841842
g_errored = false;
842843
} else if (! config_error.empty()) {
843844
SDL_MSG_BOX("Config error: %s. Will need to reset config.", config_error.c_str());
844845
delete game;
846+
reset_globals();
845847
game = new Game(std::string(appdata));
846848
game->save_config();
847849
g_errored = false;

src/my_globals.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,6 @@ extern int g_last_logged_callframes_depth;
135135
#define MY_STDERR (g_log_stderr ? g_log_stderr : stderr)
136136
#define MY_STDOUT (g_log_stdout ? g_log_stdout : stdout)
137137

138+
void reset_globals(void);
139+
138140
#endif

0 commit comments

Comments
 (0)