Describes a unit's animation sequence. More...
#include <frame.hpp>
Public Member Functions | |
unit_frame (const frame_builder &builder=frame_builder()) | |
void | redraw (const std::chrono::milliseconds &frame_time, bool on_start_time, bool in_scope_of_frame, const map_location &src, const map_location &dst, halo::handle &halo_id, halo::manager &halo_man, const frame_parameters &animation_val, const frame_parameters &engine_val) const |
frame_parameters | merge_parameters (const std::chrono::milliseconds ¤t_time, const frame_parameters &animation_val, const frame_parameters &engine_val=frame_parameters()) const |
This function merges the value provided by: More... | |
frame_parameters | parameters (const std::chrono::milliseconds ¤t_time) const |
frame_parameters | end_parameters () const |
const std::chrono::milliseconds & | duration () const |
bool | does_not_change () const |
bool | need_update () const |
std::vector< std::string > | debug_strings () const |
std::set< map_location > | get_overlaped_hex (const std::chrono::milliseconds &frame_time, const map_location &src, const map_location &dst, const frame_parameters &animation_val, const frame_parameters &engine_val) const |
Private Attributes | |
frame_parsed_parameters | builder_ |
|
inline |
|
inline |
Definition at line 245 of file frame.hpp.
References builder_, and frame_parsed_parameters::debug_strings().
|
inline |
Definition at line 235 of file frame.hpp.
References builder_, and frame_parsed_parameters::does_not_change().
Referenced by unit_animation::particle::particle(), and unit_animation::unit_animation().
|
inline |
Definition at line 230 of file frame.hpp.
References builder_, and frame_parsed_parameters::duration().
Referenced by end_parameters(), unit_animation::particle::particle(), and unit_animation::unit_animation().
|
inline |
Definition at line 225 of file frame.hpp.
References builder_, duration(), and frame_parsed_parameters::parameters().
std::set< map_location > unit_frame::get_overlaped_hex | ( | const std::chrono::milliseconds & | frame_time, |
const map_location & | src, | ||
const map_location & | dst, | ||
const frame_parameters & | animation_val, | ||
const frame_parameters & | engine_val | ||
) | const |
Definition at line 796 of file frame.cpp.
References frame_parameters::auto_hflip, frame_parameters::auto_vflip, display::rect_of_hexes::begin(), image::locator::clone(), frame_parameters::directional_x, frame_parameters::directional_y, dst, display::rect_of_hexes::end(), image::locator::get_filename(), display::get_location(), display::get_singleton(), image::get_size(), display::get_zoom_factor(), h, display::hex_size(), display::hexes_under_rect(), frame_parameters::image, frame_parameters::image_diagonal, frame_parameters::image_mod, image::is_in_hex(), image::locator::is_void(), merge_parameters(), map_location::north, map_location::north_east, map_location::north_west, frame_parameters::offset, s, map_location::south, map_location::south_east, map_location::south_west, src, w, frame_parameters::x, and frame_parameters::y.
Referenced by unit_animation::particle::get_overlaped_hex().
frame_parameters unit_frame::merge_parameters | ( | const std::chrono::milliseconds & | current_time, |
const frame_parameters & | animation_val, | ||
const frame_parameters & | engine_val = frame_parameters() |
||
) | const |
This function merges the value provided by:
There is no absolute rule for merging, so creativity is the rule. If a value is never provided by the engine, assert. This way if it becomes used, people will easily find the right place to look.
The engine provides a default image to use for the unit when none is available
The engine provides a default image to use for the unit when none is available
The engine provides a string for "petrified" and "team color" modifications. Note that image_mod is the complete modification and halo_mod is only the TC part.
The engine provides a y modification for terrain with height adjust and flying units
The engine provides a blend color for poisoned units
The engine provides a blend color for poisoned units
The engine provides a highlight ratio for selected units and visible "invisible" units
The engine provides a submerge for units in water
The engine provides a y modification for terrain with height adjust and flying units
The engine provides us with a default value to compare to. Update if different
Definition at line 917 of file frame.cpp.
References frame_parameters::auto_hflip, frame_parameters::auto_vflip, frame_parameters::blend_ratio, frame_parameters::blend_with, builder_, frame_parameters::directional_x, frame_parameters::directional_y, frame_parameters::drawing_layer, frame_parameters::duration, get_abs_frame_layer(), image::locator::get_filename(), frame_parameters::halo, frame_parameters::halo_mod, frame_parameters::halo_x, frame_parameters::halo_y, frame_parameters::highlight_ratio, frame_parameters::image, frame_parameters::image_diagonal, frame_parameters::image_mod, image::locator::is_void(), frame_parameters::offset, frame_parsed_parameters::parameters(), frame_parameters::primary_frame, frame_parameters::sound, frame_parameters::submerge, frame_parameters::text, frame_parameters::text_color, unit_default, frame_parameters::x, and frame_parameters::y.
Referenced by get_overlaped_hex(), unit_animation::particle::parameters(), and redraw().
|
inline |
Definition at line 240 of file frame.hpp.
References builder_, and frame_parsed_parameters::need_update().
|
inline |
Definition at line 220 of file frame.hpp.
References builder_, and frame_parsed_parameters::parameters().
void unit_frame::redraw | ( | const std::chrono::milliseconds & | frame_time, |
bool | on_start_time, | ||
bool | in_scope_of_frame, | ||
const map_location & | src, | ||
const map_location & | dst, | ||
halo::handle & | halo_id, | ||
halo::manager & | halo_man, | ||
const frame_parameters & | animation_val, | ||
const frame_parameters & | engine_val | ||
) | const |
Definition at line 630 of file frame.cpp.
References halo::manager::add(), frame_parameters::auto_hflip, frame_parameters::auto_vflip, frame_parameters::blend_ratio, frame_parameters::blend_with, image::locator::clone(), frame_parameters::directional_x, frame_parameters::directional_y, frame_parameters::drawing_layer, dst, game_display::float_label(), float_to_color(), image::locator::get_filename(), display::get_location(), display::get_singleton(), game_display::get_singleton(), image::get_size(), display::get_zoom_factor(), frame_parameters::halo, frame_parameters::halo_mod, frame_parameters::halo_x, frame_parameters::halo_y, display::hex_size(), frame_parameters::highlight_ratio, halo::HREVERSE, halo::HVREVERSE, frame_parameters::image, frame_parameters::image_diagonal, frame_parameters::image_mod, map_location::indeterminate, image::locator::is_void(), merge_parameters(), halo::NORMAL, map_location::north, map_location::north_east, map_location::north_west, frame_parameters::offset, sound::play_sound(), frame_parameters::sound, map_location::south, map_location::south_east, map_location::south_west, src, frame_parameters::submerge, frame_parameters::text, frame_parameters::text_color, unit_first, halo::VREVERSE, frame_parameters::x, and frame_parameters::y.
Referenced by unit_animation::particle::redraw().
|
private |
Definition at line 255 of file frame.hpp.
Referenced by debug_strings(), does_not_change(), duration(), end_parameters(), merge_parameters(), need_update(), and parameters().