From 280dd8e7edc6fd1d2893b481d4e9b0b0122755ab Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Sat, 21 Mar 2015 19:35:48 +0100 Subject: [PATCH] fix some indention --- src/ai/actions.cpp | 24 +++++++++++----------- src/ai/default/attack.cpp | 6 +++--- src/callable_objects.hpp | 2 +- src/cursor.cpp | 4 ++-- src/formula.cpp | 33 +++++++++++++++---------------- src/formula_callable.hpp | 10 +++++----- src/formula_debugger.cpp | 4 ++-- src/formula_function.hpp | 2 +- src/game_board.hpp | 2 +- src/game_config.hpp | 4 ++-- src/game_events/action_wml.cpp | 5 +++-- src/hotkey/hotkey_item.hpp | 4 ++-- src/image.cpp | 4 ++-- src/image_modifications.cpp | 1 + src/leader_scroll_dialog.cpp | 6 +++--- src/menu_events.cpp | 19 +++++++++--------- src/preferences.cpp | 8 ++++---- src/replay_controller.cpp | 6 +++--- src/scripting/game_lua_kernel.cpp | 2 +- src/scripting/lua_common.cpp | 4 ++-- src/server/game.hpp | 7 ++++--- src/side_filter.hpp | 4 ++-- src/statistics_dialog.hpp | 2 +- src/team.cpp | 15 +++++++------- src/team.hpp | 16 +++++++-------- src/terrain_builder.cpp | 6 +++--- src/theme.cpp | 2 +- src/unit.cpp | 4 ++-- src/unit.hpp | 4 ++-- src/unit_animation.cpp | 2 +- src/unit_animation.hpp | 10 +++++----- src/unit_animation_component.cpp | 2 +- src/unit_animation_component.hpp | 4 ++-- src/unit_display.cpp | 4 ++-- src/unit_display.hpp | 6 +++--- src/unit_frame.cpp | 12 +++++------ src/video.cpp | 26 ++++++++++++------------ 37 files changed, 139 insertions(+), 137 deletions(-) diff --git a/src/ai/actions.cpp b/src/ai/actions.cpp index 96f875c70687..5aa9c53d2d48 100644 --- a/src/ai/actions.cpp +++ b/src/ai/actions.cpp @@ -1123,31 +1123,31 @@ void sim_gamestate_changed(action_result *result, bool gamestate_changed){ std::ostream &operator<<(std::ostream &s, ai::attack_result const &r) { - s << r.do_describe(); - return s; + s << r.do_describe(); + return s; } std::ostream &operator<<(std::ostream &s, ai::move_result const &r) { - s << r.do_describe(); - return s; + s << r.do_describe(); + return s; } std::ostream &operator<<(std::ostream &s, ai::recall_result const &r) { - s << r.do_describe(); - return s; + s << r.do_describe(); + return s; } std::ostream &operator<<(std::ostream &s, ai::recruit_result const &r) { - s << r.do_describe(); - return s; + s << r.do_describe(); + return s; } std::ostream &operator<<(std::ostream &s, ai::stopunit_result const &r) { - s << r.do_describe(); - return s; + s << r.do_describe(); + return s; } std::ostream &operator<<(std::ostream &s, ai::synced_command_result const &r) { - s << r.do_describe(); - return s; + s << r.do_describe(); + return s; } diff --git a/src/ai/default/attack.cpp b/src/ai/default/attack.cpp index faef37967952..88618d7f5586 100644 --- a/src/ai/default/attack.cpp +++ b/src/ai/default/attack.cpp @@ -37,9 +37,9 @@ static lg::log_domain log_ai("ai/attack"); namespace ai { void attack_analysis::analyze(const gamemap& map, unit_map& units, - const readonly_context& ai_obj, - const move_map& dstsrc, const move_map& srcdst, - const move_map& enemy_dstsrc, double aggression) + const readonly_context& ai_obj, + const move_map& dstsrc, const move_map& srcdst, + const move_map& enemy_dstsrc, double aggression) { const unit_map::const_iterator defend_it = units.find(target); assert(defend_it != units.end()); diff --git a/src/callable_objects.hpp b/src/callable_objects.hpp index 6e628b63a72d..ae7251dacfaa 100644 --- a/src/callable_objects.hpp +++ b/src/callable_objects.hpp @@ -75,7 +75,7 @@ class terrain_callable : public game_logic::formula_callable { variant get_value(const std::string& key) const; void get_inputs(std::vector* inputs) const; - int do_compare(const formula_callable* callable) const; + int do_compare(const formula_callable* callable) const; private: const location loc_; const terrain_type &t_; diff --git a/src/cursor.cpp b/src/cursor.cpp index 6cc20b357f8a..2b229de28285 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -168,9 +168,9 @@ void set(CURSOR_TYPE type) // Causes problem on Mac: //if (cursor_image != NULL && cursor_image != SDL_GetCursor()) - SDL_SetCursor(cursor_image); + SDL_SetCursor(cursor_image); - SDL_ShowCursor(SDL_ENABLE); + SDL_ShowCursor(SDL_ENABLE); } void set_dragging(bool drag) diff --git a/src/formula.cpp b/src/formula.cpp index 0fdebf765b5f..1f07cf1061b9 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -31,8 +31,7 @@ void formula_callable::set_value(const std::string& key, const variant& /*value* } -map_formula_callable::map_formula_callable( - const formula_callable* fallback) : +map_formula_callable::map_formula_callable(const formula_callable* fallback) : formula_callable(false), values_(), fallback_(fallback) @@ -249,16 +248,16 @@ class dot_callable : public formula_callable { const formula_callable& global_, &local_; void get_inputs(std::vector* inputs) const { - return local_.get_inputs(inputs); + return local_.get_inputs(inputs); } variant get_value(const std::string& key) const { - variant v = local_.query_value(key); + variant v = local_.query_value(key); - if ( v == variant() ) - return global_.query_value(key); - else - return v; + if ( v == variant() ) + return global_.query_value(key); + else + return v; } }; @@ -278,17 +277,17 @@ class dot_expression : public formula_expression { const variant left = left_->evaluate(variables,add_debug_info(fdb,0,"left.")); if(!left.is_callable()) { if(left.is_list()) { - list_callable list_call(left); - dot_callable callable(variables, list_call); + list_callable list_call(left); + dot_callable callable(variables, list_call); return right_->evaluate(callable,fdb); } return left; } - dot_callable callable(variables, *left.as_callable()); - return right_->evaluate(callable,add_debug_info(fdb,1,".right")); - } + dot_callable callable(variables, *left.as_callable()); + return right_->evaluate(callable,add_debug_info(fdb,1,".right")); + } expression_ptr left_, right_; }; @@ -852,7 +851,7 @@ expression_ptr parse_expression(const token* i1, const token* i2, function_symbo operator_precedence(*i)) ) { op = i; } - operator_group = true; + operator_group = true; } else { operator_group = false; } @@ -864,15 +863,15 @@ expression_ptr parse_expression(const token* i1, const token* i2, function_symbo } else if( (i2-1)->type == TOKEN_RSQUARE) { //check if there is [ ] : either a list/map definition, or a operator const token* tok = i2-2; int square_parens = 0; - bool is_map = false; + bool is_map = false; while ( (tok->type != TOKEN_LSQUARE || square_parens) && tok != i1) { if (tok->type == TOKEN_RSQUARE) { square_parens++; } else if(tok->type == TOKEN_LSQUARE) { square_parens--; } else if( (tok->type == TOKEN_POINTER) && !square_parens ) { - is_map = true; - } + is_map = true; + } --tok; } if (tok->type == TOKEN_LSQUARE) { diff --git a/src/formula_callable.hpp b/src/formula_callable.hpp index 2ef1770e8135..8ce81302aee4 100644 --- a/src/formula_callable.hpp +++ b/src/formula_callable.hpp @@ -63,7 +63,7 @@ class formula_callable : public reference_counted_object { virtual void get_inputs(std::vector* /*inputs*/) const {} - //note: this function should NOT overwrite str, but append text to it! + //note: this function should NOT overwrite str, but append text to it! void serialize(std::string& str) const { serialize_to_string(str); } @@ -85,7 +85,7 @@ class formula_callable : public reference_counted_object { return this < callable ? -1 : (this == callable ? 0 : 1); } - //note: this function should NOT overwrite str, but append text to it! + //note: this function should NOT overwrite str, but append text to it! virtual void serialize_to_string(std::string& /*str*/) const { throw type_error("Tried to serialize type which cannot be serialized"); } @@ -93,10 +93,10 @@ class formula_callable : public reference_counted_object { //priority for objects that are derived from this class, used in do_compare //when comparing objects of different types //for example: formula_callable < terrain_callable < unit_type_callable ... - enum TYPE { FORMULA_C, TERRAIN_C, LOCATION_C, UNIT_TYPE_C, UNIT_C, - ATTACK_TYPE_C, MOVE_PARTIAL_C, MOVE_C, ATTACK_C, MOVE_MAP_C }; + enum TYPE { FORMULA_C, TERRAIN_C, LOCATION_C, UNIT_TYPE_C, UNIT_C, + ATTACK_TYPE_C, MOVE_PARTIAL_C, MOVE_C, ATTACK_C, MOVE_MAP_C }; - TYPE type_; + TYPE type_; private: virtual variant get_value(const std::string& key) const = 0; bool has_self_; diff --git a/src/formula_debugger.cpp b/src/formula_debugger.cpp index c84cafc13d2d..460e36040b03 100644 --- a/src/formula_debugger.cpp +++ b/src/formula_debugger.cpp @@ -86,7 +86,7 @@ bool debug_info::evaluated() const void debug_info::set_evaluated(bool evaluated) { - evaluated_ = evaluated; + evaluated_ = evaluated; } @@ -370,7 +370,7 @@ void formula_debugger::add_breakpoint_continue_to_end() void formula_debugger::add_breakpoint_step_into() { - breakpoints_.push_back(breakpoint_ptr(new step_in_breakpoint(*this))); + breakpoints_.push_back(breakpoint_ptr(new step_in_breakpoint(*this))); LOG_FDB << "added 'step into' breakpoint"<< std::endl; } diff --git a/src/formula_function.hpp b/src/formula_function.hpp index 6d6f60c9f13f..efa773a1a3cb 100644 --- a/src/formula_function.hpp +++ b/src/formula_function.hpp @@ -40,7 +40,7 @@ class formula_expression { private: virtual variant execute(const formula_callable& variables, formula_debugger *fdb = NULL) const = 0; const char* name_; - friend class formula_debugger; + friend class formula_debugger; }; typedef boost::shared_ptr expression_ptr; diff --git a/src/game_board.hpp b/src/game_board.hpp index ff10a91072b7..e8cd7ddc69b4 100644 --- a/src/game_board.hpp +++ b/src/game_board.hpp @@ -127,7 +127,7 @@ class game_board : public display_context { void overlay_map (const gamemap & o, const config & cfg, map_location loc, bool border); bool change_terrain(const map_location &loc, const std::string &t, - const std::string & mode, bool replace_if_failed); //used only by lua + const std::string & mode, bool replace_if_failed); //used only by lua // Global accessor from unit.hpp diff --git a/src/game_config.hpp b/src/game_config.hpp index 42f1a8740d7e..4b944f6868ad 100644 --- a/src/game_config.hpp +++ b/src/game_config.hpp @@ -84,9 +84,9 @@ namespace game_config namespace images { extern std::string game_title, - game_title_background, + game_title_background, // orbs and hp/xp bar - orb, + orb, energy, // flags flag, diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index ac4532716930..b4f517975702 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -550,8 +550,9 @@ WML_HANDLER_FUNCTION(do_command, /*event_info*/, cfg) /*data*/ i.get_child().get_parsed_config(), /*use_undo*/ true, /*show*/ true, - /*error_handler*/ &on_replay_error); - } + /*error_handler*/ &on_replay_error + ); + } } /// Experimental data persistence diff --git a/src/hotkey/hotkey_item.hpp b/src/hotkey/hotkey_item.hpp index 42ea143d56a3..a3147a00e8f3 100644 --- a/src/hotkey/hotkey_item.hpp +++ b/src/hotkey/hotkey_item.hpp @@ -27,7 +27,7 @@ class hotkey_item { explicit hotkey_item(const std::string& command) : command_(command), - shift_(false), ctrl_(false), cmd_(false), alt_(false), + shift_(false), ctrl_(false), cmd_(false), alt_(false), character_(-1), keycode_(-1), joystick_(-1), mouse_(-1), button_(-1), hat_(-1), value_(-1), @@ -36,7 +36,7 @@ class hotkey_item { explicit hotkey_item(const config& cfg, bool is_default): command_("null"), - shift_(false), ctrl_(false), cmd_(false), alt_(false), + shift_(false), ctrl_(false), cmd_(false), alt_(false), character_(-1), keycode_(-1), joystick_(-1), mouse_(-1), button_(-1), hat_(-1), value_(-1), diff --git a/src/image.cpp b/src/image.cpp index fb2368ff17ce..a090015f403a 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1291,7 +1291,7 @@ std::string describe_versions() ss << "Compiled with SDL_image version: " << static_cast (compile_version.major) << "." << static_cast (compile_version.minor) << "." - << static_cast (compile_version.patch) << " \n"; + << static_cast (compile_version.patch) << " \n"; #endif #ifdef Image_Linked_Version @@ -1299,7 +1299,7 @@ std::string describe_versions() ss << "Running with SDL_image version: " << static_cast (link_version->major) << "." << static_cast (link_version->minor) << "." - << static_cast (link_version->patch) << " .\n"; + << static_cast (link_version->patch) << " .\n"; #endif return ss.str(); diff --git a/src/image_modifications.cpp b/src/image_modifications.cpp index eb93d080347d..06442cdbbb4b 100644 --- a/src/image_modifications.cpp +++ b/src/image_modifications.cpp @@ -557,6 +557,7 @@ namespace { * @param type The modification type to be registered (unquoted) * @param args_var The name for the string argument provided */ +//FIXME: simplyfy this macro like WML_HANDLER_FUNCTION. #define REGISTER_MOD_PARSER(type, args_var) \ modification* parse_##type##_mod(const std::string&); \ struct parse_##type##_mod_registration \ diff --git a/src/leader_scroll_dialog.cpp b/src/leader_scroll_dialog.cpp index 801d63ca4068..1de4136397c3 100644 --- a/src/leader_scroll_dialog.cpp +++ b/src/leader_scroll_dialog.cpp @@ -136,9 +136,9 @@ void status_table(display& gui, int selected) str << utils::half_signed_value(data.gold) << COLUMN_SEPARATOR; } str << data.villages; - if(!(viewing_team.uses_fog() || viewing_team.uses_shroud())) { - str << "/" << map.villages().size(); - } + if(!(viewing_team.uses_fog() || viewing_team.uses_shroud())) { + str << "/" << map.villages().size(); + } str << COLUMN_SEPARATOR << data.units << COLUMN_SEPARATOR << data.upkeep << COLUMN_SEPARATOR << (data.net_income < 0 ? font::BAD_TEXT : font::NULL_MARKUP) << utils::signed_value(data.net_income); diff --git a/src/menu_events.cpp b/src/menu_events.cpp index 809f3b6d933a..3f7e866dd0d3 100644 --- a/src/menu_events.cpp +++ b/src/menu_events.cpp @@ -295,9 +295,9 @@ void menu_handler::status_table(int selected) str << utils::half_signed_value(data.gold) << COLUMN_SEPARATOR; } str << data.villages; - if(!(viewing_team.uses_fog() || viewing_team.uses_shroud())) { - str << "/" << map().villages().size(); - } + if(!(viewing_team.uses_fog() || viewing_team.uses_shroud())) { + str << "/" << map().villages().size(); + } str << COLUMN_SEPARATOR << data.units << COLUMN_SEPARATOR << data.upkeep << COLUMN_SEPARATOR << (data.net_income < 0 ? font::BAD_TEXT : font::NULL_MARKUP) << utils::signed_value(data.net_income); @@ -512,13 +512,12 @@ void menu_handler::preferences() void menu_handler::show_chat_log() { - config c; - c["name"] = "prototype of chat log"; - gui2::tchat_log chat_log_dialog(vconfig(c), resources::recorder); - chat_log_dialog.show(gui_->video()); - //std::string text = resources::recorder->build_chat_log(); - //gui::show_dialog(*gui_,NULL,_("Chat Log"),"",gui::CLOSE_ONLY,NULL,NULL,"",&text); - + config c; + c["name"] = "prototype of chat log"; + gui2::tchat_log chat_log_dialog(vconfig(c), resources::recorder); + chat_log_dialog.show(gui_->video()); + //std::string text = resources::recorder->build_chat_log(); + //gui::show_dialog(*gui_,NULL,_("Chat Log"),"",gui::CLOSE_ONLY,NULL,NULL,"",&text); } void menu_handler::show_help() diff --git a/src/preferences.cpp b/src/preferences.cpp index 101e2ffeecaf..7bd03bb87266 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -93,11 +93,11 @@ base_manager::~base_manager() void write_preferences() { - #ifndef _WIN32 +#ifndef _WIN32 bool prefs_file_existed = access(filesystem::get_prefs_file().c_str(), F_OK) == 0; - #endif +#endif try { filesystem::scoped_ostream prefs_file = filesystem::ostream_file(filesystem::get_prefs_file()); @@ -107,7 +107,7 @@ void write_preferences() } - #ifndef _WIN32 +#ifndef _WIN32 if(!prefs_file_existed) { @@ -117,7 +117,7 @@ void write_preferences() } - #endif +#endif } diff --git a/src/replay_controller.cpp b/src/replay_controller.cpp index 3a9fbf66fc61..ed4854d55264 100644 --- a/src/replay_controller.cpp +++ b/src/replay_controller.cpp @@ -393,7 +393,7 @@ void replay_controller::replay_next_turn() play_turn(); - if (!is_skipping_replay() || !is_playing_){ + if (!is_skipping_replay() || !is_playing_) { gui_->scroll_to_leader(player_number_,game_display::ONSCREEN,false); } @@ -407,10 +407,10 @@ void replay_controller::replay_next_move_or_side(bool one_move) play_move_or_side(one_move); while (current_team().is_empty()) { - play_move_or_side(one_move); + play_move_or_side(one_move); } - if ( (!is_skipping_replay() || !is_playing_) && (last_replay_action == REPLAY_FOUND_END_TURN) ){ + if ( (!is_skipping_replay() || !is_playing_) && (last_replay_action == REPLAY_FOUND_END_TURN) ){ gui_->scroll_to_leader(player_number_,game_display::ONSCREEN,false); } diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 4f55fb6c580f..a396983b798b 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -1256,7 +1256,7 @@ int game_lua_kernel::impl_game_config_get(lua_State *L) return_cfgref_attrib("era", game_config_manager::get()->game_config().find_child("era","id",mp_settings.mp_era)); //^ finds the era with name matching mp_era, and creates a lua reference from the config of that era. - //This code for SigurdFD, not the cleanest implementation but seems to work just fine. + //This code for SigurdFD, not the cleanest implementation but seems to work just fine. config::const_child_itors its = game_config_manager::get()->game_config().child_range("era"); std::string eras_list((*(its.first))["id"]); ++its.first; diff --git a/src/scripting/lua_common.cpp b/src/scripting/lua_common.cpp index 8ac9762bfb2f..ca6dcec494d1 100644 --- a/src/scripting/lua_common.cpp +++ b/src/scripting/lua_common.cpp @@ -291,8 +291,8 @@ std::string register_vconfig_metatable(lua_State *L) static luaL_Reg const callbacks[] = { { "__gc", &impl_vconfig_collect}, - { "__index", &impl_vconfig_get}, - { "__len", &impl_vconfig_size}, + { "__index", &impl_vconfig_get}, + { "__len", &impl_vconfig_size}, { NULL, NULL } }; luaL_setfuncs(L, callbacks, 0); diff --git a/src/server/game.hpp b/src/server/game.hpp index 840a7a94e363..1d7ec99fcfea 100644 --- a/src/server/game.hpp +++ b/src/server/game.hpp @@ -133,9 +133,10 @@ class game const user_vector all_game_users() const; void start_game(const player_map::const_iterator starter); - void perform_controller_tweaks(); //this is performed just before starting and before [start_game] signal - //send scenario_diff's specific to each client so that they locally - //control their human sides + //this is performed just before starting and before [start_game] signal + //send scenario_diff's specific to each client so that they locally + //control their human sides + void perform_controller_tweaks(); void update_game(); diff --git a/src/side_filter.hpp b/src/side_filter.hpp index 4f99d6f8b753..da286582cb9b 100644 --- a/src/side_filter.hpp +++ b/src/side_filter.hpp @@ -65,8 +65,8 @@ class side_filter { mutable boost::scoped_ptr ufilter_; mutable boost::scoped_ptr allied_filter_; mutable boost::scoped_ptr enemy_filter_; - mutable boost::scoped_ptr has_ally_filter_; - mutable boost::scoped_ptr has_enemy_filter_; + mutable boost::scoped_ptr has_ally_filter_; + mutable boost::scoped_ptr has_enemy_filter_; }; #endif diff --git a/src/statistics_dialog.hpp b/src/statistics_dialog.hpp index f5f2905eb1c2..15c89c8df7c2 100644 --- a/src/statistics_dialog.hpp +++ b/src/statistics_dialog.hpp @@ -30,7 +30,7 @@ class statistics_dialog : public gui::dialog statistics_dialog(game_display &disp, const std::string& title, const unsigned int team, - const std::string& team_id, + const std::string& team_id, const std::string& player); ~statistics_dialog(); protected: diff --git a/src/team.cpp b/src/team.cpp index a5abe948b23b..c4ad23cc7b54 100644 --- a/src/team.cpp +++ b/src/team.cpp @@ -796,15 +796,16 @@ bool team::shroud_map::copy_from(const std::vector& maps) return cleared; } -const color_range team::get_side_color_range(int side){ - std::string index = get_side_color_index(side); - std::map::iterator gp=game_config::team_rgb_range.find(index); +const color_range team::get_side_color_range(int side) +{ + std::string index = get_side_color_index(side); + std::map::iterator gp=game_config::team_rgb_range.find(index); - if(gp != game_config::team_rgb_range.end()){ - return(gp->second); - } + if(gp != game_config::team_rgb_range.end()){ + return(gp->second); + } - return(color_range(0x00FF0000,0x00FFFFFF,0x00000000,0x00FF0000)); + return(color_range(0x00FF0000,0x00FFFFFF,0x00000000,0x00FF0000)); } SDL_Color team::get_side_color(int side) diff --git a/src/team.hpp b/src/team.hpp index b9a458ce0b80..ae5aa4798daf 100644 --- a/src/team.hpp +++ b/src/team.hpp @@ -53,17 +53,17 @@ class team : public savegame::savegame_config //enum DEFEAT_CONDITION {NO_LEADER, NO_UNITS, NEVER, ALWAYS}; MAKE_ENUM(CONTROLLER, - (HUMAN, "human") - (AI, "ai") - (NETWORK, "network") - (NETWORK_AI, "network_ai") - (EMPTY, "null") + (HUMAN, "human") + (AI, "ai") + (NETWORK, "network") + (NETWORK_AI, "network_ai") + (EMPTY, "null") ) MAKE_ENUM(PROXY_CONTROLLER, - (PROXY_HUMAN, "human") - (PROXY_AI, "ai") - (PROXY_IDLE, "idle") + (PROXY_HUMAN, "human") + (PROXY_AI, "ai") + (PROXY_IDLE, "idle") ) MAKE_ENUM(DEFEAT_CONDITION, diff --git a/src/terrain_builder.cpp b/src/terrain_builder.cpp index 49fe5b13e646..aa1b7aaf86f3 100644 --- a/src/terrain_builder.cpp +++ b/src/terrain_builder.cpp @@ -186,9 +186,9 @@ void terrain_builder::tilemap::reload(int x, int y) { x_ = x; y_ = y; - std::vector new_tiles((x + 4) * (y + 4)); - tiles_.swap(new_tiles); - reset(); + std::vector new_tiles((x + 4) * (y + 4)); + tiles_.swap(new_tiles); + reset(); } bool terrain_builder::tilemap::on_map(const map_location &loc) const diff --git a/src/theme.cpp b/src/theme.cpp index 2728632bd140..b9697e1dab11 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -37,7 +37,7 @@ namespace { const int YDim = 768; const size_t DefaultFontSize = font::SIZE_NORMAL; - const Uint32 DefaultFontRGB = 0x00C8C8C8; + const Uint32 DefaultFontRGB = 0x00C8C8C8; _rect ref_rect = { 0, 0, 0, 0 }; } diff --git a/src/unit.cpp b/src/unit.cpp index a4916c2f89df..3ff3f634eaf3 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -117,7 +117,7 @@ void intrusive_ptr_add_ref(const unit * u) // then feel free to remove the next line assert(u->ref_count_ < 100000); LOG_UT << "Adding a reference to a unit: id = " << u->id() << ", uid = " << u->underlying_id() << ", refcount = " << u->ref_count() << " ptr:" << u << std::endl; - if (u->ref_count_ == 0) { + if (u->ref_count_ == 0) { LOG_UT << "Freshly constructed" << std::endl; } ++(u->ref_count_); @@ -2169,7 +2169,7 @@ unit_movement_resetter::~unit_movement_resetter() bool unit::matches_id(const std::string& unit_id) const { - return id_ == unit_id; + return id_ == unit_id; } diff --git a/src/unit.hpp b/src/unit.hpp index 2570e0fc534f..5a8e11a81213 100644 --- a/src/unit.hpp +++ b/src/unit.hpp @@ -299,8 +299,8 @@ class unit bool can_advance() const { return advances_to_.empty()==false || get_modification_advances().empty() == false; } bool advances() const { return experience_ >= max_experience() && can_advance(); } - std::map advancement_icons() const; - std::vector > amla_icons() const; + std::map advancement_icons() const; + std::vector > amla_icons() const; std::vector get_modification_advances() const; config::const_child_itors modification_advancements() const diff --git a/src/unit_animation.cpp b/src/unit_animation.cpp index d59dac8beaf0..72b7ab203a17 100644 --- a/src/unit_animation.cpp +++ b/src/unit_animation.cpp @@ -1393,7 +1393,7 @@ void unit_animator::wait_until(int animation_time) const std::min(10, static_cast((animation_time - get_animation_time()) * speed)))); resources::controller->play_slice(false); - end_tick = animated_units_[0].my_unit->anim_comp().get_animation()->time_to_tick(animation_time); + end_tick = animated_units_[0].my_unit->anim_comp().get_animation()->time_to_tick(animation_time); } disp->delay(std::max(0,end_tick - SDL_GetTicks() +5)); new_animation_frame(); diff --git a/src/unit_animation.hpp b/src/unit_animation.hpp index 04352d57fc52..61c11eed25bd 100644 --- a/src/unit_animation.hpp +++ b/src/unit_animation.hpp @@ -49,7 +49,7 @@ class unit_animation void update_last_draw_time(); int get_begin_time() const; int get_end_time() const; - int time_to_tick(int animation_time) const { return unit_anim_.time_to_tick(animation_time); } + int time_to_tick(int animation_time) const { return unit_anim_.time_to_tick(animation_time); } int get_animation_time() const{ return unit_anim_.get_animation_time() ; } int get_animation_time_potential() const{ return unit_anim_.get_animation_time_potential() ; } void start_animation(int start_time @@ -59,8 +59,8 @@ class unit_animation , const Uint32 text_color = 0 , const bool accelerate = true); void update_parameters(const map_location &src, const map_location &dst); - void pause_animation(); - void restart_animation(); + void pause_animation(); + void restart_animation(); int get_current_frame_begin_time() const{ return unit_anim_.get_current_frame_begin_time() ; } void redraw(frame_parameters& value, halo::manager & halo_man); void clear_haloes(); @@ -191,8 +191,8 @@ class unit_animator , const attack_type* second_attack = NULL , int value2 = 0); void start_animations(); - void pause_animation(); - void restart_animation(); + void pause_animation(); + void restart_animation(); void clear(){start_time_ = INT_MIN ; animated_units_.clear();} void set_all_standing(); diff --git a/src/unit_animation_component.cpp b/src/unit_animation_component.cpp index 614253c3d8a4..ce2196c134c9 100644 --- a/src/unit_animation_component.cpp +++ b/src/unit_animation_component.cpp @@ -188,7 +188,7 @@ void unit_animation_component::reset_after_advance(const unit_type * newtype) } refreshing_ = false; - anim_.reset(); + anim_.reset(); } void unit_animation_component::apply_new_animation_effect(const config & effect) { diff --git a/src/unit_animation_component.hpp b/src/unit_animation_component.hpp index cd2dfedc51cd..9351281d7626 100644 --- a/src/unit_animation_component.hpp +++ b/src/unit_animation_component.hpp @@ -62,8 +62,8 @@ class unit_animation_component /** Chooses an appropriate animation from the list of known animations. */ const unit_animation* choose_animation(const display& disp, - const map_location& loc, const std::string& event, - const map_location& second_loc = map_location::null_location(), + const map_location& loc, const std::string& event, + const map_location& second_loc = map_location::null_location(), const int damage=0, const unit_animation::hit_type hit_type = unit_animation::INVALID, const attack_type* attack=NULL,const attack_type* second_attack = NULL, diff --git a/src/unit_display.cpp b/src/unit_display.cpp index 0a70695f023e..b4bb012e71ff 100644 --- a/src/unit_display.cpp +++ b/src/unit_display.cpp @@ -47,7 +47,7 @@ static std::string number_and_text(int number, const std::string & text) if ( number == 0 ) return text; - std::ostringstream result; + std::ostringstream result; if ( text.empty() ) result << number; @@ -568,7 +568,7 @@ void unit_die(const map_location& loc, unit& loser, void unit_attack(display * disp, game_board & board, const map_location& a, const map_location& b, int damage, const attack_type& attack, const attack_type* secondary_attack, - int swing,std::string hit_text,int drain_amount,std::string att_text) + int swing,std::string hit_text,int drain_amount,std::string att_text) { if(!disp ||disp->video().update_locked() || disp->video().faked() || (disp->fogged(a) && disp->fogged(b)) || preferences::show_combat() == false) { diff --git a/src/unit_display.hpp b/src/unit_display.hpp index d211dbf693b8..8de4526f6eb8 100644 --- a/src/unit_display.hpp +++ b/src/unit_display.hpp @@ -100,9 +100,9 @@ void unit_sheath_weapon( const map_location& loc, unit* u=NULL, const attack_typ * Note: this only shows the effect, it doesn't actually kill the unit. */ void unit_die( const map_location& loc, unit& u, - const attack_type* attack=NULL, const attack_type* secondary_attack=NULL, - const map_location& winner_loc=map_location::null_location(), - unit* winner=NULL); + const attack_type* attack=NULL, const attack_type* secondary_attack=NULL, + const map_location& winner_loc=map_location::null_location(), + unit* winner=NULL); /** diff --git a/src/unit_frame.cpp b/src/unit_frame.cpp index 633b2e05060b..88f5255f07e5 100644 --- a/src/unit_frame.cpp +++ b/src/unit_frame.cpp @@ -694,7 +694,7 @@ void unit_frame::redraw(const int frame_time,bool on_start_time,bool in_scope_of game_display::get_singleton()->render_image( my_x,my_y, static_cast(display::LAYER_UNIT_FIRST+current_data.drawing_layer), src, image, facing_west, false, - ftofxp(current_data.highlight_ratio), current_data.blend_with, + ftofxp(current_data.highlight_ratio), current_data.blend_with, current_data.blend_ratio,current_data.submerge,!facing_north); } halo_id = halo::handle(); //halo::NO_HALO; @@ -890,12 +890,12 @@ const frame_parameters unit_frame::merge_parameters(int current_time,const frame /** engine provides a string for "petrified" and "team color" modifications note that image_mod is the complete modification and halo_mod is only the TC part see unit.cpp, we know that and use it*/ - result.image_mod = current_val.image_mod +animation_val.image_mod; + result.image_mod = current_val.image_mod +animation_val.image_mod; if(primary) { - result.image_mod += engine_val.image_mod; - } else { - result.image_mod += engine_val.halo_mod; - } + result.image_mod += engine_val.image_mod; + } else { + result.image_mod += engine_val.halo_mod; + } assert(engine_val.halo.empty()); result.halo = current_val.halo.empty()?animation_val.halo:current_val.halo; diff --git a/src/video.cpp b/src/video.cpp index 0c3f29afbf67..fc0b6aae2917 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -666,24 +666,24 @@ bool CVideo::update_locked() const Uint8 CVideo::window_state() { - Uint8 state = 0; - Uint32 flags = 0; + Uint8 state = 0; + Uint32 flags = 0; if(!window) { return state; } - flags = SDL_GetWindowFlags(*window); - if ((flags & SDL_WINDOW_SHOWN) && !(flags & SDL_WINDOW_MINIMIZED)) { - state |= SDL_APPACTIVE; - } - if (flags & SDL_WINDOW_INPUT_FOCUS) { - state |= SDL_APPINPUTFOCUS; - } - if (flags & SDL_WINDOW_MOUSE_FOCUS) { - state |= SDL_APPMOUSEFOCUS; - } - return state; + flags = SDL_GetWindowFlags(*window); + if ((flags & SDL_WINDOW_SHOWN) && !(flags & SDL_WINDOW_MINIMIZED)) { + state |= SDL_APPACTIVE; + } + if (flags & SDL_WINDOW_INPUT_FOCUS) { + state |= SDL_APPINPUTFOCUS; + } + if (flags & SDL_WINDOW_MOUSE_FOCUS) { + state |= SDL_APPMOUSEFOCUS; + } + return state; } void CVideo::set_window_title(const std::string& title)