Skip to content

Commit

Permalink
Reduce needlessly large closures
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 1, 2016
1 parent 5195758 commit 1c5f602
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/game_config_manager.cpp
Expand Up @@ -135,10 +135,11 @@ void game_config_manager::load_game_config_with_loadscreen(FORCE_RELOAD_CONFIG f
}
}

gui2::tloadscreen::display(video_, [=]() {
gui2::tloadscreen::display(video_, [this, force_reload, classification]() {
load_game_config(force_reload, classification);
});
}

void game_config_manager::load_game_config(FORCE_RELOAD_CONFIG force_reload,
game_classification const* classification)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game_launcher.cpp
Expand Up @@ -1011,7 +1011,7 @@ void game_launcher::launch_game(RELOAD_GAME_DATA reload)
return;
}

gui2::tloadscreen::display(video(), [=]() {
gui2::tloadscreen::display(video(), [this, reload]() {

gui2::tloadscreen::progress("load data");
if(reload == RELOAD_DATA) {
Expand Down
4 changes: 2 additions & 2 deletions src/wesnoth.cpp
Expand Up @@ -644,7 +644,7 @@ static int do_gameloop(const std::vector<std::string>& args)
game_config_manager config_manager(cmdline_opts, game->video(),
game->jump_to_editor());

gui2::tloadscreen::display(game->video(), [&]() {
gui2::tloadscreen::display(game->video(), [&res, &config_manager]() {
gui2::tloadscreen::progress("load config");
res = config_manager.init_game_config(game_config_manager::NO_FORCE_RELOAD);
});
Expand Down Expand Up @@ -851,7 +851,7 @@ static int do_gameloop(const std::vector<std::string>& args)
}
continue;
} else if(res == gui2::ttitle_screen::RELOAD_GAME_DATA) {
gui2::tloadscreen::display(game->video(), [&]() {
gui2::tloadscreen::display(game->video(), [&config_manager]() {
config_manager.reload_changed_game_config();
image::flush_cache();
});
Expand Down

0 comments on commit 1c5f602

Please sign in to comment.