added std::vector<teams>* argument to wml_animation(),

...replaced gamestatus reference
This commit is contained in:
Eugen Jiresch 2009-06-19 08:14:02 +00:00
parent a3b9335b8a
commit c8ab7dfeac
3 changed files with 8 additions and 8 deletions

View file

@ -2843,7 +2843,7 @@ WML_HANDLER_FUNCTION(redraw, /*event_info*/, cfg)
WML_HANDLER_FUNCTION(animate_unit, event_info, cfg)
{
const game_events::resources_t &rsrc = *game_events::resources;
unit_display::wml_animation(cfg, *rsrc.units, *rsrc.game_map, *rsrc.status_ptr, rsrc.controller->get_tod_manager(), event_info.loc1);
unit_display::wml_animation(cfg, *rsrc.units, *rsrc.game_map, *rsrc.status_ptr, rsrc.teams, rsrc.controller->get_tod_manager(), event_info.loc1);
}
WML_HANDLER_FUNCTION(label, /*event_info*/, cfg)

View file

@ -399,19 +399,19 @@ void unit_healing(unit& healed,map_location& healed_loc, std::vector<unit_map::i
}
void wml_animation_internal(unit_animator & animator,const vconfig &cfg, const gamemap& map, const gamestatus& game_status, const tod_manager& tod_mng, unit_map & units,const map_location& default_location = map_location::null_location);
void wml_animation(const vconfig &cfg,unit_map & units, const gamemap& map, const gamestatus& game_status, const tod_manager& tod_mng, const map_location& default_location)
void wml_animation_internal(unit_animator & animator,const vconfig &cfg, const gamemap& map, const gamestatus& game_status, const std::vector<team>* teams, const tod_manager& tod_mng, unit_map & units,const map_location& default_location = map_location::null_location);
void wml_animation(const vconfig &cfg,unit_map & units, const gamemap& map, const gamestatus& game_status, const std::vector<team>* teams, const tod_manager& tod_mng, const map_location& default_location)
{
game_display* disp = game_display::get_singleton();
if(!disp || disp->video().update_locked() || disp->video().faked()) return;
unit_animator animator;
wml_animation_internal(animator,cfg,map,game_status, tod_mng, units,default_location);
wml_animation_internal(animator,cfg,map,game_status, teams, tod_mng, units,default_location);
animator.start_animations();
animator.wait_for_end();
animator.set_all_standing();
}
void wml_animation_internal(unit_animator & animator,const vconfig &cfg, const gamemap& map, const gamestatus& game_status, const tod_manager& tod_mng,unit_map & units,const map_location& default_location)
void wml_animation_internal(unit_animator & animator,const vconfig &cfg, const gamemap& map, const gamestatus& game_status, const std::vector<team>* teams, const tod_manager& tod_mng,unit_map & units,const map_location& default_location)
{
unit_map::iterator u = units.find(default_location);
@ -473,7 +473,7 @@ void wml_animation_internal(unit_animator & animator,const vconfig &cfg, const g
vconfig t_filter = cfg.child("facing");
map_location secondary_loc = map_location::null_location;
if(!t_filter.empty()) {
terrain_filter filter(t_filter,map,game_status,tod_mng,*(game_status.teams),units);
terrain_filter filter(t_filter,map,game_status,tod_mng,*teams,units);
std::set<map_location> locs;
filter.get_locations(locs);
if(!locs.empty()) {
@ -488,7 +488,7 @@ void wml_animation_internal(unit_animator & animator,const vconfig &cfg, const g
const vconfig::child_list sub_anims = cfg.get_children("animate");
vconfig::child_list::const_iterator anim_itor;
for(anim_itor = sub_anims.begin(); anim_itor != sub_anims.end();anim_itor++) {
wml_animation_internal(animator,*anim_itor,map,game_status,tod_mng,units);
wml_animation_internal(animator,*anim_itor,map,game_status,teams,tod_mng,units);
}
}

View file

@ -78,7 +78,7 @@ void unit_healing(unit& healed,map_location& healed_loc, std::vector<unit_map::i
* this is used for the animate_unit action, but can easily be generalized if other wml-decribed animations are needed
*
*/
void wml_animation(const vconfig &cfg,unit_map & units, const gamemap& map, const gamestatus& game_status, const tod_manager& tod_mng, const map_location& default_location = map_location::null_location);
void wml_animation(const vconfig &cfg,unit_map & units, const gamemap& map, const gamestatus& game_status, const std::vector<team>* teams, const tod_manager& tod_mng, const map_location& default_location = map_location::null_location);
}