minor fixes in animation engine
This commit is contained in:
parent
2a81b478ec
commit
3c8b58be8d
4 changed files with 5 additions and 8 deletions
|
@ -110,7 +110,7 @@ void animated<T,T_void_value>::start_animation(int start_frame, int cycles, int
|
|||
|
||||
|
||||
template<typename T, typename T_void_value>
|
||||
void animated<T,T_void_value>::update_current_frame_internal()
|
||||
void animated<T,T_void_value>::update_current_frame()
|
||||
{
|
||||
// std::cerr << "--- updating frame ---\n";
|
||||
if(does_not_change_)
|
||||
|
@ -220,7 +220,7 @@ int animated<T,T_void_value>::get_animation_time() const
|
|||
}
|
||||
|
||||
template<typename T, typename T_void_value>
|
||||
int animated<T,T_void_value>::get_frame_time() const
|
||||
int animated<T,T_void_value>::get_cycle_time() const
|
||||
{
|
||||
return current_time_ - start_ticks_ + start_frame_;
|
||||
}
|
||||
|
|
|
@ -58,16 +58,15 @@ public:
|
|||
|
||||
int get_first_frame_time() const;
|
||||
int get_last_frame_time() const;
|
||||
int get_duration() const;
|
||||
|
||||
//inlined for performance
|
||||
void update_current_frame() { if(does_not_change_) return; update_current_frame_internal(); };
|
||||
void update_current_frame();
|
||||
bool frame_changed() const;
|
||||
|
||||
//True if the current animation was finished
|
||||
bool animation_finished() const;
|
||||
int get_animation_time() const;
|
||||
int get_frame_time() const;
|
||||
int get_cycle_time() const;
|
||||
const T& get_current_frame() const;
|
||||
const T& get_first_frame() const;
|
||||
const T& get_last_frame() const;
|
||||
|
@ -88,7 +87,6 @@ private:
|
|||
bool has_value;
|
||||
T value;
|
||||
};
|
||||
void update_current_frame_internal();
|
||||
|
||||
static const T void_value_;
|
||||
|
||||
|
|
|
@ -505,7 +505,6 @@ bool unit_attack_ranged(display& disp, unit_map& units,
|
|||
static const std::string default_missile(game_config::missile_n_image);
|
||||
static const std::string default_diag_missile(game_config::missile_ne_image);
|
||||
if(missile_image->empty()) {
|
||||
printf("qmslkfdjqmslkdfjl\n");
|
||||
if(dir == unit_animation::VERTICAL)
|
||||
missile_image = &default_missile;
|
||||
else
|
||||
|
|
|
@ -1388,7 +1388,7 @@ int unit_type::defensive_animation::matches(bool h, std::string r) const
|
|||
{
|
||||
int result = 0;
|
||||
if(hits != HIT_OR_MISS ) {
|
||||
if(hits == h) {
|
||||
if(h && (hits == HIT)) {
|
||||
result++;
|
||||
} else {
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue