The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
unit_frame Class Reference

Describe a unit's animation sequence. More...

#include <frame.hpp>

Public Member Functions

 unit_frame (const frame_builder &builder=frame_builder())
 
void redraw (const int 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
 
const frame_parameters merge_parameters (int current_time, const frame_parameters &animation_val, const frame_parameters &engine_val=frame_parameters()) const
 
const frame_parameters parameters (int current_time) const
 
const frame_parameters end_parameters () const
 
int duration () const
 
bool does_not_change () const
 
bool need_update () const
 
std::set< map_locationget_overlaped_hex (const int frame_time, const map_location &src, const map_location &dst, const frame_parameters &animation_val, const frame_parameters &engine_val) const
 
std::vector< std::stringdebug_strings () const
 

Private Attributes

frame_parsed_parameters builder_
 

Detailed Description

Describe a unit's animation sequence.

Definition at line 204 of file frame.hpp.

Constructor & Destructor Documentation

unit_frame::unit_frame ( const frame_builder builder = frame_builder())
inline

Definition at line 207 of file frame.hpp.

Member Function Documentation

std::vector<std::string> unit_frame::debug_strings ( ) const
inline

Definition at line 217 of file frame.hpp.

References builder_, and frame_parsed_parameters::debug_strings().

Referenced by operator<<().

bool unit_frame::does_not_change ( ) const
inline
int unit_frame::duration ( ) const
inline
const frame_parameters unit_frame::end_parameters ( ) const
inline

Definition at line 211 of file frame.hpp.

References builder_, duration(), and frame_parsed_parameters::parameters().

std::set< map_location > unit_frame::get_overlaped_hex ( const int  frame_time,
const map_location src,
const map_location dst,
const frame_parameters animation_val,
const frame_parameters engine_val 
) const
const frame_parameters unit_frame::merge_parameters ( int  current_time,
const frame_parameters animation_val,
const frame_parameters engine_val = frame_parameters() 
) const

this function merges the value provided by

  • the frame
  • the engine (poison, flying unit...)
  • the animation as a whole 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)

engine provides a default image to use for the unit when none is available

engine provides a default image to use for the unit when none is available

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 see unit.cpp, we know that and use it

the engine provide y modification for terrain with height adjust and flying units

engine provide a blend color for poisoned units

engine provide a blend color for poisoned units

engine provide a highlight ratio for selected units and visible "invisible" units

engine provides a submerge for units in water

the engine provide y modification for terrain with height adjust and flying units

the engine provide us with default value to compare with, we update if different

Definition at line 857 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, 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(), display::LAYER_UNIT_DEFAULT, display::LAYER_UNIT_FIRST, display::max_rgb(), frame_parameters::offset, frame_parsed_parameters::parameters(), frame_parameters::primary_frame, frame_parameters::sound, frame_parameters::submerge, t_false, t_true, t_unset, frame_parameters::text, frame_parameters::text_color, tristate_to_bool(), frame_parameters::x, and frame_parameters::y.

Referenced by get_overlaped_hex(), unit_animation::particule::parameters(), and redraw().

bool unit_frame::need_update ( ) const
inline

Definition at line 215 of file frame.hpp.

References builder_, and frame_parsed_parameters::need_update().

const frame_parameters unit_frame::parameters ( int  current_time) const
inline

Definition at line 210 of file frame.hpp.

References builder_, and frame_parsed_parameters::parameters().

void unit_frame::redraw ( const int  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

Member Data Documentation

frame_parsed_parameters unit_frame::builder_
private

The documentation for this class was generated from the following files: