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

#include <display.hpp>

Inheritance diagram for display:
Inheritance graph

Classes

class  blit_helper
 Helper structure for rendering the terrains. More...
 
class  drawing_buffer_key
 In order to render a hex properly it needs to be rendered per row. More...
 
struct  rect_of_hexes
 Rectangular area of hexes, allowing to decide how the top and bottom edges handles the vertical shift for each parity of the x coordinate. More...
 

Public Types

enum  SCROLL_TYPE { SCROLL, WARP, ONSCREEN, ONSCREEN_WARP }
 
enum  drawing_layer {
  LAYER_TERRAIN_BG, LAYER_GRID_TOP, LAYER_MOUSEOVER_OVERLAY, LAYER_FOOTSTEPS,
  LAYER_MOUSEOVER_TOP, LAYER_UNIT_FIRST, LAYER_UNIT_BG = LAYER_UNIT_FIRST+10, LAYER_UNIT_DEFAULT =LAYER_UNIT_FIRST+40,
  LAYER_TERRAIN_FG = LAYER_UNIT_FIRST+50, LAYER_GRID_BOTTOM, LAYER_UNIT_MOVE_DEFAULT =LAYER_UNIT_FIRST+60, LAYER_UNIT_FG = LAYER_UNIT_FIRST+80,
  LAYER_UNIT_MISSILE_DEFAULT = LAYER_UNIT_FIRST+90, LAYER_UNIT_LAST =LAYER_UNIT_FIRST+100, LAYER_REACHMAP, LAYER_MOUSEOVER_BOTTOM,
  LAYER_FOG_SHROUD, LAYER_ARROWS, LAYER_ACTIONS_NUMBERING, LAYER_SELECTED_HEX,
  LAYER_ATTACK_INDICATOR, LAYER_UNIT_BAR, LAYER_MOVE_INFO, LAYER_LINGER_OVERLAY,
  LAYER_BORDER
}
 The layers to render something on. More...
 

Public Member Functions

 display (const display_context *dc, CVideo &video, std::weak_ptr< wb::manager > wb, reports &reports_object, const config &theme_cfg, const config &level, bool auto_join=true)
 
virtual ~display ()
 
bool show_everything () const
 
const gamemapget_map () const
 
const std::vector< team > & get_teams () const
 
size_t playing_team () const
 The playing team is the team whose turn it is. More...
 
bool team_valid () const
 
size_t viewing_team () const
 The viewing team is the team currently viewing the game. More...
 
int viewing_side () const
 
void set_team (size_t team, bool observe=false)
 Sets the team controlled by the player using the computer. More...
 
void set_playing_team (size_t team)
 set_playing_team sets the team whose turn it currently is More...
 
void clear_exclusive_draws ()
 Cancels all the exclusive draw requests. More...
 
const unit_mapget_units () const
 
bool add_exclusive_draw (const map_location &loc, unit &unit)
 Allows a unit to request to be the only one drawn in its hex. More...
 
std::string remove_exclusive_draw (const map_location &loc)
 Cancels an exclusive draw request. More...
 
void parse_team_overlays ()
 Check the overlay_map for proper team-specific overlays to be displayed/hidden. More...
 
void add_overlay (const map_location &loc, const std::string &image, const std::string &halo="", const std::string &team_name="", const std::string &item_id="", bool visible_under_fog=true)
 Functions to add and remove overlays from locations. More...
 
void remove_overlay (const map_location &loc)
 remove_overlay will remove all overlays on a tile. More...
 
void remove_single_overlay (const map_location &loc, const std::string &toDelete)
 remove_single_overlay will remove a single overlay from a tile More...
 
void reload_map ()
 Updates internals that cache map size. More...
 
void change_display_context (const display_context *dc)
 
const display_contextget_disp_context () const
 
virtual const tod_managerget_tod_man () const
 This is implemented properly in game_display. The display:: impl could be pure virtual here but we decide not to. More...
 
virtual const game_dataget_game_data () const
 
virtual game_lua_kernelget_lua_kernel () const
 TODO: display should not work as a filter context, this was only done for expedience so that the unit animation code can have a convenient and correct filter context readily available. a more correct solution is most likely to pass it a filter context from unit_animator when it needs to be matched. (it's not possible to store filter contexts with animations, because animations are cached across scenarios.) Note that after these lines which return nullptr, unit filters used in animations will not be able to make use of wml variables or lua scripting (but the latter was a bad idea anyways because it would be slow to constantly recompile the script.) More...
 
void reset_halo_manager ()
 
void reset_halo_manager (halo::manager &hm)
 
halo::managerget_halo_manager ()
 
void update_tod (const time_of_day *tod_override=nullptr)
 Applies r,g,b coloring to the map. More...
 
void adjust_color_overlay (int r, int g, int b)
 Add r,g,b to the colors for all images displayed on the map. More...
 
CVideovideo ()
 Gets the underlying screen object. More...
 
surfaceget_screen_surface ()
 return the screen surface or the surface used for map_screenshot. More...
 
virtual bool in_game () const
 
virtual bool in_editor () const
 
virtual const map_locationdisplayed_unit_hex () const
 Virtual functions shadowed in game_display. More...
 
virtual int playing_side () const
 
virtual const std::set
< std::string > & 
observers () const
 
int w () const
 the dimensions of the display. More...
 
int h () const
 height More...
 
const SDL_Rect & minimap_area () const
 
const SDL_Rect & palette_area () const
 
const SDL_Rect & unit_image_area () const
 
SDL_Rect screen_area () const
 
const SDL_Rect & max_map_area () const
 Returns the maximum area used for the map regardless to resolution and view size. More...
 
const SDL_Rect & map_area () const
 Returns the area used for the map. More...
 
const SDL_Rect & map_outside_area () const
 Returns the available area for a map, this may differ from the above. More...
 
bool outside_area (const SDL_Rect &area, const int x, const int y) const
 Check if the bbox of the hex at x,y has pixels outside the area rectangle. More...
 
int hex_width () const
 Function which returns the width of a hex in pixels, up to where the next hex starts. More...
 
int hex_size () const
 Function which returns the size of a hex in pixels (from top tip to bottom tip or left edge to right edge). More...
 
double get_zoom_factor () const
 Returns the current zoom factor. More...
 
const map_location hex_clicked_on (int x, int y) const
 given x,y co-ordinates of an onscreen pixel, will return the location of the hex that this pixel corresponds to. More...
 
const map_location pixel_position_to_hex (int x, int y) const
 given x,y co-ordinates of a pixel on the map, will return the location of the hex that this pixel corresponds to. More...
 
map_location minimap_location_on (int x, int y)
 given x,y co-ordinates of the mouse, will return the location of the hex in the minimap that the mouse is currently over, or an invalid location if the mouse isn't over the minimap. More...
 
const map_locationselected_hex () const
 
const map_locationmouseover_hex () const
 
virtual void select_hex (map_location hex)
 
virtual void highlight_hex (map_location hex)
 
void invalidate_game_status ()
 Function to invalidate the game status displayed on the sidebar. More...
 
int get_location_x (const map_location &loc) const
 Functions to get the on-screen positions of hexes. More...
 
int get_location_y (const map_location &loc) const
 
const rect_of_hexes hexes_under_rect (const SDL_Rect &r) const
 Return the rectangular area of hexes overlapped by r (r is in screen coordinates) More...
 
const rect_of_hexes get_visible_hexes () const
 Returns the rectangular area of visible hexes. More...
 
bool shrouded (const map_location &loc) const
 Returns true if location (x,y) is covered in shroud. More...
 
bool fogged (const map_location &loc) const
 Returns true if location (x,y) is covered in fog. More...
 
void set_grid (const bool grid)
 Determines whether a grid should be overlayed on the game board. More...
 
bool get_draw_coordinates () const
 Getter for the x,y debug overlay on tiles. More...
 
void set_draw_coordinates (bool value)
 Setter for the x,y debug overlay on tiles. More...
 
bool get_draw_terrain_codes () const
 Getter for the terrain code debug overlay on tiles. More...
 
void set_draw_terrain_codes (bool value)
 Setter for the terrain code debug overlay on tiles. More...
 
bool get_draw_num_of_bitmaps () const
 Getter for the number of bitmaps debug overlay on tiles. More...
 
void set_draw_num_of_bitmaps (bool value)
 Setter for the terrain code debug overlay on tiles. More...
 
bool screenshot (const std::string &filename, bool map_screenshot=false)
 Save a (map-)screenshot and return whether the operation succeeded. More...
 
void redraw_everything ()
 Invalidates entire screen, including all tiles and sidebar. More...
 
void add_redraw_observer (std::function< void(display &)> f)
 Adds a redraw observer, a function object to be called when redraw_everything is used. More...
 
void clear_redraw_observers ()
 Clear the redraw observers. More...
 
themeget_theme ()
 
void set_theme (config theme_cfg)
 
std::shared_ptr< gui::buttonfind_action_button (const std::string &id)
 Retrieves a pointer to a theme UI button. More...
 
std::shared_ptr< gui::buttonfind_menu_button (const std::string &id)
 
gui::button::TYPE string_to_button_type (std::string type)
 
void create_buttons ()
 
void layout_buttons ()
 
void render_buttons ()
 
void invalidate_theme ()
 
void refresh_report (const std::string &report_name, const config *new_cfg=nullptr)
 Redraws the specified report (if anything has changed). More...
 
void draw_minimap_units ()
 
void invalidate_all ()
 Function to invalidate all tiles. More...
 
bool invalidate (const map_location &loc)
 Function to invalidate a specific tile for redrawing. More...
 
bool invalidate (const std::set< map_location > &locs)
 
bool propagate_invalidation (const std::set< map_location > &locs)
 If this set is partially invalidated, invalidate all its hexes. More...
 
bool invalidate_locations_in_rect (const SDL_Rect &rect)
 invalidate all hexes under the rectangle rect (in screen coordinates) More...
 
bool invalidate_visible_locations_in_rect (const SDL_Rect &rect)
 
void invalidate_animations ()
 Function to invalidate animated terrains and units which may have changed. More...
 
void invalidate_animations_location (const map_location &loc)
 Per-location invalidation called by invalidate_animations() Extra game per-location invalidation (village ownership) More...
 
void set_mouseover_hex_overlay (const surface &image)
 mouseover_hex_overlay_ require a prerendered surface and is drawn underneath the mouse's location More...
 
void clear_mouseover_hex_overlay ()
 
terrain_builderget_builder ()
 
void flip ()
 
void update_display ()
 Copy the backbuffer to the framebuffer. More...
 
void rebuild_all ()
 Rebuild all dynamic terrain. More...
 
const theme::actionaction_pressed ()
 
const theme::menumenu_pressed ()
 
void enable_menu (const std::string &item, bool enable)
 Finds the menu which has a given item in it, and enables or disables it. More...
 
void set_diagnostic (const std::string &msg)
 
void set_turbo (const bool turbo)
 Set/Get whether 'turbo' mode is on. More...
 
double turbo_speed () const
 
void set_turbo_speed (const double speed)
 
void set_idle_anim (bool ison)
 control unit idle animations and their frequency More...
 
bool idle_anim () const
 
void set_idle_anim_rate (int rate)
 
double idle_anim_rate () const
 
void bounds_check_position ()
 
void bounds_check_position (int &xpos, int &ypos)
 
bool scroll (int xmov, int ymov, bool force=false)
 Scrolls the display by xmov,ymov pixels. More...
 
bool set_zoom (bool increase)
 Zooms the display in (true) or out (false). More...
 
bool set_zoom (unsigned int amount, const bool validate_value_and_set_index=true)
 Sets the display zoom to the specified amount. More...
 
bool zoom_at_max () const
 
bool zoom_at_min () const
 
void set_default_zoom ()
 Sets the zoom amount to the default. More...
 
bool view_locked () const
 
void set_view_locked (bool value)
 Sets whether the map view is locked (e.g. More...
 
void scroll_to_tile (const map_location &loc, SCROLL_TYPE scroll_type=ONSCREEN, bool check_fogged=true, bool force=true)
 Scroll such that location loc is on-screen. More...
 
void scroll_to_tiles (map_location loc1, map_location loc2, SCROLL_TYPE scroll_type=ONSCREEN, bool check_fogged=true, double add_spacing=0.0, bool force=true)
 Scroll such that location loc1 is on-screen. More...
 
void scroll_to_tiles (const std::vector< map_location >::const_iterator &begin, const std::vector< map_location >::const_iterator &end, SCROLL_TYPE scroll_type=ONSCREEN, bool check_fogged=true, bool only_if_possible=false, double add_spacing=0.0, bool force=true)
 Scroll to fit as many locations on-screen as possible, starting with the first. More...
 
void scroll_to_tiles (const std::vector< map_location > &locs, SCROLL_TYPE scroll_type=ONSCREEN, bool check_fogged=true, bool only_if_possible=false, double add_spacing=0.0, bool force=true)
 Scroll to fit as many locations on-screen as possible, starting with the first. More...
 
events::generic_eventscroll_event () const
 Expose the event, so observers can be notified about map scrolling. More...
 
events::generic_eventcomplete_redraw_event ()
 
bool tile_fully_on_screen (const map_location &loc) const
 Check if a tile is fully visible on screen. More...
 
bool tile_nearly_on_screen (const map_location &loc) const
 Checks if location loc or one of the adjacent tiles is visible on screen. More...
 
virtual void draw ()
 Draws invalidated items. More...
 
void draw (bool update)
 
void draw (bool update, bool force)
 
map_labelslabels ()
 
const map_labelslabels () const
 
void announce (const std::string &msg, const color_t &color=font::GOOD_COLOR, int lifetime=100)
 Announce a message prominently. More...
 
void recalculate_minimap ()
 Schedule the minimap for recalculation. More...
 
void redraw_minimap ()
 Schedule the minimap to be redrawn. More...
 
virtual const time_of_dayget_time_of_day (const map_location &loc=map_location::null_location()) const
 
virtual bool has_time_area () const
 
void blindfold (bool flag)
 
bool is_blindfolded () const
 
void write (config &cfg) const
 
virtual void handle_event (const SDL_Event &)
 
virtual void handle_window_event (const SDL_Event &event)
 
void init_flags ()
 Init the flag list and the team colors used by ~TC. More...
 
void reinit_flags_for_side (size_t side)
 Rebuild the flag list (not team colors) for a single side. More...
 
void reset_reports (reports &reports_object)
 
void render_image (int x, int y, const display::drawing_layer drawing_layer, const map_location &loc, surface image, bool hreverse=false, bool greyscale=false, fixed_t alpha=ftofxp(1.0), color_t blendto={0, 0, 0}, double blend_ratio=0, double submerged=0.0, bool vreverse=false)
 Draw an image at a certain location. More...
 
void draw_text_in_hex (const map_location &loc, const drawing_layer layer, const std::string &text, size_t font_size, color_t color, double x_in_hex=0.5, double y_in_hex=0.5)
 Draw text on a hex. More...
 
void drawing_buffer_add (const drawing_layer layer, const map_location &loc, int x, int y, const surface &surf, const SDL_Rect &clip=SDL_Rect())
 Add an item to the drawing buffer. More...
 
void drawing_buffer_add (const drawing_layer layer, const map_location &loc, int x, int y, const std::vector< surface > &surf, const SDL_Rect &clip=SDL_Rect())
 
void add_arrow (arrow &)
 
void remove_arrow (arrow &)
 
void update_arrow (arrow &a)
 Called by arrow objects when they change. More...
 
void replace_overlay_map (overlay_map *overlays)
 
- Public Member Functions inherited from filter_context
virtual ~filter_context ()
 
- Public Member Functions inherited from events::sdl_handler
virtual void process_event ()
 
virtual void volatile_draw ()
 
virtual void volatile_undraw ()
 
virtual bool requires_event_focus (const SDL_Event *=nullptr) const
 
virtual void process_help_string (int, int)
 
virtual void process_tooltip_string (int, int)
 
virtual void join ()
 
virtual void join (context &c)
 
virtual void join_same (sdl_handler *parent)
 
virtual void leave ()
 
virtual void join_global ()
 
virtual void leave_global ()
 
virtual bool has_joined ()
 
virtual bool has_joined_global ()
 

Static Public Member Functions

static displayget_singleton ()
 Returns the display object if a display object exists. More...
 
static void toggle_benchmark ()
 Toggle to continuously redraw the screen. More...
 
static void toggle_debug_foreground ()
 Toggle to debug foreground terrain. More...
 

Protected Types

enum  TERRAIN_TYPE { BACKGROUND, FOREGROUND }
 
typedef std::map< map_location,
std::string > 
exclusive_unit_draw_requests_t
 
typedef std::list< blit_helperdrawing_buffer
 
typedef std::map< map_location,
unsigned int > 
reach_map
 
typedef std::multimap
< map_location, overlay
overlay_map
 

Protected Member Functions

map_location get_middle_location () const
 
virtual void pre_draw ()
 Called near the beginning of each draw() call. More...
 
virtual void post_draw ()
 Called at the very end of each draw() call. More...
 
virtual const SDL_Rect & get_clip_rect ()
 Get the clipping rectangle for drawing. More...
 
virtual void draw_invalidated ()
 Only called when there's actual redrawing to do. More...
 
virtual void post_commit ()
 Hook for actions to take right after draw() calls drawing_buffer_commit No action here by default. More...
 
virtual void draw_hex (const map_location &loc)
 Redraws a single gamemap location. More...
 
virtual image::TYPE get_image_type (const map_location &loc)
 
virtual void draw_sidebar ()
 Called near the end of a draw operation, derived classes can use this to render a specific sidebar. More...
 
void draw_minimap ()
 
std::vector< surfaceget_terrain_images (const map_location &loc, const std::string &timeid, TERRAIN_TYPE terrain_type)
 
std::vector< surfaceget_fog_shroud_images (const map_location &loc, image::TYPE image_type)
 
void draw_image_for_report (surface &img, SDL_Rect &rect)
 
void scroll_to_xy (int screenxpos, int screenypos, SCROLL_TYPE scroll_type, bool force=true)
 
void fill_images_list (const std::string &prefix, std::vector< std::string > &images)
 
const std::string & get_variant (const std::vector< std::string > &variants, const map_location &loc) const
 
void drawing_buffer_commit ()
 Draws the drawing_buffer_ and clears it. More...
 
void drawing_buffer_clear ()
 Clears the drawing buffer. More...
 
void draw_all_panels ()
 redraw all panels associated with the map display More...
 
void draw_init ()
 Initiate a redraw. More...
 
void draw_wrap (bool update, bool force)
 
void process_reachmap_changes ()
 
- Protected Member Functions inherited from video2::draw_layering
 draw_layering (const bool auto_join=true)
 
virtual ~draw_layering ()
 
- Protected Member Functions inherited from events::sdl_handler
 sdl_handler (const bool auto_join=true)
 
virtual ~sdl_handler ()
 
virtual std::vector
< sdl_handler * > 
handler_members ()
 

Protected Attributes

const display_contextdc_
 
std::unique_ptr< halo::managerhalo_man_
 
std::weak_ptr< wb::managerwb_
 
exclusive_unit_draw_requests_t exclusive_unit_draw_requests_
 map of hexes where only one unit should be drawn, the one identified by the associated id string More...
 
CVideoscreen_
 
size_t currentTeam_
 
bool dont_show_all_
 
int xpos_
 
int ypos_
 
bool view_locked_
 
theme theme_
 
int zoom_index_
 
const std::unique_ptr
< fake_unit_manager
fake_unit_man_
 
const std::unique_ptr
< terrain_builder
builder_
 
surface minimap_
 
SDL_Rect minimap_location_
 
bool redrawMinimap_
 
bool redraw_background_
 
bool invalidateAll_
 
bool grid_
 
int diagnostic_label_
 
bool panelsDrawn_
 
double turbo_speed_
 
bool turbo_
 
bool invalidateGameStatus_
 
const std::unique_ptr< map_labelsmap_labels_
 
reportsreports_object_
 
events::generic_event scroll_event_
 Event raised when the map is being scrolled. More...
 
events::generic_event complete_redraw_event_
 notify observers that the screen has been redrawn completely atm this is used for replay_controller to add replay controls to the standard theme More...
 
boost::circular_buffer< unsigned > frametimes_
 
unsigned int fps_counter_
 
std::chrono::seconds fps_start_
 
unsigned int fps_actual_
 
uint32_t last_frame_finished_ = 0u
 
std::map< std::string, SDL_Rect > reportRects_
 
std::map< std::string, surfacereportSurfaces_
 
std::map< std::string, configreports_
 
std::vector< std::shared_ptr
< gui::button > > 
menu_buttons_
 
std::vector< std::shared_ptr
< gui::button > > 
action_buttons_
 
std::set< map_locationinvalidated_
 
surface mouseover_hex_overlay_
 
surface tod_hex_mask1
 
surface tod_hex_mask2
 
std::vector< std::string > fog_images_
 
std::vector< std::string > shroud_images_
 
map_location selectedHex_
 
map_location mouseoverHex_
 
CKey keys_
 
bool animate_map_
 Local cache for preferences::animate_map, since it is constantly queried. More...
 
bool animate_water_
 Local version of preferences::animate_water, used to detect when it's changed. More...
 
size_t activeTeam_
 
drawing_buffer drawing_buffer_
 
bool map_screenshot_
 Used to indicate to drawing functions that we are doing a map screenshot. More...
 
reach_map reach_map_
 
reach_map reach_map_old_
 
bool reach_map_changed_
 

Static Protected Attributes

static unsigned int zoom_ = DefaultZoom
 
static unsigned int last_zoom_ = SmallZoom
 
static displaysingleton_ = nullptr
 

Private Types

typedef std::list< arrow * > arrows_list_t
 
typedef std::map< map_location,
arrows_list_t
arrows_map_t
 

Private Member Functions

void read (const config &cfg)
 
void init_flags_for_side_internal (size_t side, const std::string &side_color)
 
surface get_flag (const map_location &loc)
 

Private Attributes

int blindfold_ctr_
 
std::vector< animated
< image::locator > > 
flags_
 Animated flags for each team. More...
 
overlay_mapoverlays_
 
int fps_handle_
 Handle for the label which displays frames per second. More...
 
int invalidated_hexes_
 Count work done for the debug info displayed under fps. More...
 
int drawn_hexes_
 
bool idle_anim_
 
double idle_anim_rate_
 
surface map_screenshot_surf_
 
std::vector< std::function
< void(display &)> > 
redraw_observers_
 
bool draw_coordinates_
 Debug flag - overlay x,y coords on tiles. More...
 
bool draw_terrain_codes_
 Debug flag - overlay terrain codes on tiles. More...
 
bool draw_num_of_bitmaps_
 Debug flag - overlay number of bitmaps on tiles. More...
 
arrows_map_t arrows_map_
 Maps the list of arrows for each location. More...
 
tod_color color_adjust_
 
bool dirty_
 

Detailed Description

Definition at line 78 of file display.hpp.

Member Typedef Documentation

typedef std::list<arrow*> display::arrows_list_t
private

Definition at line 1027 of file display.hpp.

typedef std::map<map_location, arrows_list_t > display::arrows_map_t
private

Definition at line 1028 of file display.hpp.

typedef std::list<blit_helper> display::drawing_buffer
protected

Definition at line 938 of file display.hpp.

typedef std::map<map_location, std::string> display::exclusive_unit_draw_requests_t
protected

Definition at line 638 of file display.hpp.

typedef std::multimap<map_location, overlay> display::overlay_map
protected

Definition at line 1000 of file display.hpp.

typedef std::map<map_location,unsigned int> display::reach_map
protected

Definition at line 994 of file display.hpp.

Member Enumeration Documentation

The layers to render something on.

This value should never be stored it's the internal drawing order and adding removing and reordering the layers should be safe. If needed in WML use the name and map that to the enum value.

Enumerator
LAYER_TERRAIN_BG 

Layer for the terrain drawn behind the unit.

LAYER_GRID_TOP 

Top half part of grid image.

LAYER_MOUSEOVER_OVERLAY 

Mouseover overlay used by editor.

LAYER_FOOTSTEPS 

Footsteps showing path from unit to mouse.

LAYER_MOUSEOVER_TOP 

Top half of image following the mouse.

LAYER_UNIT_FIRST 

Reserve layers to be selected for WML.

LAYER_UNIT_BG 

Used for the ellipse behind the unit.

LAYER_UNIT_DEFAULT 

default layer for drawing units

LAYER_TERRAIN_FG 

Layer for the terrain drawn in front of the unit.

LAYER_GRID_BOTTOM 

Used for the bottom half part of grid image.

Should be under moving units, to avoid masking south move.

LAYER_UNIT_MOVE_DEFAULT 

default layer for drawing moving units

LAYER_UNIT_FG 

Used for the ellipse in front of the unit.

LAYER_UNIT_MISSILE_DEFAULT 

default layer for missile frames

LAYER_UNIT_LAST 
LAYER_REACHMAP 

"black stripes" on unreachable hexes.

LAYER_MOUSEOVER_BOTTOM 

Bottom half of image following the mouse.

LAYER_FOG_SHROUD 

Fog and shroud.

LAYER_ARROWS 

Arrows from the arrows framework.

Used for planned moves display.

LAYER_ACTIONS_NUMBERING 

Move numbering for the whiteboard.

LAYER_SELECTED_HEX 

Image on the selected unit.

LAYER_ATTACK_INDICATOR 

Layer which holds the attack indicator.

LAYER_UNIT_BAR 

Unit bars and overlays are drawn on this layer (for testing here).

LAYER_MOVE_INFO 

Movement info (defense%, etc...).

LAYER_LINGER_OVERLAY 

The overlay used for the linger mode.

LAYER_BORDER 

The border of the map.

Definition at line 789 of file display.hpp.

Enumerator
SCROLL 
WARP 
ONSCREEN 
ONSCREEN_WARP 

Definition at line 522 of file display.hpp.

enum display::TERRAIN_TYPE
protected
Enumerator
BACKGROUND 
FOREGROUND 

Definition at line 695 of file display.hpp.

Constructor & Destructor Documentation

display::display ( const display_context dc,
CVideo video,
std::weak_ptr< wb::manager wb,
reports reports_object,
const config theme_cfg,
const config level,
bool  auto_join = true 
)
display::~display ( )
virtual

Definition at line 264 of file display.cpp.

References resources::fake_units, and singleton_.

Member Function Documentation

const theme::action * display::action_pressed ( )

Definition at line 1728 of file display.cpp.

References action_buttons_, theme::actions(), i, utf8::index(), and theme_.

Referenced by controller_base::play_slice().

void display::add_arrow ( arrow arrow)

Definition at line 3134 of file display.cpp.

References arrows_map_, and arrow::get_path().

bool display::add_exclusive_draw ( const map_location loc,
unit unit 
)

Allows a unit to request to be the only one drawn in its hex.

Useful for situations where multiple units (one real, multiple temporary) can end up stacked, such as with the whiteboard.

Parameters
locThe location of the unit requesting exclusivity.
unitThe unit requesting exclusivity.
Returns
false if there's already an exclusive draw request for this location.

Definition at line 408 of file display.cpp.

References exclusive_unit_draw_requests_, unit::id(), and map_location::valid().

Referenced by wb::highlighter::highlight(), wb::highlighter::highlight_main_visitor::visit(), wb::highlighter::highlight_secondary_visitor::visit(), and wb::highlighter::unhighlight_visitor::visit().

void display::add_overlay ( const map_location loc,
const std::string &  image,
const std::string &  halo = "",
const std::string &  team_name = "",
const std::string &  item_id = "",
bool  visible_under_fog = true 
)

Functions to add and remove overlays from locations.

An overlay is an image that is displayed on top of the tile. One tile may have multiple overlays.

Definition at line 107 of file display.cpp.

References get_location_x(), get_location_y(), halo_man_, hex_size(), and overlays_.

Referenced by editor::mouse_action_item::click_left(), and game_lua_kernel::intf_add_tile_overlay().

void display::add_redraw_observer ( std::function< void(display &)>  f)

Adds a redraw observer, a function object to be called when redraw_everything is used.

Definition at line 2422 of file display.cpp.

References f, and redraw_observers_.

void display::adjust_color_overlay ( int  r,
int  g,
int  b 
)

Add r,g,b to the colors for all images displayed on the map.

Used for special effects like flashes.

Definition at line 460 of file display.cpp.

References color_adjust_, and update_tod().

Referenced by game_lua_kernel::intf_color_adjust().

void display::announce ( const std::string &  msg,
const color_t color = font::GOOD_COLOR,
int  lifetime = 100 
)
void display::blindfold ( bool  flag)

Definition at line 517 of file display.cpp.

References blindfold_ctr_.

Referenced by blindfold::blindfold(), and blindfold::unblind().

void display::bounds_check_position ( )

Definition at line 2308 of file display.cpp.

References MaxZoom, MinZoom, image::set_zoom(), xpos_, ypos_, and zoom_.

Referenced by redraw_everything(), scroll(), scroll_to_xy(), and set_zoom().

void display::bounds_check_position ( int &  xpos,
int &  ypos 
)
void display::change_display_context ( const display_context dc)

Definition at line 501 of file display.cpp.

References builder_, dc_, and display_context::map().

Referenced by editor::map_context_refresher::refresh().

void display::clear_exclusive_draws ( )
inline

Cancels all the exclusive draw requests.

Definition at line 120 of file display.hpp.

References exclusive_unit_draw_requests_.

Referenced by wb::manager::on_gamestate_change().

void display::clear_mouseover_hex_overlay ( )
inline

Definition at line 445 of file display.hpp.

References mouseover_hex_overlay_.

Referenced by editor::editor_toolkit::clear_mouseover_overlay().

void display::clear_redraw_observers ( )

Clear the redraw observers.

Definition at line 2427 of file display.cpp.

References redraw_observers_.

events::generic_event& display::complete_redraw_event ( )
inline

Definition at line 562 of file display.hpp.

References complete_redraw_event_.

void display::create_buttons ( )
virtual const map_location& display::displayed_unit_hex ( ) const
inlinevirtual

Virtual functions shadowed in game_display.

These are needed to generate reports easily, without dynamic casting. Hope to factor out eventually.

Reimplemented in game_display.

Definition at line 204 of file display.hpp.

References map_location::null_location().

Referenced by get_visible_unit(), unit_alignment(), unit_hp(), unit_status(), and unit_weapons().

void display::draw ( )
virtual
void display::draw ( bool  update)

Definition at line 2436 of file display.cpp.

References draw().

void display::draw ( bool  update,
bool  force 
)
void display::draw_all_panels ( )
protected

redraw all panels associated with the map display

Definition at line 1482 of file display.cpp.

References draw_label(), draw_panel(), CVideo::getSurface(), theme::labels(), menu_buttons_, theme::panels(), recalculate_minimap(), render_buttons(), resources::screen, screen_, theme_, and video().

Referenced by draw_init().

void display::draw_hex ( const map_location loc)
protectedvirtual
void display::draw_image_for_report ( surface img,
SDL_Rect &  rect 
)
protected
void display::draw_init ( )
protected

Initiate a redraw.

Invalidate controls and panels when changed after they have been drawn initially. Useful for dynamic theme modification.

Definition at line 1651 of file display.cpp.

References theme::border_t::background_image, theme::border(), DBG_DP, draw_all_panels(), draw_background(), get_map(), get_screen_surface(), invalidate_locations_in_rect(), invalidateAll_, map_area(), map_outside_area(), panelsDrawn_, redraw_background_, redrawMinimap_, resources::screen, and theme_.

Referenced by draw().

void display::draw_invalidated ( )
protectedvirtual

Only called when there's actual redrawing to do.

Loops through invalidated locations and redraws them. Derived classes can override this, possibly to insert pre- or post-processing around a call to the base class's function.

Reimplemented in game_display.

Definition at line 2505 of file display.cpp.

References sdl::create_rect(), dc_, draw_hex(), drawn_hexes_, unit_map::end(), exclusive_unit_draw_requests_, unit_map::find(), get_clip_rect(), get_location_x(), get_location_y(), get_screen_surface(), invalidated_, invalidated_hexes_, sdl::rects_overlap(), unit_drawer::redraw_unit(), resources::screen, display_context::teams(), display_context::units(), and zoom_.

Referenced by draw(), and game_display::draw_invalidated().

void display::draw_minimap ( )
protected
void display::draw_minimap_units ( )
virtual void display::draw_sidebar ( )
inlineprotectedvirtual

Called near the end of a draw operation, derived classes can use this to render a specific sidebar.

Very similar to post_commit.

Reimplemented in game_display, and editor::editor_display.

Definition at line 691 of file display.hpp.

Referenced by draw().

void display::draw_text_in_hex ( const map_location loc,
const drawing_layer  layer,
const std::string &  text,
size_t  font_size,
color_t  color,
double  x_in_hex = 0.5,
double  y_in_hex = 0.5 
)
void display::draw_wrap ( bool  update,
bool  force 
)
protected
void display::drawing_buffer_add ( const drawing_layer  layer,
const map_location loc,
int  x,
int  y,
const surface surf,
const SDL_Rect &  clip = SDL_Rect() 
)

Add an item to the drawing buffer.

You need to update screen on affected area

Parameters
layerThe layer to draw on.
locThe hex the image belongs to, needed for the drawing order.

Definition at line 1216 of file display.cpp.

Referenced by unit_drawer::draw_bar(), wb::attack::draw_hex(), editor::editor_display::draw_hex(), wb::suppose_dead::draw_hex(), game_display::draw_hex(), draw_hex(), game_display::draw_movement_info(), draw_text_in_hex(), unit_drawer::redraw_unit(), and render_image().

void display::drawing_buffer_add ( const drawing_layer  layer,
const map_location loc,
int  x,
int  y,
const std::vector< surface > &  surf,
const SDL_Rect &  clip = SDL_Rect() 
)

Definition at line 1223 of file display.cpp.

void display::drawing_buffer_clear ( )
protected

Clears the drawing buffer.

Definition at line 1333 of file display.cpp.

References drawing_buffer_.

void display::drawing_buffer_commit ( )
protected

Draws the drawing_buffer_ and clears it.

Definition at line 1295 of file display.cpp.

References resources::screen, and sdl_blit().

Referenced by draw().

void display::enable_menu ( const std::string &  item,
bool  enable 
)

Finds the menu which has a given item in it, and enables or disables it.

Definition at line 1760 of file display.cpp.

References c, utf8::index(), menu_buttons_, theme::menus(), and theme_.

void display::fill_images_list ( const std::string &  prefix,
std::vector< std::string > &  images 
)
protected

Definition at line 466 of file display.cpp.

References image::exists(), i, and s.

Referenced by display().

std::shared_ptr< gui::button > display::find_action_button ( const std::string &  id)

Retrieves a pointer to a theme UI button.

Note
The returned pointer may either be nullptr, meaning the button isn't defined by the current theme, or point to a valid gui::button object. However, the objects retrieved will be destroyed and recreated by draw() method calls. Do NOT store these pointers for longer than strictly necessary to accomplish a specific task before the next screen refresh.

Definition at line 849 of file display.cpp.

References action_buttons_, and i.

Referenced by create_buttons(), editor::location_palette::draw_contents(), editor::palette_manager::draw_contents(), replay_controller::handle_generic_event(), editor::empty_palette::hide(), layout_buttons(), replay_controller::play_button(), replay_controller::play_move_button(), replay_controller::play_side_button(), replay_controller::play_turn_button(), turn_info::process_network_data(), replay_controller::reset_button(), hotkey::command_executor_default::set_button_state(), and replay_controller::stop_button().

std::shared_ptr< gui::button > display::find_menu_button ( const std::string &  id)
void display::flip ( )
bool display::fogged ( const map_location loc) const
terrain_builder& display::get_builder ( )
inline

Definition at line 458 of file display.hpp.

References builder_.

const SDL_Rect & display::get_clip_rect ( )
protectedvirtual

Get the clipping rectangle for drawing.

Virtual since the editor might use a slightly different approach.

Reimplemented in editor::editor_display.

Definition at line 2500 of file display.cpp.

References map_area().

Referenced by draw_invalidated().

const display_context& display::get_disp_context ( ) const
inlinevirtual
bool display::get_draw_coordinates ( ) const
inline

Getter for the x,y debug overlay on tiles.

Definition at line 354 of file display.hpp.

References draw_coordinates_.

Referenced by events::console_handler::do_toggle_draw_coordinates().

bool display::get_draw_num_of_bitmaps ( ) const
inline

Getter for the number of bitmaps debug overlay on tiles.

Definition at line 364 of file display.hpp.

References draw_num_of_bitmaps_.

Referenced by events::console_handler::do_toggle_draw_num_of_bitmaps().

bool display::get_draw_terrain_codes ( ) const
inline

Getter for the terrain code debug overlay on tiles.

Definition at line 359 of file display.hpp.

References draw_terrain_codes_.

Referenced by events::console_handler::do_toggle_draw_terrain_codes(), and editor::terrain_palette::draw_item().

surface display::get_flag ( const map_location loc)
private
std::vector< surface > display::get_fog_shroud_images ( const map_location loc,
image::TYPE  image_type 
)
protected
virtual const game_data* display::get_game_data ( ) const
inlinevirtual

Implements filter_context.

Definition at line 169 of file display.hpp.

halo::manager& display::get_halo_manager ( )
inline

Definition at line 174 of file display.hpp.

References halo_man_.

image::TYPE display::get_image_type ( const map_location loc)
protectedvirtual
Returns
the image type to be used for the passed hex

Reimplemented in editor::editor_display.

Definition at line 2717 of file display.cpp.

References image::TOD_COLORED.

Referenced by draw_hex().

int display::get_location_x ( const map_location loc) const
int display::get_location_y ( const map_location loc) const
virtual game_lua_kernel* display::get_lua_kernel ( ) const
inlinevirtual

TODO: display should not work as a filter context, this was only done for expedience so that the unit animation code can have a convenient and correct filter context readily available. a more correct solution is most likely to pass it a filter context from unit_animator when it needs to be matched. (it's not possible to store filter contexts with animations, because animations are cached across scenarios.) Note that after these lines which return nullptr, unit filters used in animations will not be able to make use of wml variables or lua scripting (but the latter was a bad idea anyways because it would be slow to constantly recompile the script.)

Implements filter_context.

Definition at line 170 of file display.hpp.

const gamemap& display::get_map ( ) const
inline
map_location display::get_middle_location ( ) const
protected

Definition at line 3166 of file display.cpp.

References map_area(), pixel_position_to_hex(), xpos_, and ypos_.

Referenced by write().

surface& display::get_screen_surface ( )
inline

return the screen surface or the surface used for map_screenshot.

Definition at line 198 of file display.hpp.

References CVideo::getSurface(), map_screenshot_, map_screenshot_surf_, and screen_.

Referenced by draw_init(), draw_invalidated(), halo::halo_impl::effect::render(), and halo::halo_impl::effect::unrender().

static display* display::get_singleton ( )
inlinestatic
const std::vector<team>& display::get_teams ( ) const
inline

Definition at line 94 of file display.hpp.

References dc_, and display_context::teams().

std::vector< surface > display::get_terrain_images ( const map_location loc,
const std::string &  timeid,
TERRAIN_TYPE  terrain_type 
)
protected
theme& display::get_theme ( )
inline
const time_of_day & display::get_time_of_day ( const map_location loc = map_location::null_location()) const
virtual

Reimplemented in game_display, and editor::editor_display.

Definition at line 433 of file display.cpp.

Referenced by draw_hex(), get_terrain_images(), and update_tod().

const tod_manager & display::get_tod_man ( ) const
virtual

This is implemented properly in game_display. The display:: impl could be pure virtual here but we decide not to.

Display objects don't hold a tod maanger, instead game_display objects do.

If the base version of this method is called, try to get it from resources and use an assert to check for failure.

Implements filter_context.

Reimplemented in game_display, and editor::editor_display.

Definition at line 443 of file display.cpp.

References resources::tod_manager.

const unit_map& display::get_units ( ) const
inline
const std::string & display::get_variant ( const std::vector< std::string > &  variants,
const map_location loc 
) const
protected

Definition at line 484 of file display.cpp.

References map_location::x, and map_location::y.

Referenced by draw_hex().

const rect_of_hexes display::get_visible_hexes ( ) const
inline

Returns the rectangular area of visible hexes.

Definition at line 339 of file display.hpp.

References hexes_under_rect(), and map_area().

Referenced by invalidate_animations(), and process_reachmap_changes().

double display::get_zoom_factor ( ) const
inline
int display::h ( ) const
inline
void display::handle_event ( const SDL_Event &  event)
virtual

Implements events::sdl_handler.

Definition at line 3243 of file display.cpp.

References gui2::dialogs::loading_screen::displaying(), draw(), and DRAW_ALL_EVENT.

void display::handle_window_event ( const SDL_Event &  event)
virtual

Implements events::sdl_handler.

Definition at line 3228 of file display.cpp.

References dirty_.

virtual bool display::has_time_area ( ) const
inlinevirtual

Reimplemented in game_display.

Definition at line 604 of file display.hpp.

const map_location display::hex_clicked_on ( int  x,
int  y 
) const

given x,y co-ordinates of an onscreen pixel, will return the location of the hex that this pixel corresponds to.

Returns an invalid location if the mouse isn't over any valid location.

Definition at line 585 of file display.cpp.

References map_area(), pixel_position_to_hex(), sdl::point_in_rect(), xpos_, and ypos_.

Referenced by soundsource::positional_source::calculate_volume(), editor::mouse_action_map_label::click_left(), editor::mouse_action_unit::click_left(), editor::mouse_action_item::click_left(), editor::brush_drag_mouse_action::click_left(), editor::mouse_action_paint::click_left(), editor::mouse_action_paste::click_left(), editor::mouse_action_fill::click_left(), editor::brush_drag_mouse_action::click_right(), editor::mouse_action_paint::click_right(), editor::mouse_action_fill::click_right(), editor::mouse_action_unit::drag_end_left(), editor::mouse_action_item::drag_end_left(), editor::brush_drag_mouse_action::drag_generic(), editor::mouse_action_map_label::drag_left(), editor::mouse_action_unit::drag_left(), editor::mouse_action_item::drag_left(), events::mouse_handler::hovered_hex(), events::mouse_handler_base::init_dragging(), editor::editor_controller::left_click(), events::mouse_handler::mouse_motion(), editor::editor_controller::mouse_motion(), events::mouse_handler_base::mouse_press(), editor::editor_controller::right_click(), editor::mouse_action_village::up_left(), editor::mouse_action_map_label::up_left(), editor::mouse_action_item::up_left(), editor::mouse_action_unit::up_left(), editor::mouse_action_starting_position::up_left(), editor::mouse_action_map_label::up_right(), editor::mouse_action_village::up_right(), editor::mouse_action_starting_position::up_right(), and editor::editor_toolkit::update_mouse_action_highlights().

int display::hex_size ( ) const
inline
int display::hex_width ( ) const
inline

Function which returns the width of a hex in pixels, up to where the next hex starts.

(i.e. not entirely from tip to tip – use hex_size() to get the distance from tip to tip)

Definition at line 253 of file display.hpp.

References zoom_.

Referenced by bounds_check_position(), draw_minimap(), get_location_x(), hexes_under_rect(), max_map_area(), minimap_location_on(), pixel_position_to_hex(), and tile_nearly_on_screen().

const display::rect_of_hexes display::hexes_under_rect ( const SDL_Rect &  r) const
void display::highlight_hex ( map_location  hex)
virtual

Reimplemented in game_display.

Definition at line 1626 of file display.cpp.

References invalidate(), and mouseoverHex_.

Referenced by game_display::highlight_hex(), and editor::editor_controller::mouse_motion().

bool display::idle_anim ( ) const
inline
double display::idle_anim_rate ( ) const
inline
virtual bool display::in_editor ( ) const
inlinevirtual

Reimplemented in editor::editor_display.

Definition at line 201 of file display.hpp.

Referenced by draw_hex().

virtual bool display::in_game ( ) const
inlinevirtual

Reimplemented in game_display.

Definition at line 200 of file display.hpp.

void display::init_flags ( )

Init the flag list and the team colors used by ~TC.

Definition at line 282 of file display.cpp.

References dc_, flags_, init_flags_for_side_internal(), image::set_team_colors(), t, and display_context::teams().

Referenced by display(), editor::context_manager::new_scenario(), and editor::map_context_refresher::refresh().

void display::init_flags_for_side_internal ( size_t  side,
const std::string &  side_color 
)
private
bool display::invalidate ( const map_location loc)

Function to invalidate a specific tile for redrawing.

Definition at line 2981 of file display.cpp.

References invalidateAll_, and invalidated_.

Referenced by editor::editor_display::add_brush_loc(), editor::editor_display::clear_brush_locs(), actions::shroud_clearer::clear_loc(), events::menu_handler::end_unit_turn(), wb::side_actions::execute_net_cmd(), unit_display::unit_mover::finish(), actions::get_village(), wb::ghost_owner_unit(), highlight_hex(), wb::attack::init(), wb::suppose_dead::init(), wb::attack::invalidate(), unit_animation::invalidate(), invalidate_animations(), invalidate_animations_location(), invalidate_locations_in_rect(), game_display::invalidate_route(), editor::mouse_action_item::move(), editor::mouse_action_unit::move(), move_unit_between(), parse_team_overlays(), actions::place_recruit(), fake_unit_manager::place_temporary_unit(), unit_creator::post_create(), unit_display::unit_mover::proceed_to(), process_reachmap_changes(), game_lua_kernel::put_unit_helper(), wb::attack::redraw(), wb::recall::redraw(), wb::recruit::redraw(), wb::suppose_dead::redraw(), wb::move::redraw(), editor::context_manager::refresh_after_action(), editor::editor_display::remove_brush_loc(), fake_unit_manager::remove_temporary_unit(), wb::manager::save_temp_attack(), select_hex(), game_display::set_attack_indicator(), editor::editor_display::set_brush_locs(), unit_display::unit_mover::start(), SYNCED_COMMAND_HANDLER_FUNCTION(), teleport_unit_between(), actions::undo::recruit_action::undo(), actions::undo::recall_action::undo(), wb::unghost_owner_unit(), events::menu_handler::unit_hold_position(), unit_display::unit_mover::wait_for_anims(), and wb::suppose_dead::~suppose_dead().

bool display::invalidate ( const std::set< map_location > &  locs)

Definition at line 2994 of file display.cpp.

References invalidateAll_, and invalidated_.

void display::invalidate_all ( )
void display::invalidate_animations ( )

Function to invalidate animated terrains and units which may have changed.

Definition at line 3065 of file display.cpp.

References preferences::animate_map(), animate_map_, builder_, dc_, fake_unit_man_, get_visible_hexes(), i, invalidate(), invalidate_animations_location(), new_animation_frame(), shrouded(), and display_context::units().

Referenced by draw().

void display::invalidate_animations_location ( const map_location loc)

Per-location invalidation called by invalidate_animations() Extra game per-location invalidation (village ownership)

Definition at line 3055 of file display.cpp.

References currentTeam_, dc_, flags_, fogged(), get_map(), invalidate(), display_context::teams(), and display_context::village_owner().

Referenced by invalidate_animations().

void display::invalidate_game_status ( )
inline
bool display::invalidate_locations_in_rect ( const SDL_Rect &  rect)

invalidate all hexes under the rectangle rect (in screen coordinates)

Definition at line 3043 of file display.cpp.

References hexes_under_rect(), invalidate(), and invalidateAll_.

Referenced by draw_init(), invalidate_visible_locations_in_rect(), and scroll().

void display::invalidate_theme ( )
inline
bool display::invalidate_visible_locations_in_rect ( const SDL_Rect &  rect)

Definition at line 3038 of file display.cpp.

References sdl::intersect_rects(), invalidate_locations_in_rect(), and map_area().

bool display::is_blindfolded ( ) const
map_labels & display::labels ( )
const map_labels & display::labels ( ) const

Definition at line 2495 of file display.cpp.

References map_labels_.

void display::layout_buttons ( )
const SDL_Rect & display::map_area ( ) const
const SDL_Rect& display::map_outside_area ( ) const
inline
const SDL_Rect & display::max_map_area ( ) const

Returns the maximum area used for the map regardless to resolution and view size.

Definition at line 531 of file display.cpp.

References theme::border(), get_map(), gamemap::h(), hex_size(), hex_width(), theme::border_t::size, theme_, and gamemap::w().

Referenced by map_area(), map_outside_area(), and screenshot().

const theme::menu * display::menu_pressed ( )
const SDL_Rect& display::minimap_area ( ) const
inline

Definition at line 215 of file display.hpp.

References theme::mini_map_location(), screen_area(), and theme_.

Referenced by draw_minimap(), and minimap_location_on().

map_location display::minimap_location_on ( int  x,
int  y 
)

given x,y co-ordinates of the mouse, will return the location of the hex in the minimap that the mouse is currently over, or an invalid location if the mouse isn't over the minimap.

Definition at line 746 of file display.cpp.

References get_map(), gamemap::h(), h(), hex_size(), hex_width(), minimap_area(), minimap_location_, pixel_position_to_hex(), sdl::point_in_rect(), gamemap::w(), w(), map_location::x, and map_location::y.

Referenced by events::mouse_handler_base::left_click(), events::mouse_handler_base::mouse_motion_default(), and events::mouse_handler_base::mouse_press().

const map_location& display::mouseover_hex ( ) const
inline
virtual const std::set<std::string>& display::observers ( ) const
inlinevirtual

Reimplemented in game_display.

Definition at line 206 of file display.hpp.

bool display::outside_area ( const SDL_Rect &  area,
const int  x,
const int  y 
) const

Check if the bbox of the hex at x,y has pixels outside the area rectangle.

Definition at line 576 of file display.cpp.

References hex_size().

Referenced by scroll_to_tiles(), and tile_fully_on_screen().

const SDL_Rect& display::palette_area ( ) const
inline
void display::parse_team_overlays ( )

Check the overlay_map for proper team-specific overlays to be displayed/hidden.

Definition at line 89 of file display.cpp.

References dc_, display_context::get_team(), i, invalidate(), overlays_, playing_team(), overlay::team_name, team::team_name(), and display_context::teams().

const map_location display::pixel_position_to_hex ( int  x,
int  y 
) const

given x,y co-ordinates of a pixel on the map, will return the location of the hex that this pixel corresponds to.

Returns an invalid location if the mouse isn't over any valid location.

Definition at line 600 of file display.cpp.

References theme::border(), hex_size(), hex_width(), s, theme::border_t::size, and theme_.

Referenced by get_middle_location(), hex_clicked_on(), and minimap_location_on().

virtual int display::playing_side ( ) const
inlinevirtual

Reimplemented in game_display.

Definition at line 205 of file display.hpp.

Referenced by attack_info(), gray_inactive(), and unit_moves().

size_t display::playing_team ( ) const
inline

The playing team is the team whose turn it is.

Definition at line 97 of file display.hpp.

References activeTeam_.

Referenced by parse_team_overlays(), and editor::mouse_action_village::up_left().

virtual void display::post_commit ( )
inlineprotectedvirtual

Hook for actions to take right after draw() calls drawing_buffer_commit No action here by default.

Reimplemented in game_display.

Definition at line 675 of file display.hpp.

Referenced by draw().

virtual void display::post_draw ( )
inlineprotectedvirtual

Called at the very end of each draw() call.

Derived classes can use this to add extra actions after redrawing invalidated hexes takes place. No action here by default.

Reimplemented in game_display.

Definition at line 655 of file display.hpp.

Referenced by draw().

virtual void display::pre_draw ( )
inlineprotectedvirtual

Called near the beginning of each draw() call.

Derived classes can use this to add extra actions before redrawing invalidated hexes takes place. No action here by default.

Reimplemented in game_display, and editor::editor_display.

Definition at line 648 of file display.hpp.

Referenced by draw().

void display::process_reachmap_changes ( )
protected
bool display::propagate_invalidation ( const std::set< map_location > &  locs)

If this set is partially invalidated, invalidate all its hexes.

Returns if any new invalidation was needed

Definition at line 3008 of file display.cpp.

References i, invalidateAll_, and invalidated_.

Referenced by unit_animation::invalidate().

void display::read ( const config cfg)
private

Definition at line 3181 of file display.cpp.

References tod_color::b, color_adjust_, tod_color::g, tod_color::r, and view_locked_.

Referenced by display().

void display::rebuild_all ( )

Rebuild all dynamic terrain.

Definition at line 490 of file display.cpp.

References builder_.

Referenced by game_display::maybe_rebuild(), editor::context_manager::refresh_after_action(), and editor::context_manager::refresh_all().

void display::recalculate_minimap ( )
inline
void display::redraw_everything ( )
void display::redraw_minimap ( )
inline

Schedule the minimap to be redrawn.

Useful if units have moved about on the map.

Definition at line 600 of file display.hpp.

References redrawMinimap_.

Referenced by actions::place_recruit(), actions::undo_list::redo(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::undo_list::undo(), and replay_controller::update_gui().

void display::refresh_report ( const std::string &  report_name,
const config new_cfg = nullptr 
)
void display::reinit_flags_for_side ( size_t  side)

Rebuild the flag list (not team colors) for a single side.

Definition at line 299 of file display.cpp.

References dc_, ERR_DP, init_flags_for_side_internal(), and display_context::teams().

Referenced by game_lua_kernel::intf_set_side_id().

void display::reload_map ( )

Updates internals that cache map size.

This should be called when the map size has changed.

Definition at line 495 of file display.cpp.

References builder_, and redraw_background_.

Referenced by editor::context_manager::reload_map(), and game_events::WML_HANDLER_FUNCTION().

void display::remove_arrow ( arrow arrow)

Definition at line 3143 of file display.cpp.

References arrows_map_, and arrow::get_path().

std::string display::remove_exclusive_draw ( const map_location loc)

Cancels an exclusive draw request.

Returns
The id of the unit whose exclusive draw request was canceled, or else the empty string if there was no exclusive draw request for this location.

Definition at line 421 of file display.cpp.

References exclusive_unit_draw_requests_, and map_location::valid().

Referenced by wb::highlighter::unhighlight().

void display::remove_overlay ( const map_location loc)

remove_overlay will remove all overlays on a tile.

Definition at line 118 of file display.cpp.

References overlays_.

Referenced by game_lua_kernel::intf_remove_tile_overlay().

void display::remove_single_overlay ( const map_location loc,
const std::string &  toDelete 
)

remove_single_overlay will remove a single overlay from a tile

Definition at line 134 of file display.cpp.

References overlays_.

Referenced by game_lua_kernel::intf_remove_tile_overlay().

void display::render_buttons ( )

Definition at line 950 of file display.cpp.

References action_buttons_, and menu_buttons_.

Referenced by draw_all_panels().

void display::render_image ( int  x,
int  y,
const display::drawing_layer  drawing_layer,
const map_location loc,
surface  image,
bool  hreverse = false,
bool  greyscale = false,
fixed_t  alpha = ftofxp(1.0),
color_t  blendto = {0,0,0},
double  blend_ratio = 0,
double  submerged = 0.0,
bool  vreverse = false 
)

Draw an image at a certain location.

x,y: pixel location on screen to draw the image image: the image to draw reverse: if the image should be flipped across the x axis greyscale: used for instance to give the petrified appearance to a unit image alpha: the merging to use with the background blendto: blend to this color using blend_ratio submerged: the amount of the unit out of 1.0 that is submerged (presumably under water) and thus shouldn't be drawn

Definition at line 1549 of file display.cpp.

References adjust_surface_alpha(), blend_surface(), brighten_image(), DefaultZoom, drawing_buffer_add(), ERR_DP, flop_surface(), ftofxp, greyscale_image(), make_neutral_surface(), map_area(), sdl::rects_overlap(), image::reverse_image(), submerge_alpha(), and zoom_.

Referenced by unit_frame::redraw().

void display::replace_overlay_map ( overlay_map overlays)
inline
void display::reset_halo_manager ( )

Definition at line 507 of file display.cpp.

References halo_man_.

void display::reset_halo_manager ( halo::manager hm)

Definition at line 512 of file display.cpp.

References halo_man_.

void display::reset_reports ( reports reports_object)
inline

Definition at line 623 of file display.hpp.

References reports_object_.

SDL_Rect display::screen_area ( ) const
inline
bool display::screenshot ( const std::string &  filename,
bool  map_screenshot = false 
)
bool display::scroll ( int  xmov,
int  ymov,
bool  force = false 
)
events::generic_event& display::scroll_event ( ) const
inline

Expose the event, so observers can be notified about map scrolling.

Definition at line 560 of file display.hpp.

References scroll_event_.

Referenced by soundsource::manager::manager().

void display::scroll_to_tile ( const map_location loc,
SCROLL_TYPE  scroll_type = ONSCREEN,
bool  check_fogged = true,
bool  force = true 
)
void display::scroll_to_tiles ( map_location  loc1,
map_location  loc2,
SCROLL_TYPE  scroll_type = ONSCREEN,
bool  check_fogged = true,
double  add_spacing = 0.0,
bool  force = true 
)

Scroll such that location loc1 is on-screen.

It will also try to make it such that loc2 is on-screen, but this is not guaranteed. For ONSCREEN scrolls add_spacing sets the desired minimum distance from the border in hexes.

Definition at line 2167 of file display.cpp.

Referenced by move_unit_between(), unit_display::unit_mover::proceed_to(), scroll_to_tile(), scroll_to_tiles(), unit_display::unit_mover::start(), teleport_unit_between(), unit_display::unit_attack(), and unit_display::unit_recruited().

void display::scroll_to_tiles ( const std::vector< map_location >::const_iterator &  begin,
const std::vector< map_location >::const_iterator &  end,
SCROLL_TYPE  scroll_type = ONSCREEN,
bool  check_fogged = true,
bool  only_if_possible = false,
double  add_spacing = 0.0,
bool  force = true 
)

Scroll to fit as many locations on-screen as possible, starting with the first.

Definition at line 2177 of file display.cpp.

References display::rect_of_hexes::end(), ERR_DP, fogged(), get_location_x(), get_location_y(), get_map(), h(), hex_size(), map_area(), ONSCREEN, ONSCREEN_WARP, outside_area(), round_double(), scroll_to_xy(), and w().

void display::scroll_to_tiles ( const std::vector< map_location > &  locs,
SCROLL_TYPE  scroll_type = ONSCREEN,
bool  check_fogged = true,
bool  only_if_possible = false,
double  add_spacing = 0.0,
bool  force = true 
)
inline

Scroll to fit as many locations on-screen as possible, starting with the first.

Definition at line 550 of file display.hpp.

References scroll_to_tiles().

void display::scroll_to_xy ( int  screenxpos,
int  screenypos,
SCROLL_TYPE  scroll_type,
bool  force = true 
)
protected
void display::select_hex ( map_location  hex)
virtual
const map_location& display::selected_hex ( ) const
inline
void display::set_default_zoom ( )

Sets the zoom amount to the default.

Definition at line 2047 of file display.cpp.

References DefaultZoom, last_zoom_, set_zoom(), and zoom_.

Referenced by hotkey::command_executor_default::zoom_default().

void display::set_diagnostic ( const std::string &  msg)
void display::set_draw_coordinates ( bool  value)
inline

Setter for the x,y debug overlay on tiles.

Definition at line 356 of file display.hpp.

References draw_coordinates_.

Referenced by events::console_handler::do_toggle_draw_coordinates(), editor::editor_controller::execute_command(), and editor::editor_controller::init_gui().

void display::set_draw_num_of_bitmaps ( bool  value)
inline

Setter for the terrain code debug overlay on tiles.

Definition at line 366 of file display.hpp.

References draw_num_of_bitmaps_.

Referenced by events::console_handler::do_toggle_draw_num_of_bitmaps(), editor::editor_controller::execute_command(), and editor::editor_controller::init_gui().

void display::set_draw_terrain_codes ( bool  value)
inline

Setter for the terrain code debug overlay on tiles.

Definition at line 361 of file display.hpp.

References draw_terrain_codes_.

Referenced by events::console_handler::do_toggle_draw_terrain_codes(), editor::editor_controller::execute_command(), and editor::editor_controller::init_gui().

void display::set_grid ( const bool  grid)
inline

Determines whether a grid should be overlayed on the game board.

(to more clearly show where hexes are)

Definition at line 351 of file display.hpp.

References preferences::grid(), and grid_.

Referenced by preferences::set_grid().

void display::set_idle_anim ( bool  ison)
inline

control unit idle animations and their frequency

Definition at line 490 of file display.hpp.

References idle_anim_.

Referenced by preferences::set_idle_anim().

void display::set_idle_anim_rate ( int  rate)

Definition at line 2366 of file display.cpp.

References idle_anim_rate_.

Referenced by display(), and preferences::set_idle_anim_rate().

void display::set_mouseover_hex_overlay ( const surface image)
inline
void display::set_playing_team ( size_t  team)

set_playing_team sets the team whose turn it currently is

Definition at line 401 of file display.cpp.

References activeTeam_, invalidate_game_status(), and utf8::size().

void display::set_team ( size_t  team,
bool  observe = false 
)

Sets the team controlled by the player using the computer.

Data from this team will be displayed in the game status.

Definition at line 382 of file display.cpp.

References currentTeam_, dc_, dont_show_all_, labels(), map_labels::recalculate_labels(), map_labels::set_team(), utf8::size(), display_context::teams(), w(), and wb_.

Referenced by turn_info::process_network_data().

void display::set_theme ( config  theme_cfg)
void display::set_turbo ( const bool  turbo)
inline

Set/Get whether 'turbo' mode is on.

When turbo mode is on, everything moves much faster.

Definition at line 483 of file display.hpp.

References preferences::turbo(), and turbo_.

Referenced by preferences::set_turbo().

void display::set_turbo_speed ( const double  speed)
inline

Definition at line 487 of file display.hpp.

References turbo_speed_.

Referenced by preferences::set_turbo_speed().

void display::set_view_locked ( bool  value)
inline

Sets whether the map view is locked (e.g.

so the user can't scroll away)

Definition at line 520 of file display.hpp.

References view_locked_.

Referenced by game_lua_kernel::intf_lock_view().

bool display::set_zoom ( bool  increase)
bool display::set_zoom ( unsigned int  amount,
const bool  validate_value_and_set_index = true 
)
bool display::show_everything ( ) const
inline
bool display::shrouded ( const map_location loc) const
gui::button::TYPE display::string_to_button_type ( std::string  type)
bool display::team_valid ( ) const
bool display::tile_fully_on_screen ( const map_location loc) const

Check if a tile is fully visible on screen.

Definition at line 2059 of file display.cpp.

References get_location_x(), get_location_y(), map_area(), and outside_area().

Referenced by unit_display::unit_mover::proceed_to().

bool display::tile_nearly_on_screen ( const map_location loc) const

Checks if location loc or one of the adjacent tiles is visible on screen.

Definition at line 2066 of file display.cpp.

References get_location_x(), get_location_y(), hex_size(), hex_width(), and map_area().

Referenced by unit_animation::invalidate(), and unit_animation_component::refresh().

void display::toggle_benchmark ( )
static

Toggle to continuously redraw the screen.

Definition at line 1338 of file display.cpp.

Referenced by events::console_handler::do_benchmark().

void display::toggle_debug_foreground ( )
static

Toggle to debug foreground terrain.

Separate background and foreground layer to better spot any error there.

Definition at line 1343 of file display.cpp.

Referenced by events::console_handler::do_foreground().

double display::turbo_speed ( ) const
const SDL_Rect& display::unit_image_area ( ) const
inline

Definition at line 219 of file display.hpp.

References screen_area(), theme_, and theme::unit_image_location().

void display::update_arrow ( arrow a)

Called by arrow objects when they change.

You should not need to call this directly.

Definition at line 3152 of file display.cpp.

References arrows_map_, arrow::get_path(), and arrow::get_previous_path().

void display::update_display ( )
void display::update_tod ( const time_of_day tod_override = nullptr)

Applies r,g,b coloring to the map.

The color is usually taken from get_time_of_day unless tod_override is given, in which case that color is used.

Parameters
tod_overrideThe ToD to apply to the map instead of that of the current ToD's.

Definition at line 449 of file display.cpp.

References tod_color::b, time_of_day::color, color_adjust_, tod_color::g, get_time_of_day(), tod_color::r, and image::set_color_adjustment().

Referenced by adjust_color_overlay(), game_display::new_turn(), and gui2::dialogs::custom_tod::update_tod_display().

CVideo& display::video ( )
inline

Gets the underlying screen object.

Definition at line 195 of file display.hpp.

References screen_.

Referenced by display_chat_manager::add_chat_message(), editor::location_palette::adjust_size(), editor::context_manager::apply_mask_dialog(), savegame::autosave_savegame::autosave(), BOOST_AUTO_TEST_CASE(), editor::context_manager::check_switch_open_map(), tooltips::click(), editor::context_manager::confirm_discard(), editor::context_manager::create_mask_to_dialog(), editor::editor_controller::custom_tods_dialog(), events::console_handler::do_choose_level(), events::console_handler::do_control_dialog(), events::console_handler::do_inspect(), events::console_handler::do_layers(), events::menu_handler::do_recruit(), events::menu_handler::do_search(), events::console_handler::do_theme(), events::console_handler::do_unsafe_lua(), draw_all_panels(), editor::context_manager::edit_scenario_dialog(), editor::context_manager::edit_side_dialog(), flip(), editor::context_manager::generate_map_dialog(), test_utils::get_fake_display(), hotkey::command_executor_default::get_video(), editor::location_palette::hide(), editor::editor_palette< overlay >::hide(), game_lua_kernel::intf_gamestate_inspector(), game_lua_kernel::intf_open_help(), events::menu_handler::label_settings(), events::menu_handler::label_terrain(), editor::context_manager::load_map(), editor::context_manager::load_map_dialog(), events::mouse_handler::move_unit_along_route(), editor::context_manager::new_map_dialog(), editor::context_manager::new_scenario_dialog(), events::menu_handler::preferences(), events::menu_handler::recall(), events::menu_handler::recruit(), editor::context_manager::rename_area_dialog(), events::menu_handler::rename_unit(), editor::context_manager::resize_map_dialog(), events::menu_handler::save_map(), editor::context_manager::save_map_as(), editor::context_manager::save_map_as_dialog(), editor::context_manager::save_scenario_as(), editor::context_manager::save_scenario_as_dialog(), editor::location_palette::select_item(), gui::floating_textbox::show(), events::mouse_handler::show_attack_dialog(), events::menu_handler::show_chat_log(), events::menu_handler::show_help(), hotkey::command_executor::show_menu(), events::menu_handler::show_statistics(), gui2::dialogs::show_unit_list(), events::menu_handler::status_table(), events::menu_handler::terrain_description(), unit_display::unit_attack(), events::menu_handler::unit_description(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_display::unit_healing(), unit_display::unit_recruited(), unit_display::unit_sheath_weapon(), editor::mouse_action_map_label::up_left(), editor::context_manager::write_map(), and editor::context_manager::write_scenario().

bool display::view_locked ( ) const
inline

Definition at line 517 of file display.hpp.

References view_locked_.

Referenced by game_lua_kernel::intf_view_locked().

int display::viewing_side ( ) const
inline
size_t display::viewing_team ( ) const
inline
int display::w ( ) const
inline

the dimensions of the display.

x and y are width/height. mapx is the width of the portion of the display which shows the game area. Between mapx and x is the sidebar region.width

Definition at line 213 of file display.hpp.

References sdl::window::get_output_size(), CVideo::get_window(), and screen_.

Referenced by announce(), draw_background(), game_display::draw_hex(), game_display::draw_movement_info(), controller_base::handle_scroll(), minimap_location_on(), game_display::post_draw(), game_display::pre_draw(), screen_area(), scroll_to_tiles(), and set_team().

void display::write ( config cfg) const
bool display::zoom_at_max ( ) const

Definition at line 1969 of file display.cpp.

References MaxZoom, and zoom_.

bool display::zoom_at_min ( ) const

Definition at line 1974 of file display.cpp.

References MinZoom, and zoom_.

Member Data Documentation

std::vector<std::shared_ptr<gui::button> > display::action_buttons_
protected
size_t display::activeTeam_
protected
bool display::animate_map_
protected

Local cache for preferences::animate_map, since it is constantly queried.

Definition at line 769 of file display.hpp.

Referenced by get_flag(), and invalidate_animations().

bool display::animate_water_
protected

Local version of preferences::animate_water, used to detect when it's changed.

Definition at line 772 of file display.hpp.

Referenced by draw().

arrows_map_t display::arrows_map_
private

Maps the list of arrows for each location.

Definition at line 1030 of file display.hpp.

Referenced by add_arrow(), draw_hex(), remove_arrow(), and update_arrow().

int display::blindfold_ctr_
private

Definition at line 630 of file display.hpp.

Referenced by blindfold(), display(), and is_blindfolded().

const std::unique_ptr<terrain_builder> display::builder_
protected
tod_color display::color_adjust_
private

Definition at line 1032 of file display.hpp.

Referenced by adjust_color_overlay(), draw_hex(), read(), update_tod(), and write().

events::generic_event display::complete_redraw_event_
protected

notify observers that the screen has been redrawn completely atm this is used for replay_controller to add replay controls to the standard theme

Definition at line 743 of file display.hpp.

Referenced by complete_redraw_event(), and redraw_everything().

size_t display::currentTeam_
protected
const display_context* display::dc_
protected
int display::diagnostic_label_
protected

Definition at line 728 of file display.hpp.

Referenced by set_diagnostic().

bool display::dirty_
private

Definition at line 1034 of file display.hpp.

Referenced by draw(), and handle_window_event().

bool display::dont_show_all_
protected
bool display::draw_coordinates_
private

Debug flag - overlay x,y coords on tiles.

Definition at line 1021 of file display.hpp.

Referenced by draw_hex(), get_draw_coordinates(), and set_draw_coordinates().

bool display::draw_num_of_bitmaps_
private

Debug flag - overlay number of bitmaps on tiles.

Definition at line 1025 of file display.hpp.

Referenced by draw_hex(), get_draw_num_of_bitmaps(), and set_draw_num_of_bitmaps().

bool display::draw_terrain_codes_
private

Debug flag - overlay terrain codes on tiles.

Definition at line 1023 of file display.hpp.

Referenced by draw_hex(), get_draw_terrain_codes(), and set_draw_terrain_codes().

drawing_buffer display::drawing_buffer_
protected

Definition at line 939 of file display.hpp.

Referenced by drawing_buffer_clear().

int display::drawn_hexes_
private

Definition at line 1011 of file display.hpp.

Referenced by draw_invalidated(), and update_display().

exclusive_unit_draw_requests_t display::exclusive_unit_draw_requests_
protected

map of hexes where only one unit should be drawn, the one identified by the associated id string

Definition at line 640 of file display.hpp.

Referenced by add_exclusive_draw(), clear_exclusive_draws(), game_display::draw_invalidated(), draw_invalidated(), and remove_exclusive_draw().

const std::unique_ptr<fake_unit_manager> display::fake_unit_man_
protected

Definition at line 720 of file display.hpp.

Referenced by display(), game_display::draw_invalidated(), and invalidate_animations().

std::vector<animated<image::locator> > display::flags_
private

Animated flags for each team.

Definition at line 780 of file display.hpp.

Referenced by get_flag(), init_flags(), init_flags_for_side_internal(), and invalidate_animations_location().

std::vector<std::string> display::fog_images_
protected

Definition at line 761 of file display.hpp.

Referenced by display(), and draw_hex().

unsigned int display::fps_actual_
protected

Definition at line 748 of file display.hpp.

Referenced by draw_wrap(), and update_display().

unsigned int display::fps_counter_
protected

Definition at line 746 of file display.hpp.

Referenced by draw_wrap().

int display::fps_handle_
private

Handle for the label which displays frames per second.

Definition at line 1008 of file display.hpp.

Referenced by update_display().

std::chrono::seconds display::fps_start_
protected

Definition at line 747 of file display.hpp.

Referenced by draw_wrap().

boost::circular_buffer<unsigned> display::frametimes_
protected

Definition at line 745 of file display.hpp.

Referenced by draw_wrap(), and update_display().

bool display::grid_
protected

Definition at line 727 of file display.hpp.

Referenced by draw_hex(), and set_grid().

std::unique_ptr<halo::manager> display::halo_man_
protected
bool display::idle_anim_
private

Definition at line 1013 of file display.hpp.

Referenced by idle_anim(), and set_idle_anim().

double display::idle_anim_rate_
private

Definition at line 1014 of file display.hpp.

Referenced by idle_anim_rate(), and set_idle_anim_rate().

bool display::invalidateAll_
protected
std::set<map_location> display::invalidated_
protected
int display::invalidated_hexes_
private

Count work done for the debug info displayed under fps.

Definition at line 1010 of file display.hpp.

Referenced by draw_invalidated(), and update_display().

bool display::invalidateGameStatus_
protected
CKey display::keys_
protected

Definition at line 766 of file display.hpp.

Referenced by turbo_speed().

uint32_t display::last_frame_finished_ = 0u
protected

Definition at line 749 of file display.hpp.

Referenced by draw_wrap().

unsigned int display::last_zoom_ = SmallZoom
staticprotected

Definition at line 719 of file display.hpp.

Referenced by set_default_zoom(), and set_zoom().

const std::unique_ptr<map_labels> display::map_labels_
protected

Definition at line 733 of file display.hpp.

Referenced by labels().

bool display::map_screenshot_
protected

Used to indicate to drawing functions that we are doing a map screenshot.

Definition at line 980 of file display.hpp.

Referenced by get_screen_surface(), map_area(), map_outside_area(), and screenshot().

surface display::map_screenshot_surf_
private

Definition at line 1016 of file display.hpp.

Referenced by get_screen_surface(), and screenshot().

std::vector<std::shared_ptr<gui::button> > display::menu_buttons_
protected
surface display::minimap_
protected

Definition at line 722 of file display.hpp.

Referenced by draw_minimap(), and recalculate_minimap().

SDL_Rect display::minimap_location_
protected

Definition at line 723 of file display.hpp.

Referenced by draw_minimap(), draw_minimap_units(), and minimap_location_on().

surface display::mouseover_hex_overlay_
protected

Definition at line 757 of file display.hpp.

Referenced by clear_mouseover_hex_overlay(), draw_hex(), and set_mouseover_hex_overlay().

map_location display::mouseoverHex_
protected
overlay_map* display::overlays_
private
bool display::panelsDrawn_
protected

Definition at line 729 of file display.hpp.

Referenced by draw_init(), invalidate_theme(), and redraw_everything().

reach_map display::reach_map_
protected
bool display::reach_map_changed_
protected
reach_map display::reach_map_old_
protected

Definition at line 996 of file display.hpp.

Referenced by process_reachmap_changes().

bool display::redraw_background_
protected

Definition at line 725 of file display.hpp.

Referenced by draw_init(), redraw_everything(), reload_map(), and set_zoom().

std::vector<std::function<void(display&)> > display::redraw_observers_
private

Definition at line 1018 of file display.hpp.

Referenced by add_redraw_observer(), clear_redraw_observers(), and redraw_everything().

bool display::redrawMinimap_
protected

Definition at line 724 of file display.hpp.

Referenced by draw_init(), draw_wrap(), recalculate_minimap(), redraw_minimap(), and scroll().

std::map<std::string, SDL_Rect> display::reportRects_
protected

Definition at line 752 of file display.hpp.

Referenced by redraw_everything(), and refresh_report().

std::map<std::string, config> display::reports_
protected

Definition at line 754 of file display.hpp.

Referenced by redraw_everything(), and refresh_report().

reports* display::reports_object_
protected

Definition at line 734 of file display.hpp.

Referenced by game_display::draw_sidebar(), refresh_report(), and reset_reports().

std::map<std::string, surface> display::reportSurfaces_
protected

Definition at line 753 of file display.hpp.

Referenced by redraw_everything(), and refresh_report().

CVideo& display::screen_
protected
events::generic_event display::scroll_event_
mutableprotected

Event raised when the map is being scrolled.

Definition at line 737 of file display.hpp.

Referenced by scroll(), and scroll_event().

map_location display::selectedHex_
protected
std::vector<std::string> display::shroud_images_
protected

Definition at line 762 of file display.hpp.

Referenced by display(), and draw_hex().

display * display::singleton_ = nullptr
staticprotected

Definition at line 1040 of file display.hpp.

Referenced by display(), game_display::get_singleton(), get_singleton(), and ~display().

theme display::theme_
protected
surface display::tod_hex_mask1
protected

Definition at line 760 of file display.hpp.

Referenced by draw_hex(), and game_display::new_turn().

surface display::tod_hex_mask2
protected

Definition at line 760 of file display.hpp.

Referenced by draw_hex(), and game_display::new_turn().

bool display::turbo_
protected

Definition at line 731 of file display.hpp.

Referenced by set_turbo(), and turbo_speed().

double display::turbo_speed_
protected

Definition at line 730 of file display.hpp.

Referenced by set_turbo_speed(), and turbo_speed().

bool display::view_locked_
protected

Definition at line 715 of file display.hpp.

Referenced by read(), scroll(), scroll_to_xy(), set_view_locked(), view_locked(), and write().

std::weak_ptr<wb::manager> display::wb_
protected
int display::xpos_
protected
int display::ypos_
protected
unsigned int display::zoom_ = DefaultZoom
staticprotected
int display::zoom_index_
protected

Definition at line 718 of file display.hpp.

Referenced by display(), and set_zoom().


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