#include <display.hpp>
Classes | |
struct | announce_options |
Holds options for calls to function 'announce' (announce). More... | |
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, 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 gamemap & | get_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_map & | get_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, float z_order=0) |
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_context & | get_disp_context () const |
void | reset_halo_manager () |
void | reset_halo_manager (halo::manager &hm) |
halo::manager & | get_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... | |
CVideo & | video () |
Gets the underlying screen object. More... | |
surface & | get_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_location & | displayed_unit_hex () const |
Virtual functions shadowed in game_display. More... | |
virtual int | playing_side () const |
virtual const std::set< std::string > & | observers () 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... | |
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_location & | selected_hex () const |
const map_location & | mouseover_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... | |
surface | screenshot (bool map_screenshot=false) |
Capture a (map-)screenshot into a surface. 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... | |
theme & | get_theme () |
void | set_theme (config theme_cfg) |
std::shared_ptr< gui::button > | find_action_button (const std::string &id) |
Retrieves a pointer to a theme UI button. More... | |
std::shared_ptr< gui::button > | find_menu_button (const std::string &id) |
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 | 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_builder & | get_builder () |
void | flip () |
void | update_display () |
Copy the backbuffer to the framebuffer. More... | |
void | rebuild_all () |
Rebuild all dynamic terrain. More... | |
const theme::action * | action_pressed () |
const theme::menu * | menu_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) 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 | toggle_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_event & | scroll_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... | |
virtual void | draw () |
Draws invalidated items. More... | |
void | draw (bool update) |
void | draw (bool update, bool force) |
map_labels & | labels () |
const map_labels & | labels () 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 | recalculate_minimap () |
Schedule the minimap for recalculation. More... | |
void | redraw_minimap () |
Schedule the minimap to be redrawn. More... | |
virtual const time_of_day & | get_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_team (const team &) |
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, std::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... | |
![]() | |
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 () |
sdl_handler & | operator= (sdl_handler &&)=delete |
Moving would require two instances' context membership to be handled, it's simpler to delete these and require the two instances to be separately constructed / destructed. More... | |
sdl_handler (sdl_handler &&)=delete | |
Static Public Member Functions | |
static display * | get_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 double | get_zoom_factor () |
Returns the current zoom factor. More... | |
static gui::button::TYPE | string_to_button_type (const std::string &type) |
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 Types | |
enum | TERRAIN_TYPE { BACKGROUND, FOREGROUND } |
typedef std::map< map_location, std::string > | exclusive_unit_draw_requests_t |
typedef std::list< blit_helper > | drawing_buffer |
typedef std::map< map_location, unsigned int > | reach_map |
typedef std::map< map_location, std::vector< 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 () |
void | get_terrain_images (const map_location &loc, const std::string &timeid, TERRAIN_TYPE terrain_type) |
std::vector< surface > | get_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 | 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 () |
virtual overlay_map & | get_overlays ()=0 |
![]() | |
draw_layering (const bool auto_join=true) | |
virtual | ~draw_layering () |
![]() | |
sdl_handler (const bool auto_join=true) | |
sdl_handler (const sdl_handler &) | |
sdl_handler & | operator= (const sdl_handler &) |
virtual | ~sdl_handler () |
virtual std::vector< sdl_handler * > | handler_members () |
Static Protected Member Functions | |
static void | fill_images_list (const std::string &prefix, std::vector< std::string > &images) |
static const std::string & | get_variant (const std::vector< std::string > &variants, const map_location &loc) |
Static Protected Attributes | |
static unsigned int | zoom_ = DefaultZoom |
The current zoom, in pixels (on screen) per 72 pixels (in the graphic assets), i.e., 72 means 100%. More... | |
static unsigned int | last_zoom_ = SmallZoom |
The previous value of zoom_. More... | |
static display * | singleton_ = 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 (std::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... | |
std::vector< surface > | terrain_image_vector_ |
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_ |
Definition at line 78 of file display.hpp.
|
private |
Definition at line 1065 of file display.hpp.
|
private |
Definition at line 1066 of file display.hpp.
|
protected |
Definition at line 974 of file display.hpp.
|
protected |
Definition at line 661 of file display.hpp.
|
protected |
Definition at line 1040 of file display.hpp.
|
protected |
Definition at line 1034 of file display.hpp.
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.
Definition at line 821 of file display.hpp.
enum display::SCROLL_TYPE |
Enumerator | |
---|---|
SCROLL | |
WARP | |
ONSCREEN | |
ONSCREEN_WARP |
Definition at line 525 of file display.hpp.
|
protected |
Enumerator | |
---|---|
BACKGROUND | |
FOREGROUND |
Definition at line 718 of file display.hpp.
display::display | ( | const display_context * | dc, |
std::weak_ptr< wb::manager > | wb, | ||
reports & | reports_object, | ||
const config & | theme_cfg, | ||
const config & | level, | ||
bool | auto_join = true |
||
) |
Definition at line 166 of file display.cpp.
References action_buttons_, blindfold_ctr_, config::child_or_empty(), create_buttons(), DefaultZoom, fake_unit_man_, resources::fake_units, CVideo::faked(), fill_images_list(), fog_images_, game_config::fog_prefix, get_zoom_levels_index(), CVideo::getSurface(), preferences::idle_anim_rate(), init_flags(), CVideo::lock_updates(), MaxZoom, menu_buttons_, CVideo::non_interactive(), read(), screen_, set_idle_anim_rate(), preferences::set_tile_size(), image::set_zoom(), shroud_images_, game_config::shroud_prefix, singleton_, game_config::tile_size, preferences::tile_size(), zoom_, zoom_index_, and zoom_levels.
|
virtual |
Definition at line 285 of file display.cpp.
References resources::fake_units, and singleton_.
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 3140 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.
loc | The location of the unit requesting exclusivity. |
unit | The unit requesting exclusivity. |
Definition at line 426 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 , |
||
float | z_order = 0 |
||
) |
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 134 of file display.cpp.
References get_location_x(), get_location_y(), get_overlays(), halo_man_, and hex_size().
Referenced by editor::mouse_action_item::click_left().
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 2469 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 468 of file display.cpp.
References color_adjust_, and update_tod().
void display::announce | ( | const std::string & | msg, |
const color_t & | color = font::GOOD_COLOR , |
||
const announce_options & | options = announce_options() |
||
) |
Announce a message prominently.
Definition at line 1778 of file display.cpp.
References font::add_floating_label(), display::announce_options::discard_previous, h, display::announce_options::lifetime, map_outside_area(), font::remove_floating_label(), font::floating_label::set_clip_rect(), font::floating_label::set_color(), font::floating_label::set_font_size(), font::floating_label::set_lifetime(), font::floating_label::set_position(), font::SIZE_XLARGE, and w.
Referenced by SYNCED_COMMAND_HANDLER_FUNCTION(), play_controller::hotkey_handler::toggle_accelerated_speed(), and playsingle_controller::hotkey_handler::whiteboard_toggle().
void display::blindfold | ( | bool | flag | ) |
Definition at line 529 of file display.cpp.
References blindfold_ctr_.
void display::bounds_check_position | ( | ) |
Definition at line 2357 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 | ||
) | const |
Definition at line 2376 of file display.cpp.
References theme::border(), get_map(), gamemap::h(), h, hex_width(), map_area(), theme::border_t::size, theme_, gamemap::w(), and zoom_.
void display::change_display_context | ( | const display_context * | dc | ) |
Definition at line 513 of file display.cpp.
References builder_, dc_, and display_context::map().
Referenced by editor::context_manager::refresh_on_context_change().
|
inline |
Cancels all the exclusive draw requests.
Definition at line 122 of file display.hpp.
Referenced by wb::manager::on_gamestate_change().
|
inline |
Definition at line 448 of file display.hpp.
Referenced by editor::editor_toolkit::clear_mouseover_overlay().
void display::clear_redraw_observers | ( | ) |
Clear the redraw observers.
Definition at line 2474 of file display.cpp.
References redraw_observers_.
void display::create_buttons | ( | ) |
Definition at line 877 of file display.cpp.
References action_buttons_, theme::actions(), b, DBG_DP, gui::button::DEFAULT_SPACE, find_action_button(), find_menu_button(), layout_buttons(), menu_buttons_, theme::menus(), screen_, string_to_button_type(), theme_, gui::button::TYPE_CHECK, and gui::button::TYPE_PRESS.
Referenced by game_display::begin_game(), display(), editor::editor_controller::editor_controller(), redraw_everything(), editor::context_manager::refresh_all(), replay_controller::replay_controller(), set_theme(), and replay_controller::~replay_controller().
|
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 207 of file display.hpp.
References map_location::null_location().
Referenced by get_visible_unit(), unit_hp(), and unit_status().
|
virtual |
Draws invalidated items.
If update is true, will also copy the display to the frame buffer. If force is true, will not skip frames, even if running behind. Not virtual, since it gathers common actions. Calls various protected virtuals (further below) to allow specialized behavior in derived classes.
Reimplemented from events::sdl_handler.
Definition at line 2479 of file display.cpp.
Referenced by actions::shroud_clearer::clear_unit(), draw(), handle_event(), game_lua_kernel::intf_redraw(), redraw_everything(), screenshot(), scroll_to_xy(), set_zoom(), unit_display::unit_recruited(), and gui2::dialogs::custom_tod::update_tod_display().
void display::draw | ( | bool | update | ) |
Definition at line 2483 of file display.cpp.
References draw().
void display::draw | ( | bool | update, |
bool | force | ||
) |
Definition at line 2488 of file display.cpp.
References preferences::animate_water(), animate_water_, builder_, dirty_, draw_init(), draw_invalidated(), draw_sidebar(), draw_wrap(), drawing_buffer_commit(), get_map(), invalidate_animations(), invalidated_, post_commit(), post_draw(), pre_draw(), redraw_everything(), screen_, and CVideo::update_locked().
|
protected |
redraw all panels associated with the map display
Definition at line 1473 of file display.cpp.
References draw_label(), draw_panel(), CVideo::getSurface(), theme::labels(), menu_buttons_, theme::panels(), recalculate_minimap(), render_buttons(), screen_, theme_, and video().
Referenced by draw_init().
|
protectedvirtual |
Redraws a single gamemap location.
Reimplemented in game_display, and editor::editor_display.
Definition at line 2589 of file display.cpp.
References a, arrows_map_, tod_color::b, BACKGROUND, time_of_day::color, color_adjust_, game_config::debug, dont_show_all_, draw_coordinates_, arrow::draw_hex(), draw_num_of_bitmaps_, draw_terrain_codes_, drawing_buffer_add(), sdl::fill_surface_rect(), fog_images_, fogged(), FOREGROUND, tod_color::g, get_flag(), get_fog_shroud_images(), image::get_image(), get_image_type(), image::get_light_string(), image::get_lighted_image(), get_location_x(), get_location_y(), get_map(), get_overlays(), font::get_rendered_text(), get_teams(), get_terrain_images(), get_time_of_day(), get_variant(), grid_, game_config::images::grid_bottom, game_config::images::grid_top, hex_size(), time_of_day::id, time_of_day::image_mask, in_editor(), LAYER_FOG_SHROUD, LAYER_GRID_BOTTOM, LAYER_GRID_TOP, LAYER_MOUSEOVER_OVERLAY, LAYER_TERRAIN_BG, LAYER_TERRAIN_FG, LAYER_UNIT_DEFAULT, mouseover_hex_overlay_, mouseoverHex_, font::NORMAL_COLOR, gamemap::on_board(), tod_color::r, image::SCALED_TO_HEX, shroud_images_, shrouded(), font::SIZE_SMALL, utils::split(), terrain_image_vector_, image::TOD_COLORED, tod_hex_mask1, tod_hex_mask2, and viewing_team().
Referenced by editor::editor_display::draw_hex(), game_display::draw_hex(), and draw_invalidated().
|
protected |
Definition at line 2769 of file display.cpp.
References get_non_transparent_portion(), get_surface_portion(), CVideo::getSurface(), scale_surface(), screen_, and sdl_blit().
Referenced by refresh_report().
|
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_, and theme_.
Referenced by draw().
|
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 2552 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(), display_context::teams(), display_context::units(), and zoom_.
Referenced by draw(), and game_display::draw_invalidated().
|
protected |
Definition at line 1794 of file display.cpp.
References theme::border(), currentTeam_, dc_, draw_centered_on_background(), draw_minimap_units(), get_map(), image::getMinimap(), CVideo::getSurface(), gamemap::h(), hex_size(), hex_width(), is_blindfolded(), map_area(), map_outside_area(), minimap_, minimap_area(), minimap_location_, reach_map_, screen_, selectedHex_, theme::border_t::size, display_context::teams(), theme_, map_location::valid(), gamemap::w(), xpos_, and ypos_.
Referenced by draw_wrap().
void display::draw_minimap_units | ( | ) |
Definition at line 1872 of file display.cpp.
References allied, game_config::color_info(), currentTeam_, dc_, enemy, fogged(), get_map(), team::get_minimap_color(), orb_status_helper::get_orb_color(), CVideo::getSurface(), gamemap::h(), is_blindfolded(), is_odd(), preferences::minimap_draw_units(), minimap_location_, preferences::minimap_movement_coding(), color_range::rep(), screen_, display_context::teams(), color_t::to_argb_bytes(), display_context::unit_orb_status(), display_context::units(), and gamemap::w().
Referenced by draw_minimap().
|
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 714 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, | ||
std::size_t | font_size, | ||
color_t | color, | ||
double | x_in_hex = 0.5 , |
||
double | y_in_hex = 0.5 |
||
) |
Draw text on a hex.
(0.5, 0.5) is the center. The font size is adjusted to the zoom factor.
Definition at line 1521 of file display.cpp.
References font::BLACK_COLOR, drawing_buffer_add(), get_location_x(), get_location_y(), font::get_rendered_text(), get_zoom_factor(), and hex_size().
Referenced by wb::recall::draw_hex(), wb::recruit::draw_hex(), wb::move::draw_hex(), game_display::draw_hex(), game_display::draw_movement_info(), and wb::draw_numbers().
|
protected |
Definition at line 1690 of file display.cpp.
References CVideo::current_refresh_rate(), preferences::draw_delay(), draw_minimap(), fps_actual_, fps_counter_, fps_start_, frametimes_, last_frame_finished_, redrawMinimap_, screen_, and update_display().
Referenced by draw().
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
layer | The layer to draw on. |
loc | The hex the image belongs to, needed for the drawing order. |
x | The x coordinate. |
y | The y coordinate. |
surf | The surface to use. |
clip |
Definition at line 1207 of file display.cpp.
References drawing_buffer_.
Referenced by unit_drawer::draw_bar(), editor::editor_display::draw_hex(), wb::attack::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 1214 of file display.cpp.
References drawing_buffer_, display::drawing_buffer_key::layer_groups, LAYER_REACHMAP, LAYER_TERRAIN_BG, LAYER_UNIT_FIRST, and LAYER_UNIT_MOVE_DEFAULT.
|
protected |
Clears the drawing buffer.
Definition at line 1324 of file display.cpp.
References drawing_buffer_.
Referenced by drawing_buffer_commit().
|
protected |
Draws the drawing_buffer_ and clears it.
Definition at line 1286 of file display.cpp.
References drawing_buffer_, drawing_buffer_clear(), get_screen_surface(), map_area(), 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_.
|
staticprotected |
Definition at line 474 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.
Definition at line 830 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(), turn_info::process_network_data(), hotkey::command_executor_default::set_button_state(), and play_controller::toggle_skipping_replay().
std::shared_ptr< gui::button > display::find_menu_button | ( | const std::string & | id | ) |
Definition at line 840 of file display.cpp.
References i, and menu_buttons_.
Referenced by create_buttons(), editor::palette_manager::draw_contents(), editor::empty_palette::hide(), editor::location_palette::hide(), layout_buttons(), and hotkey::command_executor_default::set_button_state().
void display::flip | ( | ) |
Definition at line 1339 of file display.cpp.
References font::draw_floating_labels(), CVideo::flip(), CVideo::getSurface(), events::raise_volatile_draw_event(), events::raise_volatile_undraw_event(), font::undraw_floating_labels(), and video().
Referenced by update_display().
bool display::fogged | ( | const map_location & | loc | ) | const |
Returns true if location (x,y) is covered in fog.
Definition at line 743 of file display.cpp.
References currentTeam_, dc_, dont_show_all_, is_blindfolded(), and display_context::teams().
Referenced by soundsource::positional_source::calculate_volume(), events::menu_handler::do_search(), draw_hex(), draw_minimap_units(), game_display::float_label(), get_flag(), get_fog_shroud_images(), invalidate_animations_location(), is_fogged(), events::mouse_handler::mouse_motion(), unit_creator::post_create(), scroll_to_tiles(), game_display::select_hex(), events::mouse_handler::select_hex(), events::menu_handler::show_enemy_moves(), events::mouse_handler::touch_motion(), unit_display::unit_attack(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_display::unit_healing(), events::mouse_handler::unit_in_cycle(), unit_display::unit_recruited(), and unit_display::unit_sheath_weapon().
|
inline |
Definition at line 461 of file display.hpp.
References wfl::msg().
|
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 2547 of file display.cpp.
References map_area().
Referenced by draw_invalidated().
|
inline |
Definition at line 170 of file display.hpp.
Referenced by display_chat_manager::add_chat_message(), events::menu_handler::goto_leader(), terrain_label::hidden(), help::load_terrain_types_data(), unit_display::unit_recruited(), and terrain_label::viewable().
|
inline |
Getter for the x,y debug overlay on tiles.
Definition at line 355 of file display.hpp.
|
inline |
Getter for the number of bitmaps debug overlay on tiles.
Definition at line 365 of file display.hpp.
|
inline |
Getter for the terrain code debug overlay on tiles.
Definition at line 360 of file display.hpp.
Referenced by editor::terrain_palette::draw_item().
|
private |
Definition at line 380 of file display.cpp.
References animate_map_, dc_, game_config::images::flag, flags_, fogged(), image::get_image(), get_map(), display_context::get_team(), team::is_enemy(), t, display_context::teams(), image::TOD_COLORED, and viewing_side().
Referenced by draw_hex().
|
protected |
Definition at line 966 of file display.cpp.
References image::exists(), game_config::fog_prefix, fogged(), get_adjacent_tiles(), get_direction(), image::get_image(), i, name, names, game_config::shroud_prefix, shrouded(), and editor::start().
Referenced by draw_hex().
|
inline |
Definition at line 177 of file display.hpp.
|
protectedvirtual |
Reimplemented in editor::editor_display.
Definition at line 2761 of file display.cpp.
References image::TOD_COLORED.
Referenced by draw_hex().
int display::get_location_x | ( | const map_location & | loc | ) | const |
Functions to get the on-screen positions of hexes.
Definition at line 748 of file display.cpp.
References theme::border(), hex_width(), map_area(), theme::border_t::size, theme_, map_location::x, and xpos_.
Referenced by add_overlay(), terrain_label::draw(), editor::editor_display::draw_hex(), wb::attack::draw_hex(), wb::suppose_dead::draw_hex(), arrow::draw_hex(), game_display::draw_hex(), draw_hex(), draw_invalidated(), game_display::draw_movement_info(), draw_text_in_hex(), game_display::float_label(), unit_frame::get_overlaped_hex(), terrain_label::get_rect(), play_controller::hotkey_handler::left_mouse_click(), editor::mouse_action_unit::move(), unit_frame::redraw(), unit_drawer::redraw_unit(), halo::halo_impl::effect::render(), play_controller::hotkey_handler::right_mouse_click(), scroll_to_tiles(), halo::halo_impl::effect::set_location(), tile_fully_on_screen(), tile_nearly_on_screen(), and halo::halo_impl::effect::unrender().
int display::get_location_y | ( | const map_location & | loc | ) | const |
Definition at line 753 of file display.cpp.
References theme::border(), is_odd(), map_area(), theme::border_t::size, theme_, map_location::x, map_location::y, ypos_, and zoom_.
Referenced by add_overlay(), terrain_label::draw(), editor::editor_display::draw_hex(), wb::attack::draw_hex(), wb::suppose_dead::draw_hex(), arrow::draw_hex(), game_display::draw_hex(), draw_hex(), draw_invalidated(), game_display::draw_movement_info(), draw_text_in_hex(), game_display::float_label(), unit_frame::get_overlaped_hex(), terrain_label::get_rect(), play_controller::hotkey_handler::left_mouse_click(), editor::mouse_action_unit::move(), unit_frame::redraw(), unit_drawer::redraw_unit(), halo::halo_impl::effect::render(), play_controller::hotkey_handler::right_mouse_click(), scroll_to_tiles(), halo::halo_impl::effect::set_location(), tile_fully_on_screen(), tile_nearly_on_screen(), and halo::halo_impl::effect::unrender().
|
inline |
Definition at line 94 of file display.hpp.
Referenced by editor::location_palette::adjust_size(), bounds_check_position(), editor::mouse_action_item::click_left(), editor::mouse_action_unit::click_left(), events::console_handler::do_layers(), editor::mouse_action_map_label::drag_end_left(), editor::mouse_action_item::drag_end_left(), editor::mouse_action_unit::drag_end_left(), draw(), game_display::draw_hex(), draw_hex(), draw_init(), draw_minimap(), draw_minimap_units(), game_display::draw_movement_info(), editor::editor_display::draw_sidebar(), get_flag(), unit_animation_component::invalidate(), invalidate_animations_location(), editor::mouse_action::key_event(), editor::editor_display::map(), editor::terrain_palette::map(), unit_animation::matches(), max_map_area(), minimap_location_on(), screenshot(), scroll_to_tile(), scroll_to_tiles(), editor::mouse_action::set_terrain_mouse_overlay(), editor::mouse_action_village::up_left(), editor::mouse_action_map_label::up_left(), editor::mouse_action_unit::up_left(), editor::mouse_action_item::up_left(), and editor::mouse_action_village::up_right().
|
protected |
Definition at line 3172 of file display.cpp.
References map_area(), pixel_position_to_hex(), xpos_, and ypos_.
Referenced by write().
|
protectedpure virtual |
Implemented in game_display, and editor::editor_display.
Referenced by add_overlay(), draw_hex(), parse_team_overlays(), remove_overlay(), and remove_single_overlay().
|
inline |
return the screen surface or the surface used for map_screenshot.
Definition at line 201 of file display.hpp.
Referenced by draw_init(), draw_invalidated(), drawing_buffer_commit(), halo::halo_impl::effect::render(), and halo::halo_impl::effect::unrender().
|
inlinestatic |
Returns the display object if a display object exists.
Otherwise it returns nullptr. the display object represents the game gui which handles themewml and drawing the map. A display object only exists during a game or while the mapeditor is running.
Definition at line 90 of file display.hpp.
Referenced by unit::ability_active(), unit_animator::add_animation(), attack_type::add_formula_context(), wb::recall::apply_temp_modifier(), wb::recruit::apply_temp_modifier(), wb::move::calculate_moves_left(), battle_context::choose_defender_weapon(), actions::shroud_clearer::clear_loc(), actions::shroud_clearer::clear_unit(), wb::manager::create_temp_move(), quit_confirmation::default_prompt(), ai::readonly_context_impl::diagnostic(), do_replay(), do_replay_handle(), terrain_label::draw(), wb::attack::draw_hex(), wb::recall::draw_hex(), wb::recruit::draw_hex(), wb::suppose_dead::draw_hex(), arrow::draw_hex(), wb::move::draw_hex(), wb::draw_numbers(), wb::side_actions::execute_net_cmd(), unit::get_abilities(), unit::get_ability_bool(), unit_frame::get_overlaped_hex(), terrain_label::get_rect(), actions::get_village(), image::getMinimap(), wb::ghost_owner_unit(), terrain_label::hidden(), arrow::hide(), wb::highlighter::highlight(), wb::attack::init(), wb::suppose_dead::init(), intf_get_viewing_side(), wb::attack::invalidate(), unit_animation::invalidate(), actions::shroud_clearer::invalidate_after_clear(), arrow::invalidate_arrow_path(), unit::is_visible_to_team(), gui2::dialogs::label_settings::label_settings(), help::load_terrain_types_data(), pathfind::mark_route(), arrow::notify_arrow_changed(), wb::manager::on_gamestate_change(), actions::place_recruit(), unit_creator::post_create(), turn_info::process_network_data(), actions::recalculate_fog(), actions::recall_unit(), actions::recruit_unit(), wb::recall::redraw(), wb::attack::redraw(), wb::recruit::redraw(), wb::suppose_dead::redraw(), wb::move::redraw(), unit_frame::redraw(), unit_animation_component::refresh(), unit_animator::replace_anim_if_invalid(), REPORT_GENERATOR(), unit_display::reset_helpers(), wb::manager::save_recall(), wb::manager::save_recruit(), wb::manager::save_temp_attack(), unit_animation_component::set_disabled_ghosted(), CVideo::set_fullscreen(), unit_animation_component::set_ghosted(), preferences::set_grid(), preferences::set_idle_anim(), preferences::set_idle_anim_rate(), unit_animation_component::set_idling(), CVideo::set_resolution(), unit_animation_component::set_selecting(), preferences::set_show_standing_animations(), unit_animation_component::set_standing(), preferences::set_turbo(), preferences::set_turbo_speed(), arrow::show(), ai::default_recruitment::recruitment::show_important_hexes(), preferences::show_theme_dialog(), attack_type::special_active_impl(), unit_animation_component::start_animation(), hotkey::command_executor::surrender_game(), SYNCED_COMMAND_HANDLER_FUNCTION(), tod_stats_at(), wb::unghost_owner_unit(), wb::highlighter::unhighlight(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_display::unit_sheath_weapon(), unit_animation::update_last_draw_time(), gui2::settings::update_screen_size_variables(), gui2::dialogs::custom_tod::update_tod_display(), wb::viewer_actions(), wb::viewer_side(), wb::viewer_team(), pathfind::vision_path::vision_path(), wb::highlighter::highlight_main_visitor::visit(), wb::highlighter::highlight_secondary_visitor::visit(), wb::highlighter::unhighlight_visitor::visit(), unit_animator::wait_until(), game_events::WML_HANDLER_FUNCTION(), wb::manager::~manager(), and wb::suppose_dead::~suppose_dead().
|
inline |
Definition at line 96 of file display.hpp.
Referenced by draw_hex().
|
protected |
Definition at line 1053 of file display.cpp.
References animate_map_, tod_color::b, terrain_builder::BACKGROUND, theme::border(), builder_, time_of_day::color, color_adjust_, d, terrain_builder::FOREGROUND, FOREGROUND, tod_color::g, get_adjacent_tiles(), image::locator::get_filename(), image::get_image(), image::get_light_string(), image::get_lighted_image(), image::locator::get_modifications(), get_time_of_day(), tod_color::is_zero(), tod_color::r, image::SCALED_TO_HEX, terrain_image_vector_, theme_, and theme::border_t::tile_image.
Referenced by draw_hex().
|
inline |
Definition at line 381 of file display.hpp.
References preferences::set_theme().
Referenced by replay_controller::add_replay_theme(), hotkey::command_executor::get_menu_image(), hotkey::command_executor::get_menu_images(), controller_base::handle_event(), editor::editor_toolkit::init_mouse_actions(), controller_base::long_touch_callback(), replay_controller::replay_controller(), events::mouse_handler_base::right_mouse_up(), hotkey::command_executor_default::set_button_state(), hotkey::command_executor::show_menu(), and replay_controller::~replay_controller().
|
virtual |
Reimplemented in game_display, and editor::editor_display.
Definition at line 451 of file display.cpp.
Referenced by draw_hex(), get_terrain_images(), and update_tod().
|
inline |
Definition at line 123 of file display.hpp.
Referenced by unit::ability_active(), attack_type::add_formula_context(), editor::mouse_action_unit::click_left(), editor::mouse_action_unit::drag_end_left(), unit::get_abilities(), unit::get_ability_bool(), unit_animation::matches(), editor::mouse_action_unit::move(), unit_display::reset_helpers(), gui2::dialogs::show_unit_list(), attack_type::special_active_impl(), and unit_display::unit_recruited().
|
staticprotected |
Definition at line 496 of file display.cpp.
References map_location::x, and map_location::y.
Referenced by draw_hex().
|
inline |
Returns the rectangular area of visible hexes.
Definition at line 340 of file display.hpp.
Referenced by invalidate_animations(), and process_reachmap_changes().
|
inlinestatic |
Returns the current zoom factor.
Definition at line 260 of file display.hpp.
References game_config::tile_size.
Referenced by draw_text_in_hex(), unit_animation_component::invalidate(), unit_frame::redraw(), editor::mouse_action_item::set_item_mouse_overlay(), editor::mouse_action_village::set_mouse_overlay(), editor::mouse_action_map_label::set_mouse_overlay(), editor::mouse_action_select::set_mouse_overlay(), editor::mouse_action_paste::set_mouse_overlay(), editor::mouse_action_starting_position::set_mouse_overlay(), and editor::mouse_action_unit::set_unit_mouse_overlay().
|
virtual |
Implements events::sdl_handler.
Definition at line 3249 of file display.cpp.
References gui2::dialogs::loading_screen::displaying(), draw(), DRAW_ALL_EVENT, and singleton_.
|
virtual |
|
inlinevirtual |
Reimplemented in game_display.
Definition at line 626 of file display.hpp.
References game_config::images::flag, read(), and write().
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 597 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_map_label::drag_end_left(), 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(), events::mouse_handler::touch_motion(), editor::mouse_action_village::up_left(), editor::mouse_action_map_label::up_left(), editor::mouse_action_unit::up_left(), editor::mouse_action_item::up_left(), editor::mouse_action_starting_position::up_left(), editor::mouse_action_village::up_right(), editor::mouse_action_map_label::up_right(), editor::mouse_action_starting_position::up_right(), and editor::editor_toolkit::update_mouse_action_highlights().
|
inlinestatic |
Function which returns the size of a hex in pixels (from top tip to bottom tip or left edge to right edge).
Definition at line 257 of file display.hpp.
Referenced by add_overlay(), draw_hex(), draw_minimap(), draw_text_in_hex(), unit_frame::get_overlaped_hex(), terrain_label::get_rect(), hexes_under_rect(), max_map_area(), minimap_location_on(), editor::mouse_action_unit::move(), outside_area(), pixel_position_to_hex(), unit_frame::redraw(), halo::halo_impl::effect::render(), scroll_to_tiles(), editor::mouse_action::set_terrain_mouse_overlay(), and tile_nearly_on_screen().
|
inlinestatic |
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 251 of file display.hpp.
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 |
Return the rectangular area of hexes overlapped by r (r is in screen coordinates)
Definition at line 686 of file display.cpp.
References theme::border(), display::rect_of_hexes::bottom, hex_size(), hex_width(), display::rect_of_hexes::left, map_area(), display::rect_of_hexes::right, theme::border_t::size, theme_, game_config::tile_size, display::rect_of_hexes::top, xpos_, and ypos_.
Referenced by unit_frame::get_overlaped_hex(), invalidate_locations_in_rect(), and halo::halo_impl::effect::render().
|
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().
|
inline |
Definition at line 494 of file display.hpp.
References preferences::set_idle_anim_rate().
Referenced by unit_animation_component::refresh(), and unit_animation_component::start_animation().
|
inline |
Definition at line 496 of file display.hpp.
References image::set_zoom().
Referenced by unit_animation_component::refresh(), and unit_animation_component::start_animation().
|
inlinevirtual |
Reimplemented in editor::editor_display.
Definition at line 204 of file display.hpp.
Referenced by draw_hex(), and terrain_label::viewable().
|
inlinevirtual |
Reimplemented in game_display.
Definition at line 203 of file display.hpp.
void display::init_flags | ( | ) |
Init the flag list and the team colors used by ~TC.
Definition at line 306 of file display.cpp.
References dc_, flags_, init_flags_for_side_internal(), t, and display_context::teams().
Referenced by display(), editor::context_manager::new_scenario(), and editor::context_manager::refresh_on_context_change().
|
private |
Definition at line 327 of file display.cpp.
References animated< T >::add_frame(), dc_, randomness::rng::default_instance(), ERR_DP, f, game_config::images::flag, game_config::flag_rgb, flags_, animated< T >::get_end_time(), mp_ui_alerts::items, LOG_DP, n, utf8::size(), utils::split(), utils::square_parenthetical_split(), animated< T >::start_animation(), and display_context::teams().
Referenced by init_flags(), and reinit_flags_for_team().
bool display::invalidate | ( | const map_location & | loc | ) |
Function to invalidate a specific tile for redrawing.
Definition at line 3022 of file display.cpp.
References invalidateAll_, and invalidated_.
Referenced by editor::editor_display::add_brush_loc(), battle_context::choose_defender_weapon(), 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_unit::move(), editor::mouse_action_item::move(), 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(), 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(), events::menu_handler::show_enemy_moves(), unit_display::unit_mover::start(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::undo::recruit_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 3032 of file display.cpp.
References invalidateAll_, and invalidated_.
void display::invalidate_all | ( | ) |
Function to invalidate all tiles.
Definition at line 3015 of file display.cpp.
References DBG_DP, invalidateAll_, and invalidated_.
Referenced by game_display::begin_game(), gui::floating_textbox::close(), editor::editor_controller::do_execute_command(), game_lua_kernel::intf_redraw(), game_display::maybe_rebuild(), game_display::new_turn(), actions::recalculate_fog(), redraw_everything(), editor::context_manager::refresh_after_action(), editor::context_manager::refresh_all(), game_display::set_game_mode(), set_zoom(), events::menu_handler::toggle_ellipses(), events::menu_handler::toggle_grid(), actions::undo::recall_action::undo(), replay_controller::update_gui(), replay_controller::update_teams(), and gui2::dialogs::custom_tod::update_tod_display().
void display::invalidate_animations | ( | ) |
Function to invalidate animated terrains and units which may have changed.
Definition at line 3097 of file display.cpp.
References preferences::animate_map(), animate_map_, builder_, dc_, fake_unit_man_, get_visible_hexes(), 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 3087 of file display.cpp.
References currentTeam_, dc_, flags_, fogged(), get_map(), invalidate(), display_context::teams(), and display_context::village_owner().
Referenced by invalidate_animations().
|
inline |
Function to invalidate the game status displayed on the sidebar.
Definition at line 293 of file display.hpp.
Referenced by wb::recall::apply_temp_modifier(), wb::recruit::apply_temp_modifier(), events::menu_handler::execute_gotos(), game_display::highlight_hex(), editor::editor_toolkit::hotkey_set_mouse_action(), actions::shroud_clearer::invalidate_after_clear(), events::mouse_handler::move_unit_along_route(), events::menu_handler::move_unit_to_loc(), actions::recall_unit(), actions::recruit_unit(), actions::undo_list::redo(), set_playing_team(), and actions::undo_list::undo().
bool display::invalidate_locations_in_rect | ( | const SDL_Rect & | rect | ) |
invalidate all hexes under the rectangle rect (in screen coordinates)
Definition at line 3075 of file display.cpp.
References hexes_under_rect(), invalidate(), and invalidateAll_.
Referenced by draw_init(), invalidate_visible_locations_in_rect(), and scroll().
|
inline |
Definition at line 404 of file display.hpp.
Referenced by replay_controller::add_replay_theme(), set_theme(), and replay_controller::update_enabled_buttons().
bool display::invalidate_visible_locations_in_rect | ( | const SDL_Rect & | rect | ) |
Definition at line 3070 of file display.cpp.
References sdl::intersect_rects(), invalidate_locations_in_rect(), and map_area().
bool display::is_blindfolded | ( | ) | const |
Definition at line 537 of file display.cpp.
References blindfold_ctr_.
Referenced by draw_minimap(), draw_minimap_units(), fogged(), image::getMinimap(), and shrouded().
map_labels & display::labels | ( | ) |
Definition at line 2537 of file display.cpp.
References map_labels_.
Referenced by playsingle_controller::hotkey_handler::can_execute_command(), events::menu_handler::clear_labels(), editor::map_context::clear_starting_position_labels(), do_replay_handle(), events::menu_handler::do_search(), game_lua_kernel::intf_label(), actions::shroud_clearer::invalidate_after_clear(), gui2::dialogs::label_settings::label_settings(), events::menu_handler::label_settings(), events::menu_handler::label_terrain(), turn_info::process_network_data(), redraw_everything(), scroll(), editor::editor_map::set_starting_position_labels(), set_team(), set_zoom(), and ai::default_recruitment::recruitment::show_important_hexes().
const map_labels & display::labels | ( | ) | const |
Definition at line 2542 of file display.cpp.
References map_labels_.
void display::layout_buttons | ( | ) |
Definition at line 850 of file display.cpp.
References theme::actions(), b, DBG_DP, find_action_button(), find_menu_button(), theme::menus(), screen_, CVideo::screen_area(), and theme_.
Referenced by create_buttons().
const SDL_Rect & display::map_area | ( | ) | const |
Returns the area used for the map.
Definition at line 560 of file display.cpp.
References map_outside_area(), map_screenshot_, and max_map_area().
Referenced by bounds_check_position(), soundsource::positional_source::calculate_volume(), draw_init(), draw_minimap(), drawing_buffer_commit(), get_clip_rect(), get_location_x(), get_location_y(), get_middle_location(), hex_clicked_on(), hexes_under_rect(), invalidate_visible_locations_in_rect(), render_image(), scroll(), scroll_to_tiles(), scroll_to_xy(), set_zoom(), tile_fully_on_screen(), and tile_nearly_on_screen().
|
inline |
Returns the available area for a map, this may differ from the above.
This area will get the background area applied to it.
Definition at line 239 of file display.hpp.
Referenced by display_chat_manager::add_chat_message(), announce(), terrain_label::draw(), draw_init(), draw_minimap(), editor::editor_display::get_clip_rect(), controller_base::handle_scroll(), map_area(), unit_drawer::redraw_unit(), halo::halo_impl::effect::render(), set_diagnostic(), set_zoom(), halo::halo_impl::effect::unrender(), gui::floating_textbox::update_location(), and gui2::settings::update_screen_size_variables().
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 543 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(), and screenshot().
const theme::menu * display::menu_pressed | ( | ) |
Definition at line 1744 of file display.cpp.
References theme::get_menu_item(), i, utf8::index(), menu_buttons_, theme::menus(), and theme_.
Referenced by controller_base::play_slice().
|
inline |
mapx is the width of the portion of the display which shows the game area.
Between mapx and x is the sidebar region.
Definition at line 216 of file display.hpp.
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 758 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(), events::mouse_handler_base::mouse_press(), and events::mouse_handler::touch_motion().
|
inline |
Definition at line 287 of file display.hpp.
Referenced by editor::editor_controller::can_execute_command(), controller_base::play_slice(), editor::editor_controller::terrain_description(), play_controller::hotkey_handler::touch_hex(), and unit_display::unit_recruited().
|
inlinevirtual |
Reimplemented in game_display.
Definition at line 209 of file display.hpp.
|
static |
Check if the bbox of the hex at x,y has pixels outside the area rectangle.
Definition at line 588 of file display.cpp.
References hex_size().
Referenced by scroll_to_tiles(), set_zoom(), and tile_fully_on_screen().
|
inline |
Definition at line 218 of file display.hpp.
Referenced by editor::palette_manager::adjust_size(), and editor::palette_manager::restore_palette_bg().
void display::parse_team_overlays | ( | ) |
Check the overlay_map for proper team-specific overlays to be displayed/hidden.
Definition at line 115 of file display.cpp.
References dc_, get_overlays(), display_context::get_team(), i, invalidate(), 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 612 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().
|
inlinevirtual |
Reimplemented in game_display.
Definition at line 208 of file display.hpp.
Referenced by attack_info(), gray_inactive(), and unit_moves().
|
inline |
The playing team is the team whose turn it is.
Definition at line 99 of file display.hpp.
Referenced by parse_team_overlays(), editor::mouse_action_village::up_left(), and play_controller::hotkey_handler::viewing_team_is_playing().
|
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 698 of file display.hpp.
Referenced by 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 678 of file display.hpp.
Referenced by 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 671 of file display.hpp.
Referenced by draw().
|
protected |
Definition at line 3195 of file display.cpp.
References get_visible_hexes(), invalidate(), reach_map_, reach_map_changed_, and reach_map_old_.
Referenced by game_display::pre_draw().
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 3043 of file display.cpp.
References i, invalidateAll_, and invalidated_.
Referenced by unit_animation::invalidate().
|
private |
Definition at line 3187 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 502 of file display.cpp.
References builder_.
Referenced by game_display::maybe_rebuild(), editor::context_manager::refresh_after_action(), editor::context_manager::refresh_all(), and set_theme().
|
inline |
Schedule the minimap for recalculation.
Useful if any terrain in the map has changed.
Definition at line 616 of file display.hpp.
Referenced by do_replay(), draw_all_panels(), game_lua_kernel::intf_redraw(), actions::shroud_clearer::invalidate_after_clear(), game_display::maybe_rebuild(), turn_info::process_network_data(), editor::context_manager::refresh_after_action(), editor::context_manager::refresh_all(), select_hex(), SYNCED_COMMAND_HANDLER_FUNCTION(), and replay_controller::update_gui().
void display::redraw_everything | ( | ) |
Invalidates entire screen, including all tiles and sidebar.
Calls redraw observers.
Definition at line 2420 of file display.cpp.
References action_buttons_, bounds_check_position(), tooltips::clear_tooltips(), resources::controller, create_buttons(), draw(), f, play_controller::get_hotkey_command_executor(), gui::in_dialog(), invalidate_all(), invalidateGameStatus_, labels(), LOG_DP, menu_buttons_, panelsDrawn_, map_labels::recalculate_labels(), redraw_background_, redraw_observers_, reportRects_, reports_, reportSurfaces_, screen_, CVideo::screen_area(), hotkey::command_executor::set_button_state(), theme::set_resolution(), theme_, and CVideo::update_locked().
Referenced by draw(), editor::editor_controller::editor_controller(), events::menu_handler::preferences(), turn_info::process_network_data(), replay_controller::replay_controller(), set_theme(), SYNCED_COMMAND_HANDLER_FUNCTION(), replay_controller::update_enabled_buttons(), replay_controller::update_gui(), and replay_controller::~replay_controller().
|
inline |
Schedule the minimap to be redrawn.
Useful if units have moved about on the map.
Definition at line 622 of file display.hpp.
References map_location::null_location().
Referenced by battle_context::choose_defender_weapon(), 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 |
||
) |
Redraws the specified report (if anything has changed).
If a config is not supplied, it will be generated via reports::generate_report().
Definition at line 2807 of file display.cpp.
References config::add_child(), config::add_child_at(), tooltips::add_tooltip(), CVideo::blit_surface(), config::child(), config::child_range(), tooltips::clear_tooltips(), resources::controller, dc_, draw_image_for_report(), e, game_config::images::ellipsis, config::empty(), ERR_DP, theme::status_item::font_rgb(), theme::status_item::font_rgb_set(), theme::status_item::font_size(), reports::generate_report(), image::get_image(), play_controller::get_mouse_handler_base(), theme::get_status_item(), get_surface_portion(), CVideo::getSurface(), theme::object::location(), theme::status_item::postfix(), theme::status_item::prefix(), font::pango_text::render(), reportRects_, reports_, reports_object_, reportSurfaces_, s, screen_, CVideo::screen_area(), sdl_blit(), font::pango_text::set_font_size(), font::pango_text::set_foreground_color(), font::pango_text::set_maximum_height(), font::pango_text::set_maximum_width(), font::pango_text::set_text(), t, theme_, resources::tod_manager, and wb_.
Referenced by editor::editor_display::draw_sidebar(), and game_display::draw_sidebar().
void display::reinit_flags_for_team | ( | const team & | t | ) |
Rebuild the flag list (not team colors) for a single side.
Definition at line 322 of file display.cpp.
References team::color(), init_flags_for_side_internal(), and team::side().
void display::reload_map | ( | ) |
Updates internals that cache map size.
This should be called when the map size has changed.
Definition at line 507 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 3149 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.
Definition at line 439 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 149 of file display.cpp.
References get_overlays().
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 154 of file display.cpp.
References get_overlays().
void display::render_buttons | ( | ) |
Definition at line 936 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 1550 of file display.cpp.
References adjust_surface_alpha(), blend_surface(), brighten_image(), surface::clone(), DefaultZoom, drawing_buffer_add(), ERR_DP, flop_surface(), ftofxp, greyscale_image(), map_area(), sdl::rects_overlap(), image::reverse_image(), submerge_alpha(), and zoom_.
Referenced by arrow::draw_hex(), and unit_frame::redraw().
void display::reset_halo_manager | ( | ) |
Definition at line 519 of file display.cpp.
References halo_man_.
void display::reset_halo_manager | ( | halo::manager & | hm | ) |
Definition at line 524 of file display.cpp.
References halo_man_.
|
inline |
Definition at line 645 of file display.hpp.
void display::reset_standing_animations | ( | ) |
Definition at line 3133 of file display.cpp.
References dc_, and display_context::units().
surface display::screenshot | ( | bool | map_screenshot = false | ) |
Capture a (map-)screenshot into a surface.
Definition at line 788 of file display.cpp.
References surface::clone(), DBG_DP, draw(), ERR_DP, get_map(), CVideo::getSurface(), invalidateAll_, map_screenshot_, map_screenshot_surf_, max_map_area(), screen_, xpos_, and ypos_.
Referenced by editor::editor_controller::do_screenshot().
bool display::scroll | ( | int | xmov, |
int | ymov, | ||
bool | force = false |
||
) |
Scrolls the display by xmov,ymov pixels.
Invalidation and redrawing will be scheduled.
Definition at line 1924 of file display.cpp.
References bounds_check_position(), surface::clone(), CVideo::getSurface(), sdl::intersect_rects(), invalidate_locations_in_rect(), labels(), map_area(), events::generic_event::notify_observers(), map_labels::recalculate_shroud(), redrawMinimap_, screen_, scroll_event_, font::scroll_floating_labels(), CVideo::update_locked(), view_locked_, xpos_, and ypos_.
Referenced by controller_base::handle_scroll(), events::mouse_handler_base::mouse_wheel(), scroll_to_xy(), and events::mouse_handler::touch_motion().
|
inline |
Expose the event, so observers can be notified about map scrolling.
Definition at line 563 of file display.hpp.
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 |
||
) |
Scroll such that location loc is on-screen.
WARP jumps to loc; SCROLL uses scroll speed; ONSCREEN only scrolls if x,y is offscreen force : scroll even if preferences tell us not to, or the view is locked.
Definition at line 2204 of file display.cpp.
References ERR_DP, get_map(), and scroll_to_tiles().
Referenced by editor::location_palette::adjust_size(), events::mouse_handler::cycle_units(), events::menu_handler::do_search(), events::menu_handler::goto_leader(), editor::mouse_action::key_event(), events::mouse_handler_base::left_click(), events::mouse_handler_base::mouse_motion_default(), events::mouse_handler_base::mouse_press(), game_display::scroll_to_leader(), gui2::dialogs::show_unit_list(), events::mouse_handler::touch_motion(), unit_display::unit_healing(), and unit_display::unit_recruited().
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 2216 of file display.cpp.
Referenced by unit_display::unit_mover::proceed_to(), scroll_to_tile(), unit_display::unit_mover::start(), 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 2226 of file display.cpp.
References ERR_DP, fogged(), get_location_x(), get_location_y(), get_map(), h, hex_size(), map_area(), ONSCREEN, ONSCREEN_WARP, outside_area(), scroll_to_xy(), and w.
|
inline |
Scroll to fit as many locations on-screen as possible, starting with the first.
Definition at line 553 of file display.hpp.
|
protected |
Definition at line 2125 of file display.cpp.
References bounds_check_position(), draw(), map_area(), ONSCREEN_WARP, events::pump(), screen_, scroll(), preferences::scroll_speed(), preferences::scroll_to_action(), t, turbo_speed(), CVideo::update_locked(), view_locked_, WARP, xpos_, and ypos_.
Referenced by scroll_to_tiles().
|
virtual |
Reimplemented in game_display.
Definition at line 1618 of file display.cpp.
References invalidate(), recalculate_minimap(), and selectedHex_.
Referenced by game_display::select_hex(), gui2::dialogs::show_unit_list(), and unit_display::unit_attack().
|
inline |
Definition at line 286 of file display.hpp.
Referenced by get_selected_unit(), and get_selected_unit_ptr().
void display::set_diagnostic | ( | const std::string & | msg | ) |
Definition at line 1633 of file display.cpp.
References font::add_floating_label(), diagnostic_label_, map_outside_area(), font::remove_floating_label(), font::floating_label::set_clip_rect(), font::floating_label::set_color(), font::floating_label::set_font_size(), font::floating_label::set_position(), font::SIZE_PLUS, and font::YELLOW_COLOR.
Referenced by ai::readonly_context_impl::diagnostic().
|
inline |
Setter for the x,y debug overlay on tiles.
Definition at line 357 of file display.hpp.
Referenced by editor::editor_controller::do_execute_command(), and editor::editor_controller::init_gui().
|
inline |
Setter for the terrain code debug overlay on tiles.
Definition at line 367 of file display.hpp.
References f.
Referenced by editor::editor_controller::do_execute_command(), and editor::editor_controller::init_gui().
|
inline |
Setter for the terrain code debug overlay on tiles.
Definition at line 362 of file display.hpp.
Referenced by editor::editor_controller::do_execute_command(), and editor::editor_controller::init_gui().
|
inline |
Determines whether a grid should be overlayed on the game board.
(to more clearly show where hexes are)
Definition at line 352 of file display.hpp.
References preferences::grid().
Referenced by preferences::set_grid().
|
inline |
control unit idle animations and their frequency
Definition at line 493 of file display.hpp.
Referenced by preferences::set_idle_anim().
void display::set_idle_anim_rate | ( | int | rate | ) |
Definition at line 2415 of file display.cpp.
References idle_anim_rate_.
Referenced by display(), and preferences::set_idle_anim_rate().
|
inline |
mouseover_hex_overlay_ require a prerendered surface and is drawn underneath the mouse's location
Definition at line 445 of file display.hpp.
Referenced by editor::mouse_action_unit::move(), editor::mouse_action_item::set_item_mouse_overlay(), editor::mouse_action_village::set_mouse_overlay(), editor::mouse_action_map_label::set_mouse_overlay(), editor::mouse_action_select::set_mouse_overlay(), editor::mouse_action::set_mouse_overlay(), editor::mouse_action_paste::set_mouse_overlay(), editor::mouse_action_starting_position::set_mouse_overlay(), editor::mouse_action::set_terrain_mouse_overlay(), and editor::mouse_action_unit::set_unit_mouse_overlay().
void display::set_playing_team | ( | std::size_t | team | ) |
set_playing_team sets the team whose turn it currently is
Definition at line 419 of file display.cpp.
References activeTeam_, invalidate_game_status(), and utf8::size().
Referenced by editor::context_manager::new_scenario(), and editor::context_manager::refresh_on_context_change().
void display::set_team | ( | std::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 400 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 editor::context_manager::new_scenario(), turn_info::process_network_data(), and editor::context_manager::refresh_on_context_change().
void display::set_theme | ( | config | theme_cfg | ) |
Definition at line 295 of file display.cpp.
References action_buttons_, theme::border(), builder_, create_buttons(), invalidate_theme(), menu_buttons_, rebuild_all(), redraw_everything(), screen_, CVideo::screen_area(), theme::border_t::show_border, preferences::theme(), and theme_.
Referenced by preferences::show_theme_dialog().
|
inline |
Set/Get whether 'turbo' mode is on.
When turbo mode is on, everything moves much faster.
Definition at line 486 of file display.hpp.
References preferences::turbo(), and preferences::turbo_speed().
Referenced by preferences::set_turbo().
|
inline |
Definition at line 490 of file display.hpp.
Referenced by preferences::set_turbo_speed().
|
inline |
Sets whether the map view is locked (e.g.
so the user can't scroll away)
Definition at line 523 of file display.hpp.
bool display::set_zoom | ( | bool | increase | ) |
Zooms the display in (true) or out (false).
Definition at line 2028 of file display.cpp.
References final_zoom_index, zoom_index_, and zoom_levels.
Referenced by toggle_default_zoom().
bool display::set_zoom | ( | unsigned int | amount, |
const bool | validate_value_and_set_index = true |
||
) |
Sets the display zoom to the specified amount.
Definition at line 2038 of file display.cpp.
References bounds_check_position(), DefaultZoom, draw(), get_zoom_levels_index(), invalidate_all(), labels(), last_zoom_, LOG_DP, map_area(), map_outside_area(), MaxZoom, MinZoom, outside_area(), map_labels::recalculate_labels(), redraw_background_, preferences::set_tile_size(), image::set_zoom(), xpos_, ypos_, zoom_, zoom_index_, and zoom_levels.
|
inline |
Definition at line 92 of file display.hpp.
Referenced by attack_info(), events::menu_handler::current_unit(), get_selected_unit(), get_selected_unit_ptr(), get_visible_unit(), and gui2::dialogs::game_stats::pre_show().
bool display::shrouded | ( | const map_location & | loc | ) | const |
Returns true if location (x,y) is covered in shroud.
Definition at line 738 of file display.cpp.
References currentTeam_, dc_, dont_show_all_, is_blindfolded(), and display_context::teams().
Referenced by soundsource::positional_source::calculate_volume(), playsingle_controller::hotkey_handler::can_execute_command(), events::menu_handler::do_search(), game_display::draw_hex(), draw_hex(), get_fog_shroud_images(), invalidate_animations(), is_shrouded(), halo::halo_impl::effect::render(), events::menu_handler::terrain_description(), tod_stats_at(), and halo::halo_impl::effect::unrender().
|
static |
Definition at line 950 of file display.cpp.
References gui::button::TYPE_CHECK, gui::button::TYPE_IMAGE, gui::button::TYPE_PRESS, gui::button::TYPE_RADIO, and gui::button::TYPE_TURBO.
Referenced by create_buttons().
bool display::team_valid | ( | ) | const |
Definition at line 733 of file display.cpp.
References currentTeam_, dc_, and display_context::teams().
Referenced by events::menu_handler::clear_labels(), game_display::current_team_name(), game_display::draw_sidebar(), and unit_drawer::unit_drawer().
bool display::tile_fully_on_screen | ( | const map_location & | loc | ) | const |
Check if a tile is fully visible on screen.
Definition at line 2108 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 2115 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().
|
static |
Toggle to continuously redraw the screen.
Definition at line 1329 of file display.cpp.
|
static |
Toggle to debug foreground terrain.
Separate background and foreground layer to better spot any error there.
Definition at line 1334 of file display.cpp.
void display::toggle_default_zoom | ( | ) |
Sets the zoom amount to the default.
Definition at line 2096 of file display.cpp.
References DefaultZoom, last_zoom_, set_zoom(), and zoom_.
double display::turbo_speed | ( | ) | const |
Definition at line 2401 of file display.cpp.
References CVideo::faked(), keys_, screen_, turbo_, and turbo_speed_.
Referenced by game_display::float_label(), game_display::new_turn(), scroll_to_xy(), unit_animation::update_last_draw_time(), and unit_animator::wait_until().
|
inline |
Definition at line 220 of file display.hpp.
void display::update_arrow | ( | arrow & | a | ) |
Called by arrow objects when they change.
You should not need to call this directly.
Definition at line 3158 of file display.cpp.
References arrows_map_, arrow::get_path(), and arrow::get_previous_path().
void display::update_display | ( | ) |
Copy the backbuffer to the framebuffer.
Definition at line 1362 of file display.cpp.
References font::add_floating_label(), font::BAD_COLOR, calculate_fps(), game_config::debug, drawn_hexes_, flip(), fps_actual_, fps_handle_, frametimes_, invalidated_hexes_, font::LEFT_ALIGN, font::NORMAL_COLOR, font::remove_floating_label(), screen_, font::floating_label::set_font_size(), preferences::show_fps(), and CVideo::update_locked().
Referenced by draw_wrap().
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.
tod_override | The ToD to apply to the map instead of that of the current ToD's. |
Definition at line 457 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().
|
inline |
Gets the underlying screen object.
Definition at line 198 of file display.hpp.
Referenced by display_chat_manager::add_chat_message(), editor::location_palette::adjust_size(), BOOST_AUTO_TEST_CASE(), draw_all_panels(), editor::editor_display::editor_display(), flip(), game_display::game_display(), test_utils::get_fake_display(), controller_base::handle_scroll(), editor::location_palette::hide(), editor::editor_palette< overlay >::hide(), editor::location_palette::select_item(), and gui::floating_textbox::show().
|
inline |
Definition at line 520 of file display.hpp.
|
inline |
Definition at line 105 of file display.hpp.
Referenced by wb::move::calculate_moves_left(), play_controller::hotkey_handler::can_execute_command(), wb::manager::create_temp_move(), events::mouse_handler::current_unit_attacks_from(), editor::unit_palette::draw_item(), get_flag(), events::menu_handler::goto_leader(), gray_inactive(), play_controller::hotkey_handler::in_context_menu(), events::menu_handler::label_terrain(), events::mouse_handler::move_unit_along_route(), events::menu_handler::rename_unit(), unit_display::unit_mover::replace_temporary(), game_display::scroll_to_leader(), events::mouse_handler::select_hex(), events::menu_handler::send_chat_message(), editor::mouse_action_unit::set_unit_mouse_overlay(), gui2::dialogs::show_unit_list(), unit_display::unit_recruited(), editor::mouse_action_unit::up_left(), and wb::viewer_side().
|
inline |
The viewing team is the team currently viewing the game.
Definition at line 104 of file display.hpp.
Referenced by attack_info(), events::menu_handler::current_unit(), game_display::display_unit_hex(), events::menu_handler::do_search(), game_display::draw_hex(), draw_hex(), get_selected_unit(), get_selected_unit_ptr(), get_visible_time_of_day_at(), get_visible_unit(), events::menu_handler::has_friends(), game_display::highlight_hex(), events::menu_handler::label_terrain(), pathfind::mark_route(), turn_info::process_network_data(), events::menu_handler::send_chat_message(), events::menu_handler::show_enemy_moves(), events::menu_handler::status_table(), wb::viewer_actions(), wb::viewer_team(), play_controller::hotkey_handler::viewing_team(), events::mouse_handler::viewing_team(), play_controller::hotkey_handler::viewing_team_is_playing(), and pathfind::vision_path::vision_path().
void display::write | ( | config & | cfg | ) | const |
Definition at line 3178 of file display.cpp.
References config::add_child(), tod_color::b, color_adjust_, tod_color::g, get_middle_location(), tod_color::r, view_locked_, and map_location::write().
|
static |
Definition at line 2018 of file display.cpp.
|
static |
Definition at line 2023 of file display.cpp.
|
protected |
Definition at line 783 of file display.hpp.
Referenced by action_pressed(), create_buttons(), display(), find_action_button(), redraw_everything(), render_buttons(), and set_theme().
|
protected |
Definition at line 892 of file display.hpp.
Referenced by game_display::playing_side(), and set_playing_team().
|
protected |
Local cache for preferences::animate_map, since it is constantly queried.
Definition at line 797 of file display.hpp.
Referenced by get_flag(), get_terrain_images(), and invalidate_animations().
|
protected |
Local version of preferences::animate_water, used to detect when it's changed.
Definition at line 800 of file display.hpp.
Referenced by draw().
|
private |
Maps the list of arrows for each location.
Definition at line 1068 of file display.hpp.
Referenced by add_arrow(), draw_hex(), remove_arrow(), and update_arrow().
|
private |
Definition at line 653 of file display.hpp.
Referenced by blindfold(), display(), and is_blindfolded().
|
protected |
Definition at line 755 of file display.hpp.
Referenced by change_display_context(), draw(), get_terrain_images(), invalidate_animations(), rebuild_all(), editor::editor_display::rebuild_terrain(), reload_map(), and set_theme().
|
private |
Definition at line 1070 of file display.hpp.
Referenced by adjust_color_overlay(), draw_hex(), get_terrain_images(), read(), update_tod(), and write().
|
protected |
Definition at line 735 of file display.hpp.
Referenced by game_display::current_team_name(), game_display::draw_hex(), draw_minimap(), draw_minimap_units(), game_display::draw_movement_info(), fogged(), invalidate_animations_location(), set_team(), shrouded(), and team_valid().
|
protected |
Definition at line 657 of file display.hpp.
Referenced by change_display_context(), game_display::current_team_name(), game_display::display_unit_hex(), game_display::draw_hex(), draw_invalidated(), draw_minimap(), draw_minimap_units(), game_display::draw_movement_info(), editor::editor_display::draw_sidebar(), fogged(), get_flag(), game_display::highlight_hex(), init_flags(), init_flags_for_side_internal(), invalidate_animations(), invalidate_animations_location(), parse_team_overlays(), refresh_report(), reset_standing_animations(), game_display::scroll_to_leader(), set_team(), shrouded(), and team_valid().
|
protected |
Definition at line 762 of file display.hpp.
Referenced by set_diagnostic().
|
private |
Definition at line 1072 of file display.hpp.
Referenced by draw(), and handle_window_event().
|
protected |
Definition at line 736 of file display.hpp.
Referenced by game_display::display_unit_hex(), draw_hex(), fogged(), game_display::highlight_hex(), set_team(), and shrouded().
|
private |
Debug flag - overlay x,y coords on tiles.
Definition at line 1059 of file display.hpp.
Referenced by draw_hex().
|
private |
Debug flag - overlay number of bitmaps on tiles.
Definition at line 1063 of file display.hpp.
Referenced by draw_hex().
|
private |
Debug flag - overlay terrain codes on tiles.
Definition at line 1061 of file display.hpp.
Referenced by draw_hex().
|
protected |
Definition at line 975 of file display.hpp.
Referenced by drawing_buffer_add(), drawing_buffer_clear(), and drawing_buffer_commit().
|
private |
Definition at line 1049 of file display.hpp.
Referenced by draw_invalidated(), and update_display().
|
protected |
map of hexes where only one unit should be drawn, the one identified by the associated id string
Definition at line 663 of file display.hpp.
Referenced by add_exclusive_draw(), game_display::draw_invalidated(), draw_invalidated(), and remove_exclusive_draw().
|
protected |
Definition at line 754 of file display.hpp.
Referenced by display(), game_display::draw_invalidated(), and invalidate_animations().
|
private |
Animated flags for each team.
Definition at line 808 of file display.hpp.
Referenced by get_flag(), init_flags(), init_flags_for_side_internal(), and invalidate_animations_location().
|
protected |
Definition at line 789 of file display.hpp.
Referenced by display(), and draw_hex().
|
protected |
Definition at line 776 of file display.hpp.
Referenced by draw_wrap(), and update_display().
|
protected |
Definition at line 774 of file display.hpp.
Referenced by draw_wrap().
|
private |
Handle for the label which displays frames per second.
Definition at line 1046 of file display.hpp.
Referenced by update_display().
|
protected |
Definition at line 775 of file display.hpp.
Referenced by draw_wrap().
|
protected |
Definition at line 773 of file display.hpp.
Referenced by draw_wrap(), and update_display().
|
protected |
Definition at line 761 of file display.hpp.
Referenced by draw_hex().
|
protected |
Definition at line 658 of file display.hpp.
Referenced by add_overlay(), game_display::draw_invalidated(), game_display::post_commit(), and reset_halo_manager().
|
private |
Definition at line 1051 of file display.hpp.
|
private |
Definition at line 1052 of file display.hpp.
Referenced by set_idle_anim_rate().
|
protected |
Definition at line 760 of file display.hpp.
Referenced by draw_init(), invalidate(), invalidate_all(), invalidate_locations_in_rect(), propagate_invalidation(), and screenshot().
|
protected |
Definition at line 784 of file display.hpp.
Referenced by draw(), game_display::draw_invalidated(), draw_invalidated(), invalidate(), invalidate_all(), and propagate_invalidation().
|
private |
Count work done for the debug info displayed under fps.
Definition at line 1048 of file display.hpp.
Referenced by draw_invalidated(), and update_display().
|
protected |
Definition at line 766 of file display.hpp.
Referenced by game_display::draw_sidebar(), game_display::invalidate_unit(), and redraw_everything().
|
protected |
Definition at line 794 of file display.hpp.
Referenced by turbo_speed().
|
protected |
Definition at line 777 of file display.hpp.
Referenced by draw_wrap().
|
staticprotected |
The previous value of zoom_.
Definition at line 753 of file display.hpp.
Referenced by set_zoom(), and toggle_default_zoom().
|
protected |
Definition at line 767 of file display.hpp.
Referenced by labels().
|
protected |
Used to indicate to drawing functions that we are doing a map screenshot.
Definition at line 1020 of file display.hpp.
Referenced by map_area(), and screenshot().
|
private |
Definition at line 1054 of file display.hpp.
Referenced by screenshot().
|
protected |
Definition at line 783 of file display.hpp.
Referenced by create_buttons(), display(), draw_all_panels(), enable_menu(), find_menu_button(), menu_pressed(), redraw_everything(), render_buttons(), and set_theme().
|
protected |
Definition at line 756 of file display.hpp.
Referenced by draw_minimap().
|
protected |
Definition at line 757 of file display.hpp.
Referenced by draw_minimap(), draw_minimap_units(), and minimap_location_on().
|
protected |
Definition at line 785 of file display.hpp.
Referenced by draw_hex().
|
protected |
Definition at line 793 of file display.hpp.
Referenced by game_display::draw_hex(), draw_hex(), game_display::draw_movement_info(), editor::editor_display::draw_sidebar(), game_display::highlight_hex(), and highlight_hex().
|
protected |
Definition at line 763 of file display.hpp.
Referenced by draw_init(), and redraw_everything().
|
protected |
Definition at line 1035 of file display.hpp.
Referenced by game_display::draw_hex(), draw_minimap(), game_display::draw_movement_info(), game_display::highlight_another_reach(), process_reachmap_changes(), and game_display::unhighlight_reach().
|
protected |
Definition at line 1037 of file display.hpp.
Referenced by game_display::highlight_another_reach(), process_reachmap_changes(), and game_display::unhighlight_reach().
|
protected |
Definition at line 1036 of file display.hpp.
Referenced by process_reachmap_changes().
|
protected |
Definition at line 759 of file display.hpp.
Referenced by draw_init(), redraw_everything(), reload_map(), and set_zoom().
|
private |
Definition at line 1056 of file display.hpp.
Referenced by add_redraw_observer(), clear_redraw_observers(), and redraw_everything().
|
protected |
Definition at line 758 of file display.hpp.
Referenced by draw_init(), draw_wrap(), and scroll().
|
protected |
Definition at line 780 of file display.hpp.
Referenced by redraw_everything(), and refresh_report().
|
protected |
Definition at line 782 of file display.hpp.
Referenced by redraw_everything(), and refresh_report().
|
protected |
Definition at line 768 of file display.hpp.
Referenced by game_display::draw_sidebar(), and refresh_report().
|
protected |
Definition at line 781 of file display.hpp.
Referenced by redraw_everything(), and refresh_report().
|
protected |
Definition at line 734 of file display.hpp.
Referenced by create_buttons(), display(), draw(), draw_all_panels(), draw_image_for_report(), draw_minimap(), draw_minimap_units(), draw_wrap(), layout_buttons(), redraw_everything(), refresh_report(), screenshot(), scroll(), scroll_to_xy(), set_theme(), turbo_speed(), and update_display().
|
mutableprotected |
Event raised when the map is being scrolled.
Definition at line 771 of file display.hpp.
Referenced by scroll().
|
protected |
Definition at line 792 of file display.hpp.
Referenced by game_display::draw_hex(), draw_minimap(), game_display::draw_movement_info(), game_display::highlight_hex(), and select_hex().
|
protected |
Definition at line 790 of file display.hpp.
Referenced by display(), and draw_hex().
|
staticprotected |
Definition at line 1075 of file display.hpp.
Referenced by display(), game_display::get_singleton(), handle_event(), and ~display().
|
private |
Definition at line 812 of file display.hpp.
Referenced by draw_hex(), and get_terrain_images().
|
protected |
Definition at line 745 of file display.hpp.
Referenced by action_pressed(), bounds_check_position(), create_buttons(), draw_all_panels(), draw_init(), draw_minimap(), enable_menu(), get_location_x(), get_location_y(), get_terrain_images(), hexes_under_rect(), layout_buttons(), max_map_area(), menu_pressed(), pixel_position_to_hex(), redraw_everything(), refresh_report(), and set_theme().
|
protected |
Definition at line 788 of file display.hpp.
Referenced by draw_hex(), and game_display::new_turn().
|
protected |
Definition at line 788 of file display.hpp.
Referenced by draw_hex(), and game_display::new_turn().
|
protected |
Definition at line 765 of file display.hpp.
Referenced by turbo_speed().
|
protected |
Definition at line 764 of file display.hpp.
Referenced by turbo_speed().
|
protected |
Definition at line 744 of file display.hpp.
Referenced by read(), scroll(), scroll_to_xy(), and write().
|
protected |
Definition at line 659 of file display.hpp.
Referenced by game_display::draw_hex(), game_display::draw_movement_info(), game_display::post_draw(), game_display::pre_draw(), refresh_report(), and set_team().
|
protected |
Position of the top-left corner of the viewport, in pixels.
Dependent on zoom_.. For example, ypos_==72 only means we're one hex below the top of the map when zoom_ == 72 (the default value).
Definition at line 743 of file display.hpp.
Referenced by bounds_check_position(), draw_minimap(), get_location_x(), get_middle_location(), hex_clicked_on(), hexes_under_rect(), screenshot(), scroll(), scroll_to_xy(), and set_zoom().
|
protected |
Definition at line 743 of file display.hpp.
Referenced by bounds_check_position(), draw_minimap(), get_location_y(), get_middle_location(), hex_clicked_on(), hexes_under_rect(), screenshot(), scroll(), scroll_to_xy(), and set_zoom().
|
staticprotected |
The current zoom, in pixels (on screen) per 72 pixels (in the graphic assets), i.e., 72 means 100%.
Definition at line 750 of file display.hpp.
Referenced by bounds_check_position(), display(), draw_invalidated(), game_display::float_label(), get_location_y(), render_image(), set_zoom(), toggle_default_zoom(), zoom_at_max(), and zoom_at_min().
|
protected |
Definition at line 751 of file display.hpp.
Referenced by display(), and set_zoom().