Author: mordante
Date: Sun Jun 22 11:29:36 2008
New Revision: 27386
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27386&view=rev
Log:
Added constructor to initialize all members.
Initialized all members in the main class.
Removed the C style struct typedef.
Modified:
trunk/src/unit_animation.hpp
Modified: trunk/src/unit_animation.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_animation.hpp?rev=27386&r1=27385&r2=27386&view=diff
==============================================================================
--- trunk/src/unit_animation.hpp (original)
+++ trunk/src/unit_animation.hpp Sun Jun 22 11:29:36 2008
@@ -118,7 +118,13 @@
class unit_animator
{
public:
- unit_animator():start_time_(INT_MIN){};
+ unit_animator() :
+ animated_units_(),
+ start_time_(INT_MIN)
+ {
+ }
+
+
void add_animation(unit* animated_unit,const std::string& event,
const gamemap::location &src =
gamemap::location::null_location,
const int value=0,bool with_bars = false,bool
cycles = false,
@@ -146,7 +152,19 @@
void wait_for_end() const;
void wait_until( int animation_time) const;
private:
- typedef struct {
+ struct anim_elem {
+
+ anim_elem() :
+ my_unit(0),
+ animation(0),
+ text(),
+ text_color(0),
+ src(),
+ with_bars(false),
+ cycles(false)
+ {
+ }
+
unit *my_unit;
const unit_animation * animation;
std::string text;
@@ -154,7 +172,8 @@
gamemap::location src;
bool with_bars;
bool cycles;
- } anim_elem;
+ };
+
std::vector<anim_elem> animated_units_;
int start_time_;
};
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits