diff --git a/src/animated.hpp b/src/animated.hpp index 9d58f6b3abb..ddacce23c7a 100644 --- a/src/animated.hpp +++ b/src/animated.hpp @@ -68,8 +68,6 @@ public: const int get_animation_duration() const; const T& get_current_frame() const; - //! Get the next frame (or the current + shift frames) - const T& get_next_frame(int shift = 1) const; const int get_current_frame_begin_time() const; const int get_current_frame_end_time() const; const int get_current_frame_duration() const; @@ -113,7 +111,6 @@ private: double acceleration_; int last_update_tick_; int current_frame_key_; - int last_frame_key_; }; diff --git a/src/animated.i b/src/animated.i index 49b6685d7ae..9d33da63df2 100644 --- a/src/animated.i +++ b/src/animated.i @@ -52,8 +52,7 @@ animated::animated(int start_time) : cycles_(false), acceleration_(1), last_update_tick_(0), - current_frame_key_(0), - last_frame_key_(-1) + current_frame_key_(0) { } @@ -67,8 +66,7 @@ animated::animated(const std::vector > &cfg, in cycles_(false), acceleration_(1), last_update_tick_(0), - current_frame_key_(0), - last_frame_key_(-1) + current_frame_key_(0) { typename std::vector< std::pair >::const_iterator itor = cfg.begin(); @@ -105,9 +103,6 @@ void animated::start_animation(int start_time, bool cycles, doub if(acceleration_ <=0) acceleration_ = 1; current_frame_key_= 0; need_first_update_ = !frames_.empty(); - //update_last_draw_time(); - // need to force last frame key in the case of starting anim... - last_frame_key_ = -1; } @@ -115,7 +110,6 @@ template void animated::update_last_draw_time() { last_update_tick_ = current_ticks; - last_frame_key_ = current_frame_key_; if (need_first_update_) { need_first_update_ = false; return; @@ -136,7 +130,6 @@ void animated::update_last_draw_time() while(get_animation_time() > get_end_time()){ // cut extra time start_tick_ += static_cast(get_end_time()/acceleration_); current_frame_key_ = 0; - last_frame_key_ = -1; } } if(get_current_frame_end_time() < get_animation_time() && // catch up @@ -221,21 +214,6 @@ const T& animated::get_current_frame() const return frames_[current_frame_key_].value_; } -template -const T& animated::get_next_frame(int shift) const -{ - if(frames_.empty() ) - return void_value_; - int next_frame_key = current_frame_key_ + shift;; - if (!cycles_) { - if (next_frame_key < 0) - return get_first_frame(); - else if (next_frame_key >= get_frames_count()) - return get_last_frame(); - } - return frames_[next_frame_key % get_frames_count()].value_; -} - template const int animated::get_current_frame_begin_time() const {