The Battle for Wesnoth  1.15.0-dev
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
game_display Class Reference

#include <game_display.hpp>

Inheritance diagram for game_display:
Inheritance graph

Public Types

enum  game_mode { RUNNING, LINGER }
 Sets the linger mode for the display. More...
 
- Public Types inherited from display
enum  SCROLL_TYPE { SCROLL, WARP, ONSCREEN, ONSCREEN_WARP }
 

Public Member Functions

 game_display (game_board &board, std::weak_ptr< wb::manager > wb, const config &theme_cfg, const config &level, bool dummy=false)
 
 ~game_display ()
 
void new_turn ()
 Update lighting settings. More...
 
virtual const std::set< std::string > & observers () const override
 
void scroll_to_leader (int side, SCROLL_TYPE scroll_type=ONSCREEN, bool force=true)
 Scrolls to the leader of a certain side. More...
 
virtual void select_hex (map_location hex) override
 Function to display a location as selected. More...
 
virtual void highlight_hex (map_location hex) override
 Function to highlight a location. More...
 
void display_unit_hex (map_location hex)
 Change the unit to be displayed in the sidebar. More...
 
void highlight_reach (const pathfind::paths &paths_list)
 Sets the paths that are currently displayed as available for the unit to move along. More...
 
void highlight_another_reach (const pathfind::paths &paths_list)
 Add more paths to highlight. More...
 
bool unhighlight_reach ()
 Reset highlighting of paths. More...
 
void set_route (const pathfind::marked_route *route)
 Sets the route along which footsteps are drawn to show movement of a unit. More...
 
void float_label (const map_location &loc, const std::string &text, const color_t &color)
 Function to float a label above a tile. More...
 
void draw_movement_info ()
 Draws the movement info (turns available). More...
 
void invalidate_unit_after_move (const map_location &src, const map_location &dst)
 Same as invalidate_unit() if moving the displayed unit. More...
 
virtual const time_of_dayget_time_of_day (const map_location &loc) const override
 
virtual bool has_time_area () const override
 
void set_attack_indicator (const map_location &src, const map_location &dst)
 Set the attack direction indicator. More...
 
void clear_attack_indicator ()
 
std::string attack_indicator_direction () const
 Function to get attack direction suffix. More...
 
t_translation::terrain_code get_terrain_on (int palx, int paly, int x, int y)
 
virtual const map_locationdisplayed_unit_hex () const override
 Virtual functions shadowed in game_display. More...
 
virtual int playing_side () const override
 The playing team is the team whose turn it is. More...
 
std::string current_team_name () const
 
display_chat_managerget_chat_manager ()
 
void begin_game ()
 
virtual bool in_game () const override
 
void set_game_mode (const game_mode mode)
 
void needs_rebuild (bool b)
 Sets whether the screen (map visuals) needs to be rebuilt. This is typically after the map has been changed by wml. More...
 
bool maybe_rebuild ()
 Rebuilds the screen if needs_rebuild(true) was previously called, and resets the flag. More...
 
- Public Member Functions inherited from display
 display (const display_context *dc, std::weak_ptr< wb::manager > wb, 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
 
std::size_t playing_team () const
 The playing team is the team whose turn it is. More...
 
bool team_valid () const
 
std::size_t viewing_team () const
 The viewing team is the team currently viewing the game. More...
 
int viewing_side () const
 
void set_team (std::size_t team, bool observe=false)
 Sets the team controlled by the player using the computer. More...
 
void set_playing_team (std::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 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_contextcurrent_display_context () const
 
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...
 
virtual bool in_editor () const
 
const SDL_Rect & minimap_area () const
 mapx is the width of the portion of the display which shows the game area. More...
 
const SDL_Rect & palette_area () const
 
const SDL_Rect & unit_image_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...
 
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
 
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
 
SDL_Point get_loc_drawing_origin (const map_location &loc) const
 Wrapper to return the drawing origin for the specified location in screen coordinates. More...
 
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...
 
surface screenshot (bool map_screenshot=false)
 Capture a (map-)screenshot into a surface. More...
 
themeget_theme ()
 
void set_theme (config theme_cfg)
 
void invalidate_animations ()
 Function to invalidate animated terrains and units which may have changed. More...
 
void reset_standing_animations ()
 
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 rebuild_all ()
 Rebuild all dynamic terrain. 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) const
 
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...
 
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...
 
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...
 
map_labelslabels ()
 
const map_labelslabels () const
 
void announce (const std::string &msg, const color_t &color=font::GOOD_COLOR, const announce_options &options=announce_options())
 Announce a message prominently. More...
 
void blindfold (bool flag)
 
bool is_blindfolded () const
 
void write (config &cfg) const
 
virtual void handle_event (const SDL_Event &) override
 
virtual void handle_window_event (const SDL_Event &event) override
 
void init_flags ()
 Initialize the flag list for all sides. More...
 
void init_flags (std::size_t side_index)
 Initialize the flag list for a single side. More...
 
void draw_debugging_aids ()
 
template<typename... T>
void render_scaled_to_zoom (const texture &tex, const int x_pos, const int y_pos, T &&... extra_args) const
 Renders a texture directly to the screen (or current rendering target) scaled to the current zoom factor. More...
 
template<typename... T>
void render_scaled_to_zoom (const texture &tex, const map_location &loc, T &&... extra_args) const
 Renders a texture directly to the screen (or current rendering target) scaled to the current zoom factor. More...
 
map_location get_middle_location () const
 
int draw_text_in_hex (const map_location &loc, const std::string &text, std::size_t font_size, color_t color, int fl_label_id=0, double x_in_hex=0.5, double y_in_hex=0.5)
 Adds a floating label with the specified text at the given location. More...
 
void add_arrow (arrow &)
 
void remove_arrow (arrow &)
 
void update_arrow (arrow &a)
 Called by arrow objects when they change. More...
 
- Public Member Functions inherited from events::sdl_handler
virtual void process_event ()
 
virtual bool requires_event_focus (const SDL_Event *=nullptr) const
 
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 game_displayget_singleton ()
 
static int & debug_highlight (const map_location &loc)
 annotate hex with number, useful for debugging or UI prototype More...
 
static void clear_debug_highlights ()
 
- Static Public Member Functions inherited from display
static displayget_singleton ()
 Returns the display object if a display object exists. More...
 
static bool outside_area (const SDL_Rect &area, const int x, const int y)
 Check if the bbox of the hex at x,y has pixels outside the area rectangle. More...
 
static int hex_width ()
 Function which returns the width of a hex in pixels, up to where the next hex starts. More...
 
static int hex_size ()
 Function which returns the size of a hex in pixels (from top tip to bottom tip or left edge to right edge). More...
 
static void toggle_benchmark ()
 Toggle to continuously redraw the screen. More...
 
static void toggle_debug_foreground ()
 Toggle to debug foreground terrain. More...
 
static bool zoom_at_max ()
 
static bool zoom_at_min ()
 

Protected Member Functions

virtual void pre_draw () override
 game_display pre_draw does specific things related e.g. More...
 
virtual void post_draw () override
 Calls the whiteboard's post-draw method. More...
 
virtual void draw_hex_cursor (const map_location &loc) override
 Draws the map's hex cursor. More...
 
virtual void draw_hex_overlays () override
 Draws various map overlays such as game reachmap. More...
 
virtual overlay_mapget_overlays () override
 Inherited from display. More...
 
- Protected Member Functions inherited from display
virtual void draw () override final
 Main drawing function. More...
 
virtual image::TYPE get_image_type (const map_location &loc)
 
virtual const SDL_Rect get_clip_rect ()
 Get the clipping rectangle for drawing. More...
 
void draw_fog_shroud_transition_images (const map_location &loc, image::TYPE image_type)
 Draw the appropriate fog or shroud transition images for a specific hex. More...
 
void scroll_to_xy (int screenxpos, int screenypos, SCROLL_TYPE scroll_type, bool force=true)
 
const std::string & get_variant (const std::vector< std::string > &variants, const map_location &loc) const
 
- 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 ()
 

Private Member Functions

 game_display (const game_display &)
 
void operator= (const game_display &)
 
void draw_footstep_images () const
 

Private Attributes

overlay_map overlay_map_
 
map_location attack_indicator_src_
 
map_location attack_indicator_dst_
 
std::vector< font::floating_label_scope_helperhex_def_fl_labels_
 
pathfind::marked_route route_
 
map_location displayedUnitHex_
 
bool first_turn_
 
bool in_game_
 
const std::unique_ptr< display_chat_managerchat_man_
 
game_mode mode_
 
bool needs_rebuild_
 

Static Private Attributes

static std::map< map_location, int > debugHighlights_
 

Additional Inherited Members

- Protected Types inherited from display
using exclusive_unit_draw_requests_t = std::map< map_location, std::string >
 
typedef std::map< map_location, unsigned int > reach_map
 
typedef std::multimap< map_location, overlayoverlay_map
 
- Static Protected Member Functions inherited from display
static void fill_images_list (const std::string &prefix, std::vector< std::string > &images)
 
- Protected Attributes inherited from display
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...
 
CVideovideo_
 
std::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_managerfake_unit_man_
 
const std::unique_ptr< terrain_builderbuilder_
 
SDL_Rect minimap_location_
 
bool grid_
 
int diagnostic_label_
 
double turbo_speed_
 
bool turbo_
 
const std::unique_ptr< map_labelsmap_labels_
 
events::generic_event scroll_event_
 Event raised when the map is being scrolled. 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
 
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...
 
std::size_t activeTeam_
 
bool map_screenshot_
 Used to indicate to drawing functions that we are doing a map screenshot. More...
 
reach_map reach_map_
 
- Static Protected Attributes inherited from display
static unsigned int zoom_ = DefaultZoom
 
static unsigned int last_zoom_ = SmallZoom
 
static displaysingleton_ = nullptr
 

Detailed Description

Definition at line 40 of file game_display.hpp.

Member Enumeration Documentation

◆ game_mode

Sets the linger mode for the display.

There have been some discussions on what to do with fog and shroud the extra variables make it easier to modify the behavior. There might even be a split between victory and defeat.

Todo:
if the current implementation is wanted we can change the stuff back to a boolean
Enumerator
RUNNING 

no linger overlay, show fog and shroud.

LINGER 

Definition at line 194 of file game_display.hpp.

Constructor & Destructor Documentation

◆ game_display() [1/2]

game_display::game_display ( game_board board,
std::weak_ptr< wb::manager wb,
const config theme_cfg,
const config level,
bool  dummy = false 
)

Definition at line 57 of file game_display.cpp.

References CVideo::clear_screen(), and display::video().

◆ ~game_display()

game_display::~game_display ( )

Definition at line 82 of file game_display.cpp.

References chat_man_.

◆ game_display() [2/2]

game_display::game_display ( const game_display )
private

Member Function Documentation

◆ attack_indicator_direction()

std::string game_display::attack_indicator_direction ( ) const
inline

Function to get attack direction suffix.

Definition at line 154 of file game_display.hpp.

References map_location::write_direction().

Referenced by draw_hex_overlays().

◆ begin_game()

void game_display::begin_game ( )

Definition at line 673 of file game_display.cpp.

References in_game_.

◆ clear_attack_indicator()

void game_display::clear_attack_indicator ( )

◆ clear_debug_highlights()

static void game_display::clear_debug_highlights ( )
inlinestatic

Definition at line 170 of file game_display.hpp.

◆ current_team_name()

std::string game_display::current_team_name ( ) const

◆ debug_highlight()

int & game_display::debug_highlight ( const map_location loc)
static

annotate hex with number, useful for debugging or UI prototype

Definition at line 646 of file game_display.cpp.

References game_config::debug, and debugHighlights_.

◆ display_unit_hex()

void game_display::display_unit_hex ( map_location  hex)

Change the unit to be displayed in the sidebar.

This is used when selecting or highlighting is not wanted.

< Lasts for whole method.

Definition at line 167 of file game_display.cpp.

References display::dc_, displayedUnitHex_, display::dont_show_all_, resources::gameboard, game_board::get_visible_unit(), synced_context::is_synced(), display_context::teams(), map_location::valid(), and display::viewing_team().

Referenced by events::mouse_handler::attack_enemy_(), select_hex(), and unit_display::unit_healing().

◆ displayed_unit_hex()

virtual const map_location& game_display::displayed_unit_hex ( ) const
inlineoverridevirtual

Virtual functions shadowed in game_display.

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

Reimplemented from display.

Definition at line 164 of file game_display.hpp.

◆ draw_footstep_images()

void game_display::draw_footstep_images ( ) const
private

◆ draw_hex_cursor()

void game_display::draw_hex_cursor ( const map_location )
overrideprotectedvirtual

◆ draw_hex_overlays()

void game_display::draw_hex_overlays ( )
overrideprotectedvirtual

◆ draw_movement_info()

void game_display::draw_movement_info ( )

◆ float_label()

void game_display::float_label ( const map_location loc,
const std::string &  text,
const color_t color 
)

◆ get_chat_manager()

display_chat_manager& game_display::get_chat_manager ( )
inline

◆ get_overlays()

display::overlay_map & game_display::get_overlays ( )
overrideprotectedvirtual

Inherited from display.

Implements display.

Definition at line 695 of file game_display.cpp.

References overlay_map_.

◆ get_singleton()

static game_display* game_display::get_singleton ( )
inlinestatic

◆ get_terrain_on()

t_translation::terrain_code game_display::get_terrain_on ( int  palx,
int  paly,
int  x,
int  y 
)

◆ get_time_of_day()

const time_of_day & game_display::get_time_of_day ( const map_location loc) const
overridevirtual

Reimplemented from display.

Definition at line 362 of file game_display.cpp.

References tod_manager::get_time_of_day(), and resources::tod_manager.

◆ has_time_area()

bool game_display::has_time_area ( ) const
overridevirtual

Reimplemented from display.

Definition at line 367 of file game_display.cpp.

References tod_manager::has_time_area(), name, display::team_valid(), and resources::tod_manager.

◆ highlight_another_reach()

void game_display::highlight_another_reach ( const pathfind::paths paths_list)

Add more paths to highlight.

Print numbers where they overlap. Used only by Show Enemy Moves.

Definition at line 601 of file game_display.cpp.

References pathfind::paths::step::curr, pathfind::paths::destinations, and display::reach_map_.

Referenced by highlight_reach(), events::mouse_handler::select_hex(), and events::menu_handler::show_enemy_moves().

◆ highlight_hex()

void game_display::highlight_hex ( map_location  hex)
overridevirtual

Function to highlight a location.

If a unit is in the location, it will be displayed in the sidebar. Selection is used when a unit has been clicked on, while highlighting is used when a location has been moused over.

< Lasts for whole method.

Reimplemented from display.

Definition at line 147 of file game_display.cpp.

References unit_map::count(), display::dc_, displayedUnitHex_, display::dont_show_all_, resources::gameboard, game_board::get_visible_unit(), display::highlight_hex(), synced_context::is_synced(), display::mouseoverHex_, display::selectedHex_, display_context::teams(), display_context::units(), and display::viewing_team().

Referenced by events::mouse_handler::attack_enemy_(), events::menu_handler::do_search(), and events::mouse_handler::mouse_motion().

◆ highlight_reach()

void game_display::highlight_reach ( const pathfind::paths paths_list)

Sets the paths that are currently displayed as available for the unit to move along.

All other paths will be grayed out.

Definition at line 595 of file game_display.cpp.

References highlight_another_reach(), and unhighlight_reach().

Referenced by events::mouse_handler::mouse_motion(), and events::mouse_handler::select_hex().

◆ in_game()

virtual bool game_display::in_game ( ) const
inlineoverridevirtual

Reimplemented from display.

Definition at line 183 of file game_display.hpp.

◆ invalidate_unit_after_move()

void game_display::invalidate_unit_after_move ( const map_location src,
const map_location dst 
)

Same as invalidate_unit() if moving the displayed unit.

Definition at line 180 of file game_display.cpp.

References displayedUnitHex_.

Referenced by actions::undo::move_action::undo().

◆ maybe_rebuild()

bool game_display::maybe_rebuild ( )

Rebuilds the screen if needs_rebuild(true) was previously called, and resets the flag.

Definition at line 685 of file game_display.cpp.

References needs_rebuild_, and display::rebuild_all().

Referenced by game_events::wml_event_pump::process_event().

◆ needs_rebuild()

void game_display::needs_rebuild ( bool  b)

Sets whether the screen (map visuals) needs to be rebuilt. This is typically after the map has been changed by wml.

Definition at line 678 of file game_display.cpp.

References needs_rebuild_.

Referenced by game_events::WML_HANDLER_FUNCTION().

◆ new_turn()

void game_display::new_turn ( )

◆ observers()

virtual const std::set<std::string>& game_display::observers ( ) const
inlineoverridevirtual

Reimplemented from display.

Definition at line 62 of file game_display.hpp.

Referenced by events::menu_handler::has_friends(), and gui2::dialogs::mp_change_control::pre_show().

◆ operator=()

void game_display::operator= ( const game_display )
private

◆ playing_side()

virtual int game_display::playing_side ( ) const
inlineoverridevirtual

The playing team is the team whose turn it is.

Reimplemented from display.

Definition at line 174 of file game_display.hpp.

Referenced by turn_info::process_network_data().

◆ post_draw()

void game_display::post_draw ( )
overrideprotectedvirtual

Calls the whiteboard's post-draw method.

Reimplemented from display.

Definition at line 209 of file game_display.cpp.

References w, and display::wb_.

◆ pre_draw()

void game_display::pre_draw ( )
overrideprotectedvirtual

game_display pre_draw does specific things related e.g.

to unit rendering and calls the whiteboard pre-draw method.

Todo:
FIXME: must modify changed, but best to do it at the floating_label level

Reimplemented from display.

Definition at line 196 of file game_display.cpp.

References chat_man_, w, and display::wb_.

◆ scroll_to_leader()

void game_display::scroll_to_leader ( int  side,
SCROLL_TYPE  scroll_type = ONSCREEN,
bool  force = true 
)

Scrolls to the leader of a certain side.

This will normally be the playing team.

Definition at line 187 of file game_display.cpp.

References display::dc_, unit_map::find_leader(), display::scroll_to_tile(), display_context::units(), and unit_map::iterator_base< iter_types >::valid().

Referenced by events::menu_handler::status_table().

◆ select_hex()

void game_display::select_hex ( map_location  hex)
overridevirtual

Function to display a location as selected.

If a unit is in the location, and there is no unit in the currently highlighted hex, the unit will be displayed in the sidebar.

Reimplemented from display.

Definition at line 137 of file game_display.cpp.

References display_unit_hex(), display::fogged(), display::select_hex(), and map_location::valid().

Referenced by events::mouse_handler::attack_enemy_(), events::mouse_handler::move_action(), events::mouse_handler::move_unit_along_current_route(), events::mouse_handler::save_whiteboard_attack(), and events::mouse_handler::select_hex().

◆ set_attack_indicator()

void game_display::set_attack_indicator ( const map_location src,
const map_location dst 
)

Set the attack direction indicator.

Definition at line 652 of file game_display.cpp.

References attack_indicator_dst_, and attack_indicator_src_.

Referenced by clear_attack_indicator(), and events::mouse_handler::mouse_motion().

◆ set_game_mode()

void game_display::set_game_mode ( const game_mode  mode)

Definition at line 395 of file game_display.cpp.

References mode_.

◆ set_route()

void game_display::set_route ( const pathfind::marked_route route)

◆ unhighlight_reach()

bool game_display::unhighlight_reach ( )

Member Data Documentation

◆ attack_indicator_dst_

map_location game_display::attack_indicator_dst_
private

Definition at line 216 of file game_display.hpp.

Referenced by draw_hex_overlays(), and set_attack_indicator().

◆ attack_indicator_src_

map_location game_display::attack_indicator_src_
private

Definition at line 215 of file game_display.hpp.

Referenced by draw_hex_overlays(), and set_attack_indicator().

◆ chat_man_

const std::unique_ptr<display_chat_manager> game_display::chat_man_
private

Definition at line 226 of file game_display.hpp.

Referenced by pre_draw(), and ~game_display().

◆ debugHighlights_

std::map< map_location, fixed_t > game_display::debugHighlights_
staticprivate

Definition at line 231 of file game_display.hpp.

Referenced by debug_highlight(), and draw_hex_overlays().

◆ displayedUnitHex_

map_location game_display::displayedUnitHex_
private

Definition at line 222 of file game_display.hpp.

Referenced by display_unit_hex(), highlight_hex(), and invalidate_unit_after_move().

◆ first_turn_

bool game_display::first_turn_
private

Definition at line 224 of file game_display.hpp.

Referenced by new_turn().

◆ hex_def_fl_labels_

std::vector<font::floating_label_scope_helper> game_display::hex_def_fl_labels_
private

Definition at line 218 of file game_display.hpp.

Referenced by draw_movement_info().

◆ in_game_

bool game_display::in_game_
private

Definition at line 224 of file game_display.hpp.

Referenced by begin_game().

◆ mode_

game_mode game_display::mode_
private

Definition at line 228 of file game_display.hpp.

Referenced by draw_hex_overlays(), and set_game_mode().

◆ needs_rebuild_

bool game_display::needs_rebuild_
private

Definition at line 233 of file game_display.hpp.

Referenced by maybe_rebuild(), and needs_rebuild().

◆ overlay_map_

overlay_map game_display::overlay_map_
private

Definition at line 212 of file game_display.hpp.

Referenced by get_overlays().

◆ route_

pathfind::marked_route game_display::route_
private

Definition at line 220 of file game_display.hpp.

Referenced by draw_footstep_images(), draw_movement_info(), and set_route().


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