#include <drawer.hpp>
Public Member Functions | |
unit_drawer (display &thedisp, std::map< surface, SDL_Rect > &bar_rects) | |
void | redraw_unit (const unit &u) const |
draw a unit. More... | |
Private Member Functions | |
void | draw_bar (const std::string &image, int xpos, int ypos, const map_location &loc, size_t height, double filled, const SDL_Color &col, fixed_t alpha) const |
draw a health/xp bar of a unit More... | |
const SDL_Rect & | calculate_energy_bar (surface surf) const |
Finds the start and end rows on the energy bar image. More... | |
Private Attributes | |
display & | disp |
const display_context & | dc |
const gamemap & | map |
const std::vector< team > & | teams |
halo::manager & | halo_man |
std::map< surface, SDL_Rect > & | energy_bar_rects_ |
size_t | viewing_team |
size_t | playing_team |
const team & | viewing_team_ref |
const team & | playing_team_ref |
bool | is_blindfolded |
bool | show_everything |
map_location | sel_hex |
map_location | mouse_hex |
double | zoom_factor |
int | hex_size |
int | hex_size_by_2 |
Definition at line 45 of file drawer.hpp.
Definition at line 30 of file drawer.cpp.
|
private |
Finds the start and end rows on the energy bar image.
White pixels are substituted for the color of the energy.
Definition at line 458 of file drawer.cpp.
References sdl::create_rect(), energy_bar_rects_, i, itor, make_neutral_surface(), and const_surface_lock::pixels().
Referenced by draw_bar().
|
private |
draw a health/xp bar of a unit
Definition at line 372 of file drawer.cpp.
References calculate_energy_bar(), create_compatible_surface(), sdl::create_rect(), disp, display::drawing_buffer_add(), sdl::fill_rect(), ftofxp, fxpdiv, fxpmult, fxptoi, image::get_image(), display::LAYER_UNIT_BAR, image::SCALED_TO_HEX, surf, map_location::x, and zoom_factor.
Referenced by redraw_unit().
draw a unit.
Definition at line 50 of file drawer.cpp.
References halo::manager::add(), preferences::allied_color(), unit_animation_component::anim_, unit::anim_comp(), frame_parameters::blend_ratio, frame_parameters::blend_with, unit::can_advance(), unit::can_recruit(), unit_animation_component::clear_haloes(), sdl::create_rect(), dc, unit::default_anim_image(), disp, draw_bar(), unit_animation_component::draw_bars_, display::drawing_buffer_add(), unit::emits_zoc(), preferences::enemy_color(), game_config::images::energy, unit::experience(), unit::facing(), ftofxp, map_location::get_direction(), unit::get_hidden(), image::get_image(), unit::get_location(), display::get_location_x(), display::get_location_y(), team::get_side_color_index(), gamemap::get_terrain(), gamemap::get_terrain_info(), halo_man, frame_parameters::halo_mod, frame_parameters::halo_y, hex_size, hex_size_by_2, frame_parameters::highlight_ratio, unit::hitpoints(), unit::hp_bar_scaling(), unit::hp_color(), frame_parameters::image, unit::image_ellipse(), unit::image_halo(), frame_parameters::image_mod, unit::image_mods(), unit::incapacitated(), unit::invisible(), is_blindfolded, team::is_enemy(), unit::is_flying(), unit::is_visible_to_team(), display::LAYER_UNIT_BAR, display::LAYER_UNIT_FIRST, unit::leader_crown(), unit::level(), map, display::map_outside_area(), unit::max_experience(), unit::max_hitpoints(), mouse_hex, preferences::moved_color(), unit::movement_left(), surface::null(), game_config::images::orb, unit::overlays(), preferences::partial_color(), playing_team, unit::poisoned(), frame_parameters::primary_frame, sdl::rects_overlap(), unit_animation_component::refreshing_, halo::manager::remove(), display::rgb(), image::SCALED_TO_ZOOM, sel_hex, game_config::images::selected, halo::manager::set_location(), unit_animation_component::set_standing(), preferences::show_allied_orb(), preferences::show_enemy_orb(), show_everything, preferences::show_moved_orb(), preferences::show_partial_orb(), preferences::show_side_colors(), preferences::show_unmoved_orb(), unit::side(), unit::slowed(), frame_parameters::submerge, t_true, unit::TC_image_mods(), display::team_valid(), gui2::terrain, unit::total_movement(), display_context::unit_can_move(), unit_animation_component::unit_halo_, terrain_type::unit_height_adjust(), terrain_type::unit_submerge(), preferences::unmoved_color(), unit::user_end_turn(), viewing_team, viewing_team_ref, unit::xp_bar_scaling(), unit::xp_color(), map_location::y, frame_parameters::y, and zoom_factor.
Referenced by game_display::draw_invalidated(), and display::draw_invalidated().
|
private |
Definition at line 52 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 51 of file drawer.hpp.
Referenced by draw_bar(), and redraw_unit().
|
private |
Definition at line 56 of file drawer.hpp.
Referenced by calculate_energy_bar().
|
private |
Definition at line 55 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 67 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 68 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 61 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 53 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 64 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 58 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 60 of file drawer.hpp.
|
private |
Definition at line 63 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 62 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 54 of file drawer.hpp.
|
private |
Definition at line 57 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 59 of file drawer.hpp.
Referenced by redraw_unit().
|
private |
Definition at line 65 of file drawer.hpp.
Referenced by draw_bar(), and redraw_unit().