#include <animation.hpp>
Classes | |
class | particule |
Public Types | |
enum | variation_type { MATCH_FAIL =-10, DEFAULT_ANIM =-9 } |
enum | hit_type { HIT, MISS, KILL, INVALID } |
Static Public Member Functions | |
static const std::vector < std::string > & | all_tag_names () |
static void | fill_initial_animations (std::vector< unit_animation > &animations, const config &cfg) |
static void | add_anims (std::vector< unit_animation > &animations, const config &cfg) |
Protected Member Functions | |
const frame_parameters | get_current_params (const frame_parameters &default_val=frame_parameters()) const |
Private Member Functions | |
unit_animation () | |
Shouldn't be used so only declared. More... | |
unit_animation (int start_time, const unit_frame &frame, const std::string &event="", const int variation=DEFAULT_ANIM, const frame_builder &builder=frame_builder()) | |
Private Attributes | |
t_translation::t_list | terrain_types_ |
std::vector< config > | unit_filter_ |
std::vector< config > | secondary_unit_filter_ |
std::vector < map_location::DIRECTION > | directions_ |
int | frequency_ |
int | base_score_ |
std::vector< std::string > | event_ |
std::vector< int > | value_ |
std::vector< config > | primary_attack_filter_ |
std::vector< config > | secondary_attack_filter_ |
std::vector< hit_type > | hits_ |
std::vector< int > | value2_ |
std::map< std::string, particule > | sub_anims_ |
particule | unit_anim_ |
map_location | src_ |
map_location | dst_ |
bool | invalidated_ |
bool | play_offscreen_ |
std::set< map_location > | overlaped_hex_ |
Friends | |
class | unit |
class | unit_drawer |
std::ostream & | operator<< (std::ostream &outstream, const unit_animation &u_animation) |
Definition at line 27 of file animation.hpp.
Enumerator | |
---|---|
HIT | |
MISS | |
KILL | |
INVALID |
Definition at line 33 of file animation.hpp.
Enumerator | |
---|---|
MATCH_FAIL | |
DEFAULT_ANIM |
Definition at line 32 of file animation.hpp.
|
private |
Shouldn't be used so only declared.
Referenced by add_anims(), and fill_initial_animations().
|
explicit |
Definition at line 293 of file animation.cpp.
References config::all_children_range(), config::child_range(), d, directions_, event_, HIT, hits_, i, KILL, MISS, map_location::parse_direction(), play_offscreen_, primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, utils::split(), sub_anims_, unit_filter_, value2_, and value_.
|
explicitprivate |
Definition at line 268 of file animation.cpp.
References add_frame(), unit_frame::does_not_change(), and unit_frame::duration().
|
static |
Definition at line 618 of file animation.cpp.
References config::add_child(), config::add_child_at(), add_simple_anim(), config::child_range(), image::locator::get_filename(), image::locator::get_modifications(), display::LAYER_UNIT_DEFAULT, display::LAYER_UNIT_FIRST, display::LAYER_UNIT_MISSILE_DEFAULT, display::LAYER_UNIT_MOVE_DEFAULT, game_config::sounds::status::poisoned, pos, prepare_animation(), display::rgb(), utils::split(), and unit_animation().
Referenced by unit_animation_component::apply_new_animation_effect(), and fill_initial_animations().
|
inline |
Definition at line 43 of file animation.hpp.
References animated< T, T_void_value >::add_frame(), and unit_anim_.
Referenced by unit_animation().
|
static |
Definition at line 65 of file animation.cpp.
bool unit_animation::animation_finished | ( | ) | const |
Definition at line 930 of file animation.cpp.
References animated< T, T_void_value >::animation_finished(), sub_anims_, and unit_anim_.
bool unit_animation::animation_finished_potential | ( | ) | const |
Definition at line 940 of file animation.cpp.
References animated< T, T_void_value >::animation_finished_potential(), sub_anims_, and unit_anim_.
Referenced by unit_animator::replace_anim_if_invalid().
void unit_animation::clear_haloes | ( | ) |
Definition at line 1040 of file animation.cpp.
References unit_animation::particule::clear_halo(), sub_anims_, and unit_anim_.
std::string unit_animation::debug | ( | ) | const |
Definition at line 1091 of file animation.cpp.
|
static |
Definition at line 469 of file animation.cpp.
References add_anims(), unit_animation::particule::CYCLE, DEFAULT_ANIM, gui2::event::find(), HIT, itor, KILL, display::LAYER_UNIT_FIRST, display::LAYER_UNIT_MOVE_DEFAULT, unit_animation::particule::NO_CYCLE, game_config::sounds::status::poisoned, display::rgb(), utils::split(), unit_animation(), and unit_animation::particule::UNSET.
Referenced by unit_type::animations().
|
inline |
Definition at line 53 of file animation.hpp.
References animated< T, T_void_value >::get_animation_time(), and unit_anim_.
Referenced by unit_animation::particule::get_overlaped_hex(), unit_animation::particule::redraw(), and unit_animator::wait_until().
|
inline |
Definition at line 54 of file animation.hpp.
References animated< T, T_void_value >::get_animation_time_potential(), and unit_anim_.
int unit_animation::get_begin_time | ( | ) | const |
Definition at line 970 of file animation.cpp.
References animated< T, T_void_value >::get_begin_time(), sub_anims_, and unit_anim_.
Referenced by unit_animator::add_animation(), unit_animation::particule::get_overlaped_hex(), operator<<(), unit_animation::particule::redraw(), and unit_animation::particule::start_animation().
|
inline |
Definition at line 64 of file animation.hpp.
References animated< T, T_void_value >::get_current_frame_begin_time(), and unit_anim_.
Referenced by unit_animation::particule::need_minimal_update(), and unit_animation::particule::redraw().
|
inlineprotected |
Definition at line 78 of file animation.hpp.
References unit_animation::particule::parameters(), and unit_anim_.
int unit_animation::get_end_time | ( | ) | const |
Definition at line 960 of file animation.cpp.
References animated< T, T_void_value >::get_end_time(), sub_anims_, and unit_anim_.
|
inline |
Definition at line 42 of file animation.hpp.
References animated< T, T_void_value >::get_last_frame(), and unit_anim_.
bool unit_animation::invalidate | ( | frame_parameters & | value | ) |
Definition at line 1049 of file animation.cpp.
References dst_, unit_animation::particule::get_overlaped_hex(), display::get_singleton(), display::invalidate(), invalidated_, need_minimal_update(), need_update(), overlaped_hex_, frame_parameters::primary_frame, display::propagate_invalidation(), src_, sub_anims_, t_false, t_true, display::tile_nearly_on_screen(), and unit_anim_.
Referenced by unit_animation_component::invalidate().
int unit_animation::matches | ( | const display & | disp, |
const map_location & | loc, | ||
const map_location & | second_loc, | ||
const unit * | my_unit, | ||
const std::string & | event = "" , |
||
const int | value = 0 , |
||
hit_type | hit = INVALID , |
||
const attack_type * | attack = nullptr , |
||
const attack_type * | second_attack = nullptr , |
||
int | value2 = 0 |
||
) | const |
Definition at line 377 of file animation.cpp.
References base_score_, directions_, event_, unit::facing(), gui2::event::find(), unit_map::find(), frequency_, display::get_map(), gamemap::get_terrain(), display::get_units(), hits_, MATCH_FAIL, attack_type::matches_filter(), primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, t_translation::terrain_matches(), terrain_types_, unit_filter_, unit_map::iterator_base< iter_types >::valid(), value2_, and value_.
Referenced by unit_animator::replace_anim_if_invalid().
bool unit_animation::need_minimal_update | ( | ) | const |
Definition at line 917 of file animation.cpp.
References unit_animation::particule::need_minimal_update(), play_offscreen_, sub_anims_, and unit_anim_.
Referenced by invalidate().
bool unit_animation::need_update | ( | ) | const |
Definition at line 907 of file animation.cpp.
References unit_animation::particule::need_update(), sub_anims_, and unit_anim_.
Referenced by invalidate(), and unit_animation::particule::need_update().
void unit_animation::pause_animation | ( | ) |
Definition at line 1009 of file animation.cpp.
References animated< T, T_void_value >::pause_animation(), sub_anims_, and unit_anim_.
void unit_animation::redraw | ( | frame_parameters & | value, |
halo::manager & | halo_man | ||
) |
Definition at line 1027 of file animation.cpp.
References dst_, invalidated_, overlaped_hex_, frame_parameters::primary_frame, unit_animation::particule::redraw(), src_, sub_anims_, t_false, t_true, and unit_anim_.
void unit_animation::restart_animation | ( | ) |
Definition at line 1018 of file animation.cpp.
References animated< T, T_void_value >::restart_animation(), sub_anims_, and unit_anim_.
void unit_animation::start_animation | ( | int | start_time, |
const map_location & | src = map_location::null_location() , |
||
const map_location & | dst = map_location::null_location() , |
||
const std::string & | text = "" , |
||
const Uint32 | text_color = 0 , |
||
const bool | accelerate = true |
||
) |
Definition at line 980 of file animation.cpp.
References unit_animation::particule::accelerate, animated< T, T_void_value >::add_frame(), dst_, src_, unit_animation::particule::start_animation(), sub_anims_, and unit_anim_.
Definition at line 52 of file animation.hpp.
References animated< T, T_void_value >::time_to_tick(), and unit_anim_.
void unit_animation::update_last_draw_time | ( | ) |
Definition at line 950 of file animation.cpp.
References unit_animation::particule::accelerate, game_display::get_singleton(), sub_anims_, display::turbo_speed(), unit_anim_, and animated< T, T_void_value >::update_last_draw_time().
void unit_animation::update_parameters | ( | const map_location & | src, |
const map_location & | dst | ||
) |
Definition at line 1004 of file animation.cpp.
|
friend |
Definition at line 1098 of file animation.cpp.
|
friend |
Definition at line 71 of file animation.hpp.
|
friend |
Definition at line 72 of file animation.hpp.
|
private |
Definition at line 133 of file animation.hpp.
Referenced by matches().
|
private |
Definition at line 131 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 144 of file animation.hpp.
Referenced by invalidate(), redraw(), start_animation(), and update_parameters().
|
private |
Definition at line 134 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 132 of file animation.hpp.
Referenced by matches(), and operator<<().
|
private |
Definition at line 138 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 146 of file animation.hpp.
Referenced by invalidate(), and redraw().
|
private |
Definition at line 148 of file animation.hpp.
Referenced by invalidate(), and redraw().
|
private |
Definition at line 147 of file animation.hpp.
Referenced by need_minimal_update(), and unit_animation().
|
private |
Definition at line 136 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 137 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 130 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 143 of file animation.hpp.
Referenced by invalidate(), redraw(), start_animation(), and update_parameters().
|
private |
Definition at line 140 of file animation.hpp.
Referenced by animation_finished(), animation_finished_potential(), clear_haloes(), get_begin_time(), get_end_time(), invalidate(), need_minimal_update(), need_update(), operator<<(), pause_animation(), redraw(), restart_animation(), start_animation(), unit_animation(), and update_last_draw_time().
|
private |
Definition at line 128 of file animation.hpp.
Referenced by matches(), and operator<<().
|
private |
Definition at line 141 of file animation.hpp.
Referenced by add_frame(), animation_finished(), animation_finished_potential(), clear_haloes(), get_animation_time(), get_animation_time_potential(), get_begin_time(), get_current_frame_begin_time(), get_current_params(), get_end_time(), get_last_frame(), invalidate(), need_minimal_update(), need_update(), operator<<(), pause_animation(), redraw(), restart_animation(), start_animation(), time_to_tick(), and update_last_draw_time().
|
private |
Definition at line 129 of file animation.hpp.
Referenced by matches(), operator<<(), and unit_animation().
|
private |
Definition at line 139 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 135 of file animation.hpp.
Referenced by matches(), and unit_animation().