#include <animated.hpp>

Public Types | |
| typedef std::pair< int, T > | frame_description |
| typedef std::vector < frame_description > | anim_description |
Public Member Functions | |
| animated (int start_time=0) | |
| virtual | ~animated () |
| animated (const std::vector< frame_description > &cfg, int start_time=0, bool force_change=false) | |
| void | add_frame (int duration, const T &value, bool force_change=false) |
| Adds a frame to an animation. | |
| void | start_animation (int start_time, bool cycles=false) |
| Starts an animation cycle. | |
| void | pause_animation () |
| void | restart_animation () |
| int | get_begin_time () const |
| int | get_end_time () const |
| void | set_begin_time (int new_begin_time) |
| int | time_to_tick (int animation_time) const |
| int | tick_to_time (int animation_tick) const |
| void | update_last_draw_time (double acceleration=0) |
| bool | need_update () const |
| bool | cycles () const |
| bool | animation_finished () const |
| Returns true if the current animation was finished. | |
| bool | animation_finished_potential () const |
| int | get_animation_time () const |
| int | get_animation_time_potential () const |
| void | set_animation_time (int time) |
| int | get_animation_duration () const |
| const T & | get_current_frame () const |
| int | get_current_frame_begin_time () const |
| int | get_current_frame_end_time () const |
| int | get_current_frame_duration () const |
| int | get_current_frame_time () const |
| const T & | get_first_frame () const |
| const T & | get_last_frame () const |
| int | get_frames_count () const |
| void | force_change () |
| bool | does_not_change () const |
Static Public Attributes | |
| static const T | void_value_ = T_void_value()() |
Protected Member Functions | |
| void | remove_frames_until (int starting_time) |
| void | set_end_time (int ending_time) |
Protected Attributes | |
| int | starting_frame_time_ |
Private Attributes | |
| bool | does_not_change_ |
| bool | started_ |
| bool | force_next_update_ |
| std::vector< frame > | frames_ |
| int | start_tick_ |
| bool | cycles_ |
| double | acceleration_ |
| int | last_update_tick_ |
| int | current_frame_key_ |
Friends | |
| class | unit_animation |
Classes | |
| struct | frame |
Definition at line 40 of file animated.hpp.
| typedef std::pair<int,T> animated< T, T_void_value >::frame_description |
Definition at line 45 of file animated.hpp.
| typedef std::vector<frame_description> animated< T, T_void_value >::anim_description |
Definition at line 49 of file animated.hpp.
| animated< T, T_void_value >::animated | ( | int | start_time = 0 |
) | [inline] |
Definition at line 46 of file animated.i.
| virtual animated< T, T_void_value >::~animated | ( | ) | [inline, virtual] |
Definition at line 45 of file animated.hpp.
| animated< T, T_void_value >::animated | ( | const std::vector< frame_description > & | cfg, | |
| int | start_time = 0, |
|||
| bool | force_change = false | |||
| ) | [inline] |
Definition at line 61 of file animated.i.
References animated< T, T_void_value >::add_frame(), and cfg.

| void animated< T, T_void_value >::add_frame | ( | int | duration, | |
| const T & | value, | |||
| bool | force_change = false | |||
| ) | [inline] |
Adds a frame to an animation.
Definition at line 84 of file animated.i.
References animated< T, T_void_value >::does_not_change_, animated< T, T_void_value >::frames_, and animated< T, T_void_value >::starting_frame_time_.
Referenced by unit_animation::add_frame(), animated< T, T_void_value >::animated(), game_display::game_display(), terrain_builder::load_images(), terrain_builder::rebuild_terrain(), and unit_animation::start_animation().

| void animated< T, T_void_value >::start_animation | ( | int | start_time, | |
| bool | cycles = false | |||
| ) | [inline] |
Starts an animation cycle.
The first frame of the animation to start may be set to any value by using a start_time different to 0.
Reimplemented in unit_animation::particule.
Definition at line 96 of file animated.i.
References animated< T, T_void_value >::acceleration_, animated< T, T_void_value >::current_frame_key_, current_ticks, animated< T, T_void_value >::cycles_, animated< T, T_void_value >::force_next_update_, animated< T, T_void_value >::frames_, animated< T, T_void_value >::last_update_tick_, animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, and animated< T, T_void_value >::starting_frame_time_.
Referenced by terrain_builder::load_images(), terrain_builder::rebuild_terrain(), and unit_animation::particule::start_animation().

| void animated< T, T_void_value >::pause_animation | ( | ) | [inline] |
Definition at line 63 of file animated.hpp.
Referenced by unit_animation::pause_animation().

| void animated< T, T_void_value >::restart_animation | ( | ) | [inline] |
Definition at line 64 of file animated.hpp.
Referenced by unit_animation::restart_animation().

| int animated< T, T_void_value >::get_begin_time | ( | ) | const [inline] |
Definition at line 302 of file animated.i.
References animated< T, T_void_value >::starting_frame_time_.
Referenced by animated< T, T_void_value >::get_animation_duration(), and unit_animation::get_begin_time().

| int animated< T, T_void_value >::get_end_time | ( | ) | const [inline] |
Definition at line 322 of file animated.i.
References animated< T, T_void_value >::frames_, and animated< T, T_void_value >::starting_frame_time_.
Referenced by animated< T, T_void_value >::animation_finished(), animated< T, T_void_value >::animation_finished_potential(), animated< T, T_void_value >::get_animation_duration(), unit_animation::get_end_time(), and animated< T, T_void_value >::update_last_draw_time().

| void animated< T, T_void_value >::set_begin_time | ( | int | new_begin_time | ) | [inline] |
Definition at line 355 of file animated.i.
References animated< T, T_void_value >::frames_, and animated< T, T_void_value >::starting_frame_time_.
| int animated< T, T_void_value >::time_to_tick | ( | int | animation_time | ) | const [inline] |
Definition at line 308 of file animated.i.
References animated< T, T_void_value >::acceleration_, animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, and animated< T, T_void_value >::starting_frame_time_.
Referenced by unit_animation::time_to_tick().

| int animated< T, T_void_value >::tick_to_time | ( | int | animation_tick | ) | const [inline] |
Definition at line 314 of file animated.i.
References animated< T, T_void_value >::acceleration_, animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, and animated< T, T_void_value >::starting_frame_time_.
Referenced by animated< T, T_void_value >::animation_finished_potential(), animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::get_animation_time_potential(), and animated< T, T_void_value >::update_last_draw_time().

| void animated< T, T_void_value >::update_last_draw_time | ( | double | acceleration = 0 |
) | [inline] |
Definition at line 112 of file animated.i.
References animated< T, T_void_value >::acceleration_, animated< T, T_void_value >::current_frame_key_, current_ticks, animated< T, T_void_value >::cycles_, animated< T, T_void_value >::does_not_change_, animated< T, T_void_value >::force_next_update_, animated< T, T_void_value >::frames_, animated< T, T_void_value >::get_animation_duration(), animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::get_current_frame_end_time(), animated< T, T_void_value >::get_end_time(), animated< T, T_void_value >::last_update_tick_, animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, animated< T, T_void_value >::starting_frame_time_, and animated< T, T_void_value >::tick_to_time().
Referenced by terrain_builder::update_animation(), and unit_animation::update_last_draw_time().


| bool animated< T, T_void_value >::need_update | ( | ) | const [inline] |
Reimplemented in unit_animation::particule.
Definition at line 154 of file animated.i.
References animated< T, T_void_value >::acceleration_, current_ticks, animated< T, T_void_value >::does_not_change_, animated< T, T_void_value >::force_next_update_, animated< T, T_void_value >::frames_, animated< T, T_void_value >::get_current_frame_end_time(), animated< T, T_void_value >::start_tick_, and animated< T, T_void_value >::started_.
Referenced by terrain_builder::update_animation().


| bool animated< T, T_void_value >::cycles | ( | ) | const [inline] |
Definition at line 76 of file animated.hpp.
| bool animated< T, T_void_value >::animation_finished | ( | ) | const [inline] |
Returns true if the current animation was finished.
Definition at line 192 of file animated.i.
References animated< T, T_void_value >::cycles_, animated< T, T_void_value >::frames_, animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::get_end_time(), animated< T, T_void_value >::start_tick_, and animated< T, T_void_value >::started_.
Referenced by unit_animation::animation_finished().


| bool animated< T, T_void_value >::animation_finished_potential | ( | ) | const [inline] |
Definition at line 178 of file animated.i.
References current_ticks, animated< T, T_void_value >::cycles_, animated< T, T_void_value >::frames_, animated< T, T_void_value >::get_end_time(), animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, and animated< T, T_void_value >::tick_to_time().
Referenced by unit_animation::animation_finished_potential().


| int animated< T, T_void_value >::get_animation_time | ( | ) | const [inline] |
Definition at line 214 of file animated.i.
References animated< T, T_void_value >::last_update_tick_, animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, animated< T, T_void_value >::starting_frame_time_, and animated< T, T_void_value >::tick_to_time().
Referenced by animated< T, T_void_value >::animation_finished(), unit_animation::get_animation_time(), animated< T, T_void_value >::get_current_frame_time(), and animated< T, T_void_value >::update_last_draw_time().


| int animated< T, T_void_value >::get_animation_time_potential | ( | ) | const [inline] |
Definition at line 207 of file animated.i.
References current_ticks, animated< T, T_void_value >::start_tick_, animated< T, T_void_value >::started_, animated< T, T_void_value >::starting_frame_time_, and animated< T, T_void_value >::tick_to_time().
Referenced by unit_animation::get_animation_time_potential().


| void animated< T, T_void_value >::set_animation_time | ( | int | time | ) | [inline] |
Definition at line 222 of file animated.i.
References animated< T, T_void_value >::acceleration_, animated< T, T_void_value >::current_frame_key_, current_ticks, animated< T, T_void_value >::force_next_update_, animated< T, T_void_value >::last_update_tick_, animated< T, T_void_value >::start_tick_, and animated< T, T_void_value >::starting_frame_time_.
| int animated< T, T_void_value >::get_animation_duration | ( | ) | const [inline] |
Definition at line 233 of file animated.i.
References animated< T, T_void_value >::get_begin_time(), and animated< T, T_void_value >::get_end_time().
Referenced by animated< T, T_void_value >::update_last_draw_time().


| const T & animated< T, T_void_value >::get_current_frame | ( | ) | const [inline] |
Definition at line 239 of file animated.i.
References animated< T, T_void_value >::current_frame_key_, animated< T, T_void_value >::frames_, and animated< T, T_void_value >::void_value_.
| int animated< T, T_void_value >::get_current_frame_begin_time | ( | ) | const [inline] |
Definition at line 247 of file animated.i.
References animated< T, T_void_value >::current_frame_key_, animated< T, T_void_value >::frames_, and animated< T, T_void_value >::starting_frame_time_.
Referenced by unit_animation::get_current_frame_begin_time(), animated< T, T_void_value >::get_current_frame_end_time(), and animated< T, T_void_value >::get_current_frame_time().

| int animated< T, T_void_value >::get_current_frame_end_time | ( | ) | const [inline] |
Definition at line 255 of file animated.i.
References animated< T, T_void_value >::frames_, animated< T, T_void_value >::get_current_frame_begin_time(), animated< T, T_void_value >::get_current_frame_duration(), and animated< T, T_void_value >::starting_frame_time_.
Referenced by animated< T, T_void_value >::need_update(), and animated< T, T_void_value >::update_last_draw_time().


| int animated< T, T_void_value >::get_current_frame_duration | ( | ) | const [inline] |
Definition at line 263 of file animated.i.
References animated< T, T_void_value >::current_frame_key_, and animated< T, T_void_value >::frames_.
Referenced by animated< T, T_void_value >::get_current_frame_end_time().

| int animated< T, T_void_value >::get_current_frame_time | ( | ) | const [inline] |
Definition at line 271 of file animated.i.
References animated< T, T_void_value >::frames_, animated< T, T_void_value >::get_animation_time(), and animated< T, T_void_value >::get_current_frame_begin_time().

| const T & animated< T, T_void_value >::get_first_frame | ( | ) | const [inline] |
Definition at line 280 of file animated.i.
References animated< T, T_void_value >::frames_, and animated< T, T_void_value >::void_value_.
| const T & animated< T, T_void_value >::get_last_frame | ( | ) | const [inline] |
Definition at line 288 of file animated.i.
References animated< T, T_void_value >::frames_, and animated< T, T_void_value >::void_value_.
Referenced by unit_animation::get_last_frame().

| int animated< T, T_void_value >::get_frames_count | ( | ) | const [inline] |
Definition at line 296 of file animated.i.
References animated< T, T_void_value >::frames_.
Referenced by terrain_builder::load_images().

| void animated< T, T_void_value >::force_change | ( | ) | [inline] |
Definition at line 94 of file animated.hpp.
| bool animated< T, T_void_value >::does_not_change | ( | ) | const [inline] |
Definition at line 95 of file animated.hpp.
| void animated< T, T_void_value >::remove_frames_until | ( | int | starting_time | ) | [inline, protected] |
Definition at line 329 of file animated.i.
References animated< T, T_void_value >::frames_, and animated< T, T_void_value >::starting_frame_time_.
| void animated< T, T_void_value >::set_end_time | ( | int | ending_time | ) | [inline, protected] |
Definition at line 338 of file animated.i.
References animated< T, T_void_value >::frames_, and animated< T, T_void_value >::starting_frame_time_.
friend class unit_animation [friend] |
Definition at line 100 of file animated.hpp.
const T animated< T, T_void_value >::void_value_ = T_void_value()() [inline, static] |
Definition at line 97 of file animated.hpp.
Referenced by animated< T, T_void_value >::get_current_frame(), animated< T, T_void_value >::get_first_frame(), and animated< T, T_void_value >::get_last_frame().
int animated< T, T_void_value >::starting_frame_time_ [protected] |
Definition at line 101 of file animated.hpp.
Referenced by animated< T, T_void_value >::add_frame(), animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::get_animation_time_potential(), animated< T, T_void_value >::get_begin_time(), animated< T, T_void_value >::get_current_frame_begin_time(), animated< T, T_void_value >::get_current_frame_end_time(), animated< T, T_void_value >::get_end_time(), animated< T, T_void_value >::remove_frames_until(), animated< T, T_void_value >::set_animation_time(), animated< T, T_void_value >::set_begin_time(), animated< T, T_void_value >::set_end_time(), animated< T, T_void_value >::start_animation(), animated< T, T_void_value >::tick_to_time(), animated< T, T_void_value >::time_to_tick(), and animated< T, T_void_value >::update_last_draw_time().
bool animated< T, T_void_value >::does_not_change_ [private] |
Definition at line 122 of file animated.hpp.
Referenced by animated< T, T_void_value >::add_frame(), animated< unit_frame >::does_not_change(), animated< unit_frame >::force_change(), animated< T, T_void_value >::need_update(), and animated< T, T_void_value >::update_last_draw_time().
bool animated< T, T_void_value >::started_ [private] |
Definition at line 123 of file animated.hpp.
Referenced by animated< T, T_void_value >::animation_finished(), animated< T, T_void_value >::animation_finished_potential(), animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::get_animation_time_potential(), animated< T, T_void_value >::need_update(), animated< unit_frame >::pause_animation(), animated< unit_frame >::restart_animation(), animated< T, T_void_value >::start_animation(), animated< T, T_void_value >::tick_to_time(), animated< T, T_void_value >::time_to_tick(), and animated< T, T_void_value >::update_last_draw_time().
bool animated< T, T_void_value >::force_next_update_ [private] |
Definition at line 124 of file animated.hpp.
Referenced by animated< T, T_void_value >::need_update(), animated< T, T_void_value >::set_animation_time(), animated< T, T_void_value >::start_animation(), and animated< T, T_void_value >::update_last_draw_time().
std::vector<frame> animated< T, T_void_value >::frames_ [private] |
Definition at line 125 of file animated.hpp.
Referenced by animated< T, T_void_value >::add_frame(), animated< T, T_void_value >::animation_finished(), animated< T, T_void_value >::animation_finished_potential(), animated< T, T_void_value >::get_current_frame(), animated< T, T_void_value >::get_current_frame_begin_time(), animated< T, T_void_value >::get_current_frame_duration(), animated< T, T_void_value >::get_current_frame_end_time(), animated< T, T_void_value >::get_current_frame_time(), animated< T, T_void_value >::get_end_time(), animated< T, T_void_value >::get_first_frame(), animated< T, T_void_value >::get_frames_count(), animated< T, T_void_value >::get_last_frame(), animated< T, T_void_value >::need_update(), animated< T, T_void_value >::remove_frames_until(), animated< T, T_void_value >::set_begin_time(), animated< T, T_void_value >::set_end_time(), animated< T, T_void_value >::start_animation(), and animated< T, T_void_value >::update_last_draw_time().
int animated< T, T_void_value >::start_tick_ [private] |
Definition at line 128 of file animated.hpp.
Referenced by animated< T, T_void_value >::animation_finished(), animated< T, T_void_value >::animation_finished_potential(), animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::get_animation_time_potential(), animated< T, T_void_value >::need_update(), animated< unit_frame >::restart_animation(), animated< T, T_void_value >::set_animation_time(), animated< T, T_void_value >::start_animation(), animated< T, T_void_value >::tick_to_time(), animated< T, T_void_value >::time_to_tick(), and animated< T, T_void_value >::update_last_draw_time().
bool animated< T, T_void_value >::cycles_ [private] |
Definition at line 129 of file animated.hpp.
Referenced by animated< T, T_void_value >::animation_finished(), animated< T, T_void_value >::animation_finished_potential(), animated< unit_frame >::cycles(), animated< T, T_void_value >::start_animation(), and animated< T, T_void_value >::update_last_draw_time().
double animated< T, T_void_value >::acceleration_ [private] |
Definition at line 130 of file animated.hpp.
Referenced by animated< T, T_void_value >::need_update(), animated< T, T_void_value >::set_animation_time(), animated< T, T_void_value >::start_animation(), animated< T, T_void_value >::tick_to_time(), animated< T, T_void_value >::time_to_tick(), and animated< T, T_void_value >::update_last_draw_time().
int animated< T, T_void_value >::last_update_tick_ [private] |
Definition at line 131 of file animated.hpp.
Referenced by animated< T, T_void_value >::get_animation_time(), animated< T, T_void_value >::set_animation_time(), animated< T, T_void_value >::start_animation(), and animated< T, T_void_value >::update_last_draw_time().
int animated< T, T_void_value >::current_frame_key_ [private] |
Definition at line 132 of file animated.hpp.
Referenced by animated< T, T_void_value >::get_current_frame(), animated< T, T_void_value >::get_current_frame_begin_time(), animated< T, T_void_value >::get_current_frame_duration(), animated< T, T_void_value >::set_animation_time(), animated< T, T_void_value >::start_animation(), and animated< T, T_void_value >::update_last_draw_time().
| Generated by doxygen 1.5.6 on Fri Sep 3 01:02:52 2010 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |