more moving around of backward compatibility stuff

This commit is contained in:
Jérémy Rosen 2007-11-02 18:50:35 +00:00
parent 0ca2b15fa3
commit 4403daa2e0
5 changed files with 6 additions and 8 deletions

View file

@ -256,7 +256,6 @@ public:
const std::string& image_halo() const { return cfg_["halo"]; }
const std::string& get_hit_sound() const { return cfg_["get_hit_sound"]; }
const std::string& die_sound() const { return cfg_["die_sound"]; }
const std::string& image_ellipse() const { return cfg_["ellipse"]; }
const std::string& usage() const { return cfg_["usage"]; }

View file

@ -452,6 +452,8 @@ void unit_animation::initialize_anims( std::vector<unit_animation> & animations,
animations.push_back(unit_animation(**anim_itor));
image::locator image_loc = animations.back().get_last_frame().image();
animations.back().add_frame(600,unit_frame(image_loc,600,"1~0:600"));
animations.back().sub_anims_["_death_sound"] = crude_animation();
animations.back().sub_anims_["_death_sound"].add_frame(1,unit_frame(image::locator(),1,"","",0,"","","","","",cfg["die_sound"]),true);
//lg::wml_error<<"death animations are deprecate, support will be removed in 1.3.11 (in unit "<<cfg["name"]<<")\n";
//lg::wml_error<<"please put it with an [animation] tag and apply_to=death flag\n";
}

View file

@ -179,10 +179,6 @@ void unit_die(const gamemap::location& loc, unit& loser,
if(!disp ||disp->video().update_locked() || disp->fogged(loc) || preferences::show_combat() == false) {
return;
}
const std::string& die_sound = loser.die_sound();
if(die_sound != "" && die_sound != "null") {
sound::play_sound(die_sound);
}
loser.set_dying(*disp,loc,attack,secondary_attack);
if(winner == NULL) { // Test to see if there is no victor.

View file

@ -161,14 +161,15 @@ unit_frame::unit_frame(const image::locator& image, int duration,
const std::string& highlight, const std::string& offset,
Uint32 blend_color, const std::string& blend_rate,
const std::string& in_halo, const std::string& halox, const std::string& haloy,
const image::locator & diag) :
const image::locator & diag,const std::string & sound) :
image_(image),image_diagonal_(diag),
halo_(in_halo,duration),
halo_x_(halox,duration),
halo_y_(haloy,duration),
duration_(duration),
blend_with_(blend_color), blend_ratio_(blend_rate,duration),
highlight_ratio_(highlight,duration),offset_(offset,duration)
highlight_ratio_(highlight,duration),offset_(offset,duration),
sound_(sound)
{
// let's decide of duration ourselves
duration_ = maximum<int>(duration_, highlight_ratio_.duration());

View file

@ -68,7 +68,7 @@ class unit_frame {
Uint32 blend_color = 0, const std::string& blend_rate = "",
const std::string & in_halo = "",
const std::string & halox = "",const std::string & haloy = "",
const image::locator & diag ="");
const image::locator & diag ="",const std::string & sound = "");
explicit unit_frame(const config& cfg);
image::locator image() const { return image_ ;}
image::locator image_diagonal() const { return image_diagonal_ ; }