fix some indention
This commit is contained in:
parent
4872b1d91b
commit
280dd8e7ed
37 changed files with 139 additions and 137 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
variant get_value(const std::string& key) const;
|
||||
void get_inputs(std::vector<game_logic::formula_input>* 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_;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 @@ private:
|
|||
const formula_callable& global_, &local_;
|
||||
|
||||
void get_inputs(std::vector<formula_input>* 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 @@ private:
|
|||
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) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
virtual void get_inputs(std::vector<formula_input>* /*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 @@ protected:
|
|||
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 @@ protected:
|
|||
//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_;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
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<formula_expression> expression_ptr;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
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 @@ public:
|
|||
|
||||
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),
|
||||
|
|
|
@ -1291,7 +1291,7 @@ std::string describe_versions()
|
|||
ss << "Compiled with SDL_image version: "
|
||||
<< static_cast<int> (compile_version.major) << "."
|
||||
<< static_cast<int> (compile_version.minor) << "."
|
||||
<< static_cast<int> (compile_version.patch) << " \n";
|
||||
<< static_cast<int> (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<int> (link_version->major) << "."
|
||||
<< static_cast<int> (link_version->minor) << "."
|
||||
<< static_cast<int> (link_version->patch) << " .\n";
|
||||
<< static_cast<int> (link_version->patch) << " .\n";
|
||||
#endif
|
||||
|
||||
return ss.str();
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -133,9 +133,10 @@ public:
|
|||
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();
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ private:
|
|||
mutable boost::scoped_ptr<unit_filter> ufilter_;
|
||||
mutable boost::scoped_ptr<side_filter> allied_filter_;
|
||||
mutable boost::scoped_ptr<side_filter> enemy_filter_;
|
||||
mutable boost::scoped_ptr<side_filter> has_ally_filter_;
|
||||
mutable boost::scoped_ptr<side_filter> has_enemy_filter_;
|
||||
mutable boost::scoped_ptr<side_filter> has_ally_filter_;
|
||||
mutable boost::scoped_ptr<side_filter> has_enemy_filter_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
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:
|
||||
|
|
15
src/team.cpp
15
src/team.cpp
|
@ -796,15 +796,16 @@ bool team::shroud_map::copy_from(const std::vector<const shroud_map*>& maps)
|
|||
return cleared;
|
||||
}
|
||||
|
||||
const color_range team::get_side_color_range(int side){
|
||||
std::string index = get_side_color_index(side);
|
||||
std::map<std::string, color_range>::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<std::string, color_range>::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)
|
||||
|
|
16
src/team.hpp
16
src/team.hpp
|
@ -53,17 +53,17 @@ public:
|
|||
//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,
|
||||
|
|
|
@ -186,9 +186,9 @@ void terrain_builder::tilemap::reload(int x, int y)
|
|||
{
|
||||
x_ = x;
|
||||
y_ = y;
|
||||
std::vector<terrain_builder::tile> new_tiles((x + 4) * (y + 4));
|
||||
tiles_.swap(new_tiles);
|
||||
reset();
|
||||
std::vector<terrain_builder::tile> new_tiles((x + 4) * (y + 4));
|
||||
tiles_.swap(new_tiles);
|
||||
reset();
|
||||
}
|
||||
|
||||
bool terrain_builder::tilemap::on_map(const map_location &loc) const
|
||||
|
|
|
@ -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 };
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -299,8 +299,8 @@ public:
|
|||
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<std::string,std::string> advancement_icons() const;
|
||||
std::vector<std::pair<std::string,std::string> > amla_icons() const;
|
||||
std::map<std::string,std::string> advancement_icons() const;
|
||||
std::vector<std::pair<std::string,std::string> > amla_icons() const;
|
||||
|
||||
std::vector<config> get_modification_advances() const;
|
||||
config::const_child_itors modification_advancements() const
|
||||
|
|
|
@ -1393,7 +1393,7 @@ void unit_animator::wait_until(int animation_time) const
|
|||
std::min<int>(10,
|
||||
static_cast<int>((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<int>(0,end_tick - SDL_GetTicks() +5));
|
||||
new_animation_frame();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -62,8 +62,8 @@ public:
|
|||
|
||||
/** 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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -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::tdrawing_layer>(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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue