make movement and attack anims be over castles by default.

might want to have more anims over castles later, if any artists want
to give feedback...
This commit is contained in:
Jérémy Rosen 2008-12-28 19:54:23 +00:00
parent 251a52e90d
commit 4a0ed3c065
2 changed files with 7 additions and 6 deletions

View file

@ -355,7 +355,7 @@ void unit_animation::fill_initial_animations( std::vector<unit_animation> & anim
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","",0,"0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,");
tmp_anim.unit_anim_.override(0,"","",0,"0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,","51");
tmp_anim.event_ = utils::split("movement");
animations.push_back(tmp_anim);
@ -365,7 +365,7 @@ void unit_animation::fill_initial_animations( std::vector<unit_animation> & anim
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(-150,"","",0,"0~0.6:150,0.6~0:150");
tmp_anim.unit_anim_.override(-150,"","",0,"0~0.6:150,0.6~0:150","51");
tmp_anim.event_ = utils::split("attack");
tmp_anim.primary_attack_filter_.push_back(config());
tmp_anim.primary_attack_filter_.back()["range"] = "melee";
@ -513,7 +513,7 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
}
(**anim_itor)["apply_to"] ="movement";
(**anim_itor)["layer"] =lexical_cast<std::string>(display::LAYER_UNIT_DEFAULT-display::LAYER_UNIT_FIRST);
(**anim_itor)["layer"] =lexical_cast<std::string>(display::LAYER_UNIT_MOVE_DEFAULT-display::LAYER_UNIT_FIRST);
animations.push_back(unit_animation(**anim_itor));
}
expanded_cfg = unit_animation::prepare_animation(cfg,"defend");
@ -545,7 +545,7 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
const config::child_list& attack_anims = expanded_cfg.get_children("attack_anim");
for(config::child_list::const_iterator d = attack_anims.begin(); d != attack_anims.end(); ++d) {
(**d)["apply_to"] ="attack";
(**d)["layer"] =lexical_cast<std::string>(display::LAYER_UNIT_DEFAULT-display::LAYER_UNIT_FIRST);
(**d)["layer"] =lexical_cast<std::string>(display::LAYER_UNIT_MOVE_DEFAULT-display::LAYER_UNIT_FIRST);
if((**d)["offset"].empty() && (**d).get_children("missile_frame").empty()) {
(**d)["offset"] ="0~0.6,0.6~0";
}
@ -606,12 +606,13 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
}
void unit_animation::particule::override( int start_time,const std::string highlight,const std::string blend_ratio ,Uint32 blend_color ,const std::string offset)
void unit_animation::particule::override( int start_time,const std::string highlight,const std::string blend_ratio ,Uint32 blend_color ,const std::string offset,const std::string layer)
{
set_begin_time(start_time);
if(!highlight.empty()) parameters_.highlight(highlight);
if(!offset.empty()) parameters_.offset(offset);
if(!blend_ratio.empty()) parameters_.blend(blend_ratio,blend_color);
if(!layer.empty()) parameters_.drawing_layer(layer);
}

View file

@ -83,7 +83,7 @@ class unit_animation
explicit particule(const config& cfg,const std::string frame_string ="frame");
virtual ~particule();
bool need_update() const;
void override(int start_time,const std::string highlight="", const std::string blend_ratio ="",Uint32 blend_color = 0,const std::string offset="");
void override(int start_time,const std::string highlight="", const std::string blend_ratio ="",Uint32 blend_color = 0,const std::string offset="",const std::string layer="");
void redraw( const frame_parameters& value,const map_location &src, const map_location &dst, const bool primary=false);
bool invalidate(const frame_parameters& value,const map_location &src, const map_location &dst, const bool primary = false);
void start_animation(int start_time, bool cycles=false);