Rebuild image cache when reloading changed game config (fixes #2424)

The above issue was caused by the fact that image::flush_cache() wasn't called after
reload_changed_game_config() when the addons manager was exited. Using F5 at the tilescreen
caused the image to appear since that callback *did* include image::flush_cache();

reload_changed_game_config() was called in 5 places, 2 of which were followed by flush_cache.
I figured it's safest to just include the latter in the former, since the other three usecases
(multiplayer installed addons before joining a game, a new core was selected, and the addons
manager was exited) all seem like places where flushing the image cache would be appropriate.
This commit is contained in:
Charles Dang 2018-02-06 05:32:24 +11:00
parent 7f55296c7d
commit 2dc4352845
3 changed files with 2 additions and 2 deletions

View file

@ -495,6 +495,8 @@ void game_config_manager::reload_changed_game_config()
old_defines_map_.clear();
filesystem::clear_binary_paths_cache();
init_game_config(FORCE_RELOAD);
image::flush_cache();
}
void game_config_manager::load_game_config_for_editor()

View file

@ -1008,7 +1008,6 @@ editor::EXIT_STATUS game_launcher::start_editor(const std::string& filename)
return res;
game_config_manager::get()->reload_changed_game_config();
image::flush_cache();
}
return editor::EXIT_ERROR; // not supposed to happen
}

View file

@ -888,7 +888,6 @@ static int do_gameloop(const std::vector<std::string>& args)
case gui2::dialogs::title_screen::RELOAD_GAME_DATA:
gui2::dialogs::loading_screen::display([&config_manager]() {
config_manager.reload_changed_game_config();
image::flush_cache();
});
break;
case gui2::dialogs::title_screen::MAP_EDITOR: