Author: boucman
Date: Thu Nov 1 22:51:48 2007
New Revision: 21395
URL: http://svn.gna.org/viewcvs/wesnoth?rev=21395&view=rev
Log:
moving around more deprecated code, so I don't forget anything when upgrading...
Modified:
trunk/src/unit_animation.cpp
trunk/src/unit_display.cpp
Modified: trunk/src/unit_animation.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_animation.cpp?rev=21395&r1=21394&r2=21395&view=diff
==============================================================================
--- trunk/src/unit_animation.cpp (original)
+++ trunk/src/unit_animation.cpp Thu Nov 1 22:51:48 2007
@@ -415,6 +415,14 @@
if((**d)["offset"].empty() &&
(**d).get_children("missile_frame").empty()) {
(**d)["offset"] ="0~0.6,0.6~0";
}
+ if(!(**d).get_children("missile_frame").empty()) {
+ if(
(**d)["missile_offset"].empty())(**d)["missile_offset"] = "0~0.8";
+ config tmp;
+ tmp["duration"]="1";
+ (**d).add_child("missile_frame",tmp);
+ (**d).add_child_at("missile_frame",tmp,0);
+ }
+
animations.push_back(unit_animation(**d));
//lg::wml_error<<"attack 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=attack flag\n";
@@ -532,10 +540,6 @@
} else {
starting_frame_time_ =
atoi(cfg[frame_string+"start_time"].c_str());
}
- if(frame_string == "missile_") {
- // lg::wml_error To be deprecated eventually
- add_frame(1,unit_frame("",1),true);
- }
for(; range.first != range.second; ++range.first) {
unit_frame tmp_frame(**range.first);
@@ -549,14 +553,6 @@
blend_ratio_ =
progressive_double(cfg[frame_string+"blend_ratio"],get_animation_duration());
highlight_ratio_ =
progressive_double(cfg[frame_string+"alpha"],get_animation_duration());
offset_ =
progressive_double(cfg[frame_string+"offset"],get_animation_duration());
- if(offset_.does_not_change() && frame_string == "missile_") {
- // lg::wml_error To be deprecated eventually
- offset_=progressive_double("0~0.8",get_animation_duration());
- }
- if( frame_string == "missile_") {
- // lg::wml_error To be deprecated eventually
- add_frame(1,unit_frame("",1),true);
- }
if(!halo_.does_not_change() ||
!halo_x_.does_not_change() ||
Modified: trunk/src/unit_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_display.cpp?rev=21395&r1=21394&r2=21395&view=diff
==============================================================================
--- trunk/src/unit_display.cpp (original)
+++ trunk/src/unit_display.cpp Thu Nov 1 22:51:48 2007
@@ -173,18 +173,18 @@
}
void unit_die(const gamemap::location& loc, unit& loser,
-const attack_type* attack,const attack_type* secondary_attack, unit* winner)
+ const attack_type* attack,const attack_type* secondary_attack,
unit* winner)
{
game_display* disp = game_display::get_singleton();
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);
+ 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.
while(!loser.get_animation()->animation_finished()) {
@@ -194,7 +194,7 @@
events::pump();
disp->delay(10);
}
- return;
+ return;
}
winner->set_victorious(*disp,loc,attack,secondary_attack);
int start_time =
minimum<int>(loser.get_animation()->get_begin_time(),winner->get_animation()->get_begin_time());
@@ -204,10 +204,10 @@
while((!loser.get_animation()->animation_would_finish()) ||
((!winner->get_animation()->animation_would_finish()))) {
- disp->invalidate(loc);
- disp->draw();
- events::pump();
- disp->delay(10);
+ disp->invalidate(loc);
+ disp->draw();
+ events::pump();
+ disp->delay(10);
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits