Skip to content

Commit

Permalink
Correct indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 1, 2016
1 parent a5cd2c7 commit 1368a05
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 92 deletions.
16 changes: 8 additions & 8 deletions src/game_launcher.cpp
Expand Up @@ -1013,15 +1013,15 @@ void game_launcher::launch_game(RELOAD_GAME_DATA reload)

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

gui2::tloadscreen::progress("load data");
if(reload == RELOAD_DATA) {
try {
game_config_manager::get()->
load_game_config_for_game(state_.classification());
} catch(config::error&) {
return;
gui2::tloadscreen::progress("load data");
if(reload == RELOAD_DATA) {
try {
game_config_manager::get()->
load_game_config_for_game(state_.classification());
} catch(config::error&) {
return;
}
}
}
});

try {
Expand Down
146 changes: 73 additions & 73 deletions src/play_controller.cpp
Expand Up @@ -225,88 +225,88 @@ void play_controller::init(CVideo& video, const config& level)
{

gui2::tloadscreen::display(video, [this, &video, &level]() {
gui2::tloadscreen::progress("load level");

LOG_NG << "initializing game_state..." << (SDL_GetTicks() - ticks()) << std::endl;
gamestate_.reset(new game_state(level, *this, tdata_));

resources::gameboard = &gamestate().board_;
resources::gamedata = &gamestate().gamedata_;
resources::teams = &gamestate().board_.teams_;
resources::tod_manager = &gamestate().tod_manager_;
resources::units = &gamestate().board_.units_;
resources::filter_con = &gamestate();
resources::undo_stack = &undo_stack();
resources::game_events = gamestate().events_manager_.get();

gamestate_->init(level, *this);
resources::tunnels = gamestate().pathfind_manager_.get();

LOG_NG << "initializing whiteboard..." << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("init whiteboard");
whiteboard_manager_.reset(new wb::manager());
resources::whiteboard = whiteboard_manager_;

LOG_NG << "loading units..." << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("load units");
preferences::encounter_all_content(gamestate().board_);

LOG_NG << "initializing theme... " << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("init theme");
const config& theme_cfg = controller_base::get_theme(game_config_, level["theme"]);

LOG_NG << "building terrain rules... " << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("build terrain");
gui_.reset(new game_display(gamestate().board_, video, whiteboard_manager_, *gamestate().reports_, gamestate().tod_manager_, theme_cfg, level));
if (!gui_->video().faked()) {
if (saved_game_.mp_settings().mp_countdown)
gui_->get_theme().modify_label("time-icon", _ ("time left for current turn"));
else
gui_->get_theme().modify_label("time-icon", _ ("current local time"));
}
gui2::tloadscreen::progress("load level");

LOG_NG << "initializing game_state..." << (SDL_GetTicks() - ticks()) << std::endl;
gamestate_.reset(new game_state(level, *this, tdata_));

resources::gameboard = &gamestate().board_;
resources::gamedata = &gamestate().gamedata_;
resources::teams = &gamestate().board_.teams_;
resources::tod_manager = &gamestate().tod_manager_;
resources::units = &gamestate().board_.units_;
resources::filter_con = &gamestate();
resources::undo_stack = &undo_stack();
resources::game_events = gamestate().events_manager_.get();

gamestate_->init(level, *this);
resources::tunnels = gamestate().pathfind_manager_.get();

LOG_NG << "initializing whiteboard..." << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("init whiteboard");
whiteboard_manager_.reset(new wb::manager());
resources::whiteboard = whiteboard_manager_;

LOG_NG << "loading units..." << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("load units");
preferences::encounter_all_content(gamestate().board_);

LOG_NG << "initializing theme... " << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("init theme");
const config& theme_cfg = controller_base::get_theme(game_config_, level["theme"]);

LOG_NG << "building terrain rules... " << (SDL_GetTicks() - ticks()) << std::endl;
gui2::tloadscreen::progress("build terrain");
gui_.reset(new game_display(gamestate().board_, video, whiteboard_manager_, *gamestate().reports_, gamestate().tod_manager_, theme_cfg, level));
if (!gui_->video().faked()) {
if (saved_game_.mp_settings().mp_countdown)
gui_->get_theme().modify_label("time-icon", _ ("time left for current turn"));
else
gui_->get_theme().modify_label("time-icon", _ ("current local time"));
}

gui2::tloadscreen::progress("init display");
mouse_handler_.set_gui(gui_.get());
menu_handler_.set_gui(gui_.get());
resources::screen = gui_.get();
gui2::tloadscreen::progress("init display");
mouse_handler_.set_gui(gui_.get());
menu_handler_.set_gui(gui_.get());
resources::screen = gui_.get();

LOG_NG << "done initializing display... " << (SDL_GetTicks() - ticks()) << std::endl;
LOG_NG << "done initializing display... " << (SDL_GetTicks() - ticks()) << std::endl;

LOG_NG << "building gamestate to gui and whiteboard... " << (SDL_GetTicks() - ticks()) << std::endl;
// This *needs* to be created before the show_intro and show_map_scene
// as that functions use the manager state_of_game
// Has to be done before registering any events!
gamestate().bind(whiteboard_manager_.get(), gui_.get());
gui2::tloadscreen::progress("init lua");
resources::lua_kernel = gamestate().lua_kernel_.get();
LOG_NG << "building gamestate to gui and whiteboard... " << (SDL_GetTicks() - ticks()) << std::endl;
// This *needs* to be created before the show_intro and show_map_scene
// as that functions use the manager state_of_game
// Has to be done before registering any events!
gamestate().bind(whiteboard_manager_.get(), gui_.get());
gui2::tloadscreen::progress("init lua");
resources::lua_kernel = gamestate().lua_kernel_.get();

if(gamestate().first_human_team_ != -1) {
gui_->set_team(gamestate().first_human_team_);
}
else if(is_observer()) {
// Find first team that is allowed to be observed.
// If not set here observer would be without fog until
// the first turn of observable side
size_t i;
for (i=0;i < gamestate().board_.teams().size();++i)
{
if (!gamestate().board_.teams()[i].get_disallow_observers())
if(gamestate().first_human_team_ != -1) {
gui_->set_team(gamestate().first_human_team_);
}
else if(is_observer()) {
// Find first team that is allowed to be observed.
// If not set here observer would be without fog until
// the first turn of observable side
size_t i;
for (i=0;i < gamestate().board_.teams().size();++i)
{
gui_->set_team(i);
if (!gamestate().board_.teams()[i].get_disallow_observers())
{
gui_->set_team(i);
}
}
}
}

init_managers();
gui2::tloadscreen::progress("start game");
//loadscreen_manager->reset();
gamestate().gamedata_.set_phase(game_data::PRELOAD);
gamestate().lua_kernel_->initialize(level);
init_managers();
gui2::tloadscreen::progress("start game");
//loadscreen_manager->reset();
gamestate().gamedata_.set_phase(game_data::PRELOAD);
gamestate().lua_kernel_->initialize(level);

plugins_context_.reset(new plugins_context("Game"));
plugins_context_->set_callback("save_game", boost::bind(&play_controller::save_game_auto, this, boost::bind(get_str, _1, "filename" )), true);
plugins_context_->set_callback("save_replay", boost::bind(&play_controller::save_replay_auto, this, boost::bind(get_str, _1, "filename" )), true);
plugins_context_->set_callback("quit", throw_end_level(), false);
plugins_context_.reset(new plugins_context("Game"));
plugins_context_->set_callback("save_game", boost::bind(&play_controller::save_game_auto, this, boost::bind(get_str, _1, "filename" )), true);
plugins_context_->set_callback("save_replay", boost::bind(&play_controller::save_replay_auto, this, boost::bind(get_str, _1, "filename" )), true);
plugins_context_->set_callback("quit", throw_end_level(), false);
});
//Do this after the loadingscreen, so that ita happens in the main thread.
gui_->join();
Expand Down
22 changes: 11 additions & 11 deletions src/wesnoth.cpp
Expand Up @@ -646,20 +646,20 @@ static int do_gameloop(const std::vector<std::string>& args)
gui2::tloadscreen::progress("load config");
res = config_manager.init_game_config(game_config_manager::NO_FORCE_RELOAD);

if(res == false) {
std::cerr << "could not initialize game config\n";
return;
}
gui2::tloadscreen::progress("init fonts");
if(res == false) {
std::cerr << "could not initialize game config\n";
return;
}
gui2::tloadscreen::progress("init fonts");

res = font::load_font_config();
if(res == false) {
std::cerr << "could not re-initialize fonts for the current language\n";
return;
res = font::load_font_config();
if(res == false) {
std::cerr << "could not re-initialize fonts for the current language\n";
return;
}

gui2::tloadscreen::progress("refresh addons");
refresh_addon_version_info_cache();
gui2::tloadscreen::progress("refresh addons");
refresh_addon_version_info_cache();
});

if(res == false) {
Expand Down

0 comments on commit 1368a05

Please sign in to comment.