#include <game_display.hpp>
Public Types | |
enum | game_mode { RUNNING , LINGER } |
Sets the linger mode for the display. More... | |
Public Types inherited from display | |
enum | SCROLL_TYPE { SCROLL , WARP , ONSCREEN , ONSCREEN_WARP } |
enum | DEBUG_FLAG { DEBUG_COORDINATES , DEBUG_TERRAIN_CODES , DEBUG_NUM_BITMAPS , DEBUG_FOREGROUND , DEBUG_BENCHMARK , __NUM_DEBUG_FLAGS } |
Public Member Functions | |
game_display (game_board &board, std::weak_ptr< wb::manager > wb, reports &reports_object, const std::string &theme_id, const config &level) | |
~game_display () | |
game_display (const game_display &)=delete | |
game_display & | operator= (const game_display &)=delete |
void | new_turn () |
Update lighting settings. More... | |
virtual const std::set< std::string > & | observers () const override |
void | scroll_to_leader (int side, SCROLL_TYPE scroll_type=ONSCREEN, bool force=true) |
Scrolls to the leader of a certain side. More... | |
virtual void | select_hex (map_location hex) override |
Function to display a location as selected. More... | |
virtual void | highlight_hex (map_location hex) override |
Function to highlight a location. More... | |
void | display_unit_hex (map_location hex) |
Change the unit to be displayed in the sidebar. More... | |
void | highlight_reach (const pathfind::paths &paths_list) |
Sets the paths that are currently displayed as available for the unit to move along. More... | |
void | highlight_another_reach (const pathfind::paths &paths_list, const map_location &goal=map_location::null_location()) |
Add more paths to highlight. More... | |
const std::set< map_location > & | units_that_can_reach_goal () const |
Return the locations of units that can reach goal (. More... | |
bool | unhighlight_reach () |
Reset highlighting of paths. More... | |
void | set_route (const pathfind::marked_route *route) |
Sets the route along which footsteps are drawn to show movement of a unit. More... | |
const pathfind::marked_route & | get_route () |
Gets the route along which footsteps are drawn to show movement of a unit. More... | |
void | float_label (const map_location &loc, const std::string &text, const color_t &color) |
Function to float a label above a tile. More... | |
void | draw_movement_info (const map_location &loc) |
Draws the movement info (turns available) for a given location. More... | |
void | invalidate_unit () |
Function to invalidate that unit status displayed on the sidebar. More... | |
void | invalidate_unit_after_move (const map_location &src, const map_location &dst) |
Same as invalidate_unit() if moving the displayed unit. More... | |
virtual const time_of_day & | get_time_of_day (const map_location &loc) const override |
virtual bool | has_time_area () const override |
virtual void | update () override |
TLD update() override. More... | |
virtual void | layout () override |
TLD layout() override. More... | |
virtual void | render () override |
TLD render() override. More... | |
void | set_attack_indicator (const map_location &src, const map_location &dst) |
Set the attack direction indicator. More... | |
void | clear_attack_indicator () |
const map_location & | get_attack_indicator_src () |
std::string | attack_indicator_direction () const |
Function to get attack direction suffix. More... | |
virtual const map_location & | displayed_unit_hex () const override |
Virtual functions shadowed in game_display. More... | |
display_chat_manager & | get_chat_manager () |
void | begin_game () |
virtual bool | in_game () const override |
void | set_game_mode (const game_mode mode) |
void | needs_rebuild (bool b) |
Sets whether the screen (map visuals) needs to be rebuilt. More... | |
bool | maybe_rebuild () |
Rebuilds the screen if needs_rebuild(true) was previously called, and resets the flag. More... | |
Public Member Functions inherited from display | |
display (const display_context *dc, std::weak_ptr< wb::manager > wb, reports &reports_object, const std::string &theme_id, const config &level) | |
virtual | ~display () |
bool | show_everything () const |
std::size_t | playing_team_index () const |
The playing team is the team whose turn it is. More... | |
std::size_t | viewing_team_index () const |
The viewing team is the team currently viewing the game. More... | |
const team & | playing_team () const |
const team & | viewing_team () const |
bool | viewing_team_is_playing () const |
void | set_viewing_team_index (std::size_t team, bool observe=false) |
Sets the team controlled by the player using the computer. More... | |
void | set_playing_team_index (std::size_t team) |
sets the team whose turn it currently is More... | |
void | clear_exclusive_draws () |
Cancels all the exclusive draw requests. More... | |
bool | add_exclusive_draw (const map_location &loc, const 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... | |
bool | unit_can_draw_here (const map_location &loc, const unit &unit) const |
Returns true if there is no exclusive draw request for loc, or if there is, that it's for unit. More... | |
void | add_overlay (const map_location &loc, overlay &&ov) |
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 & | context () const |
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... | |
tod_color | get_color_overlay () const |
virtual bool | in_editor () const |
const rect & | minimap_area () const |
mapx is the width of the portion of the display which shows the game area. More... | |
const rect & | palette_area () const |
const rect & | unit_image_area () const |
rect | max_map_area () const |
Returns the maximum area used for the map regardless to resolution and view size. More... | |
rect | map_area () const |
Returns the area used for the map. More... | |
rect | map_outside_area () const |
Returns the available area for a map, this may differ from the above. More... | |
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... | |
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 |
void | invalidate_game_status () |
Function to invalidate the game status displayed on the sidebar. More... | |
point | get_location (const map_location &loc) const |
Functions to get the on-screen positions of hexes. More... | |
rect | get_location_rect (const map_location &loc) const |
Returns the on-screen rect corresponding to a loc. More... | |
const rect_of_hexes | hexes_under_rect (const 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... | |
surface | screenshot (bool map_screenshot=false) |
Capture a (map-)screenshot into a surface. More... | |
void | queue_rerender () |
Marks everything for rendering including all tiles and sidebar. More... | |
void | queue_repaint () |
Queues repainting to the screen, but doesn't rerender. More... | |
void | add_redraw_observer (std::function< void(display &)> f) |
Adds a redraw observer, a function object to be called when a full rerender is queued. More... | |
void | clear_redraw_observers () |
Clear the redraw observers. More... | |
theme & | get_theme () |
void | set_theme (const std::string &new_theme) |
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 | draw_buttons () |
void | hide_buttons () |
Hide theme buttons so they don't draw. More... | |
void | unhide_buttons () |
Unhide theme buttons so they draw again. More... | |
void | refresh_report (const std::string &report_name, const config *new_cfg=nullptr) |
Update the given report. More... | |
void | draw_report (const std::string &report_name, bool test_run=false) |
Draw the specified report. More... | |
bool | draw_reports (const rect ®ion) |
Draw all reports in the given region. 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 () |
terrain_builder & | get_builder () |
void | update_fps_label () |
void | clear_fps_label () |
void | update_fps_count () |
void | rebuild_all () |
Rebuild all dynamic terrain. More... | |
const theme::action * | action_pressed () |
const theme::menu * | menu_pressed () |
void | set_diagnostic (const std::string &msg) |
double | turbo_speed () const |
void | bounds_check_position () |
void | bounds_check_position (int &xpos, int &ypos) const |
bool | scroll (const point &amount, bool force=false) |
Scrolls the display by amount 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 > &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... | |
void | set_prevent_draw (bool pd=true) |
Prevent the game display from drawing. More... | |
bool | get_prevent_draw () |
void | fade_tod_mask (const std::string &old, const std::string &new_) |
ToD mask smooth fade. More... | |
void | fade_to (const color_t &color, const std::chrono::milliseconds &duration) |
Screen fade. More... | |
void | set_fade (const color_t &color) |
virtual bool | expose (const rect ®ion) override |
Paint the indicated region to the screen. More... | |
virtual rect | screen_location () override |
Return the current draw location of the display, on the screen. More... | |
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... | |
void | blindfold (bool flag) |
bool | is_blindfolded () const |
void | write (config &cfg) const |
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 | 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, decltype(draw_helper::do_draw) draw_func) |
Add an item to the drawing buffer. More... | |
void | add_arrow (arrow &) |
void | remove_arrow (arrow &) |
void | update_arrow (arrow &a) |
Called by arrow objects when they change. More... | |
bool | debug_flag_set (DEBUG_FLAG flag) const |
void | set_debug_flag (DEBUG_FLAG flag, bool value) |
void | toggle_debug_flag (DEBUG_FLAG flag) |
Static Public Member Functions | |
static game_display * | get_singleton () |
Static Public Member Functions inherited from display | |
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 rect | scaled_to_zoom (const SDL_Rect &r) |
Scale the width and height of a rect by the current zoom factor. More... | |
static point | scaled_to_zoom (const point &p) |
static bool | zoom_at_max () |
static bool | zoom_at_min () |
static submerge_data | get_submerge_data (const rect &dest, double submerge, const point &size, uint8_t alpha, bool hreverse, bool vreverse) |
Protected Member Functions | |
virtual void | draw_invalidated () override |
Only called when there's actual redrawing to do. More... | |
virtual void | draw_hex (const map_location &loc) override |
Redraws a single gamemap location. More... | |
virtual overlay_map & | get_overlays () override |
Inherited from display. More... | |
std::vector< texture > | get_reachmap_images (const map_location &loc) const |
Protected Member Functions inherited from display | |
map_location | get_middle_location () const |
virtual rect | get_clip_rect () const |
Get the clipping rectangle for drawing. More... | |
void | draw_overlays_at (const map_location &loc) |
void | get_terrain_images (const map_location &loc, const std::string &timeid, TERRAIN_TYPE terrain_type) |
std::vector< texture > | get_fog_shroud_images (const map_location &loc, image::TYPE image_type) |
void | scroll_to_xy (const point &screen_coordinates, SCROLL_TYPE scroll_type, bool force=true) |
void | drawing_buffer_commit () |
Draws the drawing_buffer_ and clears it. More... | |
bool | draw_all_panels (const rect ®ion) |
Redraws all panels intersecting the given region. More... | |
void | process_reachmap_changes () |
Protected Member Functions inherited from gui2::top_level_drawable | |
top_level_drawable () | |
virtual | ~top_level_drawable () |
top_level_drawable (const top_level_drawable &) | |
top_level_drawable & | operator= (const top_level_drawable &) |
top_level_drawable (top_level_drawable &&) | |
top_level_drawable & | operator= (top_level_drawable &&) |
Protected Attributes | |
std::set< map_location > | units_that_can_reach_goal_ |
Protected Attributes inherited from display | |
const display_context * | dc_ |
halo::manager | halo_man_ |
std::weak_ptr< wb::manager > | wb_ |
exclusive_unit_draw_requests_t | exclusive_unit_draw_requests_ |
map of hexes where only one unit should be drawn, the one identified by the associated id string More... | |
std::size_t | viewing_team_index_ |
bool | dont_show_all_ |
point | viewport_origin_ |
Position of the top-left corner of the viewport, in pixels. More... | |
bool | view_locked_ |
theme | theme_ |
int | zoom_index_ |
const std::unique_ptr< fake_unit_manager > | fake_unit_man_ |
const std::unique_ptr< terrain_builder > | builder_ |
std::function< rect(rect)> | minimap_renderer_ |
SDL_Rect | minimap_location_ |
bool | redraw_background_ |
bool | invalidateAll_ |
int | diagnostic_label_ |
bool | invalidateGameStatus_ |
const std::unique_ptr< map_labels > | map_labels_ |
reports * | reports_object_ |
events::generic_event | scroll_event_ |
Event raised when the map is being scrolled. More... | |
boost::circular_buffer< std::chrono::milliseconds > | frametimes_ |
int | current_frame_sample_ = 0 |
unsigned int | fps_counter_ |
std::chrono::steady_clock::time_point | fps_start_ |
unsigned int | fps_actual_ |
utils::optional< std::chrono::steady_clock::time_point > | last_frame_finished_ = {} |
std::map< std::string, rect > | reportLocations_ |
std::map< std::string, texture > | reportSurfaces_ |
std::map< std::string, config > | reports_ |
std::vector< std::shared_ptr< gui::button > > | menu_buttons_ |
std::vector< std::shared_ptr< gui::button > > | action_buttons_ |
std::set< map_location > | invalidated_ |
texture | tod_hex_mask1 = {} |
texture | tod_hex_mask2 = {} |
uint8_t | tod_hex_alpha1 = 0 |
uint8_t | tod_hex_alpha2 = 0 |
std::vector< std::string > | fog_images_ |
std::vector< std::string > | shroud_images_ |
map_location | selectedHex_ |
map_location | mouseoverHex_ |
CKey | keys_ |
bool | animate_map_ |
Local cache for prefs::get().animate_map, since it is constantly queried. More... | |
bool | animate_water_ |
Local version of prefs::get().animate_water, used to detect when it's changed. More... | |
std::size_t | playing_team_index_ |
std::list< draw_helper > | drawing_buffer_ |
bool | map_screenshot_ |
Used to indicate to drawing functions that we are doing a map screenshot. More... | |
reach_map | reach_map_ |
reach_map | reach_map_old_ |
bool | reach_map_changed_ |
Private Member Functions | |
void | invalidate_route () |
Private Attributes | |
overlay_map | overlay_map_ |
map_location | attack_indicator_src_ |
map_location | attack_indicator_dst_ |
pathfind::marked_route | route_ |
map_location | displayedUnitHex_ |
bool | first_turn_ |
bool | in_game_ |
const std::unique_ptr< display_chat_manager > | chat_man_ |
game_mode | mode_ |
bool | needs_rebuild_ |
Additional Inherited Members | |
Protected Types inherited from display | |
enum | TERRAIN_TYPE { BACKGROUND , FOREGROUND } |
typedef std::map< map_location, std::string > | exclusive_unit_draw_requests_t |
typedef std::map< map_location, unsigned int > | reach_map |
typedef std::map< map_location, std::vector< overlay > > | overlay_map |
Static Protected Member Functions inherited from display | |
static void | fill_images_list (const std::string &prefix, std::vector< std::string > &images) |
Static Protected Attributes inherited from display | |
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 |
Definition at line 30 of file game_display.hpp.
Sets the linger mode for the display.
There have been some discussions on what to do with fog and shroud the extra variables make it easier to modify the behavior. There might even be a split between victory and defeat.
Enumerator | |
---|---|
RUNNING | no linger overlay, show fog and shroud. |
LINGER |
Definition at line 207 of file game_display.hpp.
game_display::game_display | ( | game_board & | board, |
std::weak_ptr< wb::manager > | wb, | ||
reports & | reports_object, | ||
const std::string & | theme_id, | ||
const config & | level | ||
) |
Definition at line 61 of file game_display.cpp.
game_display::~game_display | ( | ) |
Definition at line 80 of file game_display.cpp.
References chat_man_, DBG_DP, and utils::get_unknown_exception_type().
|
delete |
|
inline |
Function to get attack direction suffix.
Definition at line 185 of file game_display.hpp.
References attack_indicator_dst_, attack_indicator_src_, map_location::get_relative_dir(), and map_location::write_direction().
Referenced by draw_hex().
void game_display::begin_game | ( | ) |
Definition at line 614 of file game_display.cpp.
References display::create_buttons(), in_game_, and display::invalidate_all().
void game_display::clear_attack_indicator | ( | ) |
Definition at line 609 of file game_display.cpp.
References map_location::null_location(), and set_attack_indicator().
Referenced by events::mouse_handler::attack_enemy_(), events::mouse_handler::mouse_motion(), events::mouse_handler::move_action(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), events::mouse_handler::teleport_action(), and events::mouse_handler::touch_motion().
void game_display::display_unit_hex | ( | map_location | hex | ) |
Change the unit to be displayed in the sidebar.
This is used when selecting or highlighting is not wanted.
< Lasts for whole method.
Definition at line 139 of file game_display.cpp.
References display::context(), displayedUnitHex_, display::dont_show_all_, display_context::get_visible_unit(), invalidate_unit(), synced_context::is_synced(), map_location::valid(), and display::viewing_team().
Referenced by events::mouse_handler::attack_enemy_(), game_lua_kernel::intf_highlight_hex(), select_hex(), and unit_display::unit_healing().
|
inlineoverridevirtual |
Virtual functions shadowed in game_display.
These are needed to generate reports easily, without dynamic casting. Hope to factor out eventually.
Reimplemented from display.
Definition at line 190 of file game_display.hpp.
References displayedUnitHex_.
Referenced by game_lua_kernel::intf_get_displayed_unit().
|
overrideprotectedvirtual |
Redraws a single gamemap location.
Reimplemented from display.
Definition at line 226 of file game_display.cpp.
References attack_indicator, attack_indicator_direction(), attack_indicator_dst_, attack_indicator_src_, draw::blit(), display::context(), display::dc_, display::draw_hex(), draw_movement_info(), display::drawing_buffer_add(), fog_shroud, footsteps, footsteps_images(), cursor::get(), get_reachmap_images(), image::get_texture(), display_context::get_visible_unit(), image::HEXED, is_shrouded(), game_config::images::linger, linger_overlay, display_context::map(), display::map_screenshot_, mode_, mouseover_bottom, mouseover_top, display::mouseoverHex_, gamemap_base::on_board(), display::reach_map_, route_, RUNNING, game_config::images::selected, selected_hex, display::selectedHex_, display::shrouded(), unit::side(), t, image::TOD_COLORED, display::viewing_team(), w, cursor::WAIT, and display::wb_.
|
overrideprotectedvirtual |
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 from display.
Definition at line 195 of file game_display.cpp.
References utils::contains(), display::draw_invalidated(), display::fake_unit_man_, display::invalidated_, unit_drawer::redraw_unit(), and display::unit_can_draw_here().
void game_display::draw_movement_info | ( | const map_location & | loc | ) |
Draws the movement info (turns available) for a given location.
Definition at line 367 of file game_display.cpp.
References draw::blit(), display::context(), display::draw_text_in_hex(), display::drawing_buffer_add(), unit_map::find(), image::get_texture(), image::HEXED, pathfind::marked_route::marks, move_info, font::NORMAL_COLOR, game_config::red_to_green(), route_, pathfind::marked_route::steps, display_context::units(), movetype::UNREACHABLE, w, and display::wb_.
Referenced by draw_hex().
void game_display::float_label | ( | const map_location & | loc, |
const std::string & | text, | ||
const color_t & | color | ||
) |
Function to float a label above a tile.
Definition at line 576 of file game_display.cpp.
References font::add_floating_label(), font::ANCHOR_LABEL_MAP, rect::center(), display::fogged(), prefs::get(), display::get_location_rect(), display::get_zoom_factor(), font::floating_label::set_color(), font::floating_label::set_font_size(), font::floating_label::set_lifetime(), font::floating_label::set_move(), font::floating_label::set_position(), font::floating_label::set_scroll_mode(), font::SIZE_FLOAT_LABEL, and display::turbo_speed().
Referenced by game_lua_kernel::intf_float_label(), and unit_frame::redraw().
|
inline |
Definition at line 182 of file game_display.hpp.
References attack_indicator_src_.
Referenced by REPORT_GENERATOR().
|
inline |
Definition at line 192 of file game_display.hpp.
References chat_man_.
Referenced by chat_message(), wfl::builtins::DEFINE_WFL_FUNCTION(), gui2::dialogs::lua_interpreter::display(), ai::formula_ai::display_message(), do_replay_handle(), game_lua_kernel::intf_clear_messages(), ai::readonly_context_impl::log_message(), game_lua_kernel::lua_chat(), playmp_controller::process_network_data_impl(), game_events::wml_event_pump::show_wml_messages(), and gui::floating_textbox::tab().
|
overrideprotectedvirtual |
Inherited from display.
Implements display.
Definition at line 638 of file game_display.cpp.
References overlay_map_.
|
protected |
Definition at line 643 of file game_display.cpp.
References DBG_DP, image::exists(), get_adjacent_tiles(), display_direction::get_direction(), image::get_texture(), image::HEXED, i, names, display::reach_map_, game_config::reach_map_prefix, and s.
Referenced by draw_hex().
|
inline |
Gets the route along which footsteps are drawn to show movement of a unit.
If no route is currently being shown, the array get_route().steps will be empty.
Definition at line 121 of file game_display.hpp.
References route_.
Referenced by unit_moves().
|
inlinestatic |
Definition at line 44 of file game_display.hpp.
References display::singleton_.
Referenced by actions::undo_list::apply_shroud_changes(), chat_message(), wb::manager::create_temp_move(), wfl::builtins::DEFINE_WFL_FUNCTION(), ai::formula_ai::display_message(), do_replay_handle(), wb::manager::erase_temp_move(), game_events::wml_event_pump::flush_messages(), ai::readonly_context_impl::log_message(), game_events::wml_event_pump::operator()(), gui2::dialogs::mp_change_control::pre_show(), game_events::wml_event_pump::process_event(), playmp_controller::process_network_change_controller_impl(), playmp_controller::process_network_data_impl(), playmp_controller::process_network_side_drop_impl(), game_events::wml_event_pump::raise(), actions::undo_list::redo(), unit_frame::redraw(), REPORT_GENERATOR(), wfl::formula_debugger::show_gui(), game_events::wml_event_pump::show_wml_messages(), SYNCED_COMMAND_HANDLER_FUNCTION(), gui::floating_textbox::tab(), actions::undo_list::undo(), actions::undo::move_action::undo(), actions::undo::recall_action::undo(), actions::undo::recruit_action::undo(), unit_display::unit_healing(), unit_moves(), unit_display::unit_recruited(), game_events::WML_HANDLER_FUNCTION(), and wb::highlighter::~highlighter().
|
overridevirtual |
Implements display.
Definition at line 327 of file game_display.cpp.
References tod_manager::get_time_of_day(), and resources::tod_manager.
|
overridevirtual |
Reimplemented from display.
Definition at line 332 of file game_display.cpp.
References tod_manager::has_time_area(), and resources::tod_manager.
void game_display::highlight_another_reach | ( | const pathfind::paths & | paths_list, |
const map_location & | goal = map_location::null_location() |
||
) |
Add more paths to highlight.
Print numbers where they overlap. Used by Show Enemy Moves. If goal is not null_location
, highlight enemy units that can reach goal.
Definition at line 526 of file game_display.cpp.
References pathfind::paths::dest_vect::contains(), pathfind::paths::step::curr, pathfind::paths::destinations, pathfind::paths::dest_vect::find(), pathfind::paths::dest_vect::get_path(), map_location::null_location(), display::reach_map_, display::reach_map_changed_, and units_that_can_reach_goal_.
Referenced by highlight_reach(), and events::mouse_handler::select_hex().
|
overridevirtual |
Function to highlight a location.
If a unit is in the location, it will be displayed in the sidebar. Selection is used when a unit has been clicked on, while highlighting is used when a location has been moused over.
< Lasts for whole method.
Reimplemented from display.
Definition at line 115 of file game_display.cpp.
References display::context(), displayedUnitHex_, display::dont_show_all_, display_context::get_visible_unit(), display::highlight_hex(), display::invalidate_game_status(), invalidate_unit(), synced_context::is_synced(), display::mouseoverHex_, display::selectedHex_, and display::viewing_team().
Referenced by events::mouse_handler::attack_enemy_(), game_lua_kernel::intf_deselect_hex(), game_lua_kernel::intf_highlight_hex(), events::mouse_handler::mouse_motion(), and events::mouse_handler::touch_motion().
void game_display::highlight_reach | ( | const pathfind::paths & | paths_list | ) |
Sets the paths that are currently displayed as available for the unit to move along.
All other paths will be grayed out.
Definition at line 520 of file game_display.cpp.
References highlight_another_reach(), and unhighlight_reach().
Referenced by events::mouse_handler::select_hex(), and events::mouse_handler::show_reach_for_unit().
|
inlineoverridevirtual |
|
private |
Definition at line 554 of file game_display.cpp.
References i, display::invalidate(), route_, and pathfind::marked_route::steps.
Referenced by set_route().
|
inline |
Function to invalidate that unit status displayed on the sidebar.
Definition at line 130 of file game_display.hpp.
References display::invalidateGameStatus_.
Referenced by actions::undo_list::apply_shroud_changes(), display_unit_hex(), highlight_hex(), invalidate_unit_after_move(), SYNCED_COMMAND_HANDLER_FUNCTION(), and unit_display::unit_recruited().
void game_display::invalidate_unit_after_move | ( | const map_location & | src, |
const map_location & | dst | ||
) |
Same as invalidate_unit() if moving the displayed unit.
Definition at line 153 of file game_display.cpp.
References displayedUnitHex_, dst, invalidate_unit(), and src.
Referenced by game_lua_kernel::intf_teleport().
|
overridevirtual |
TLD layout() override.
Replaces old refresh_reports(). Be sure to call the base class method as well.
This updates some reports, like clock, that need to be refreshed every frame.
Reimplemented from display.
Definition at line 337 of file game_display.cpp.
References display::invalidateGameStatus_, display::layout(), display::refresh_report(), reports::report_list(), and display::reports_object_.
bool game_display::maybe_rebuild | ( | ) |
Rebuilds the screen if needs_rebuild(true) was previously called, and resets the flag.
Definition at line 627 of file game_display.cpp.
References display::invalidate_all(), needs_rebuild_, display::rebuild_all(), and display::recalculate_minimap().
Referenced by game_lua_kernel::intf_redraw(), game_events::wml_event_pump::process_event(), and SYNCED_COMMAND_HANDLER_FUNCTION().
void game_display::needs_rebuild | ( | bool | b | ) |
Sets whether the screen (map visuals) needs to be rebuilt.
This is typically after the map has been changed by wml.
Definition at line 621 of file game_display.cpp.
References b, and needs_rebuild_.
Referenced by impl_merge_terrain(), intf_terrain_mask(), SYNCED_COMMAND_HANDLER_FUNCTION(), and game_events::WML_HANDLER_FUNCTION().
void game_display::new_turn | ( | ) |
Update lighting settings.
Should be called on every new turn.
Definition at line 89 of file game_display.cpp.
References display::fade_tod_mask(), first_turn_, tod_manager::get_previous_time_of_day(), tod_manager::get_time_of_day(), time_of_day::image_mask, resources::tod_manager, and display::update_tod().
Referenced by game_lua_kernel::intf_replace_schedule(), SYNCED_COMMAND_HANDLER_FUNCTION(), and game_events::WML_HANDLER_FUNCTION().
|
inlineoverridevirtual |
Reimplemented from display.
Definition at line 56 of file game_display.hpp.
References chat_man_.
Referenced by events::menu_handler::has_friends(), and gui2::dialogs::mp_change_control::pre_show().
|
delete |
|
overridevirtual |
TLD render() override.
Replaces old post_draw(). Be sure to call the base class method as well.
This calls the whiteboard's post-draw method after rendering.
Reimplemented from display.
Definition at line 186 of file game_display.cpp.
References display::render(), w, and display::wb_.
void game_display::scroll_to_leader | ( | int | side, |
SCROLL_TYPE | scroll_type = ONSCREEN , |
||
bool | force = true |
||
) |
Scrolls to the leader of a certain side.
This will normally be the playing team.
Definition at line 161 of file game_display.cpp.
References display::context(), unit_map::find_leader(), display::scroll_to_tile(), display_context::units(), unit_map::iterator_base< iter_types >::valid(), and display::viewing_team().
Referenced by events::menu_handler::status_table().
|
overridevirtual |
Function to display a location as selected.
If a unit is in the location, and there is no unit in the currently highlighted hex, the unit will be displayed in the sidebar.
Reimplemented from display.
Definition at line 105 of file game_display.cpp.
References display_unit_hex(), display::fogged(), display::select_hex(), and map_location::valid().
Referenced by events::mouse_handler::attack_enemy_(), events::mouse_handler::move_action(), events::mouse_handler::move_unit_along_current_route(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), and events::mouse_handler::select_teleport().
void game_display::set_attack_indicator | ( | const map_location & | src, |
const map_location & | dst | ||
) |
Set the attack direction indicator.
Definition at line 595 of file game_display.cpp.
References attack_indicator_dst_, attack_indicator_src_, dst, display::invalidate(), and src.
Referenced by clear_attack_indicator(), events::mouse_handler::mouse_motion(), and events::mouse_handler::touch_motion().
void game_display::set_game_mode | ( | const game_mode | mode | ) |
Definition at line 359 of file game_display.cpp.
References display::invalidate_all(), and mode_.
void game_display::set_route | ( | const pathfind::marked_route * | route | ) |
Sets the route along which footsteps are drawn to show movement of a unit.
If nullptr, no route is displayed. route does not have to remain valid after being set.
Definition at line 562 of file game_display.cpp.
References invalidate_route(), pathfind::marked_route::marks, route_, and pathfind::marked_route::steps.
Referenced by events::mouse_handler::mouse_motion(), events::mouse_handler::move_action(), events::mouse_handler::move_unit_along_current_route(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), events::mouse_handler::select_teleport(), events::mouse_handler::set_current_paths(), events::mouse_handler::show_reach_for_unit(), events::mouse_handler::teleport_action(), and events::mouse_handler::touch_motion().
bool game_display::unhighlight_reach | ( | ) |
Reset highlighting of paths.
Definition at line 542 of file game_display.cpp.
References display::reach_map_, display::reach_map_changed_, and units_that_can_reach_goal_.
Referenced by events::mouse_handler::attack_enemy_(), highlight_reach(), events::mouse_handler::mouse_motion(), events::mouse_handler::move_action(), events::mouse_handler::move_unit_along_current_route(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), events::mouse_handler::set_current_paths(), and events::mouse_handler::touch_motion().
|
inline |
Return the locations of units that can reach goal (.
Definition at line 105 of file game_display.hpp.
References units_that_can_reach_goal_.
Referenced by unit_drawer::unit_drawer().
|
overridevirtual |
TLD update() override.
Replaces old pre_draw(). Be sure to call the base class method as well.
game_display does specific things related e.g. to unit rendering and calls the whiteboard pre-draw method here.
Reimplemented from display.
Definition at line 170 of file game_display.cpp.
References chat_man_, display::process_reachmap_changes(), display::update(), w, and display::wb_.
|
private |
Definition at line 224 of file game_display.hpp.
Referenced by attack_indicator_direction(), draw_hex(), and set_attack_indicator().
|
private |
Definition at line 223 of file game_display.hpp.
Referenced by attack_indicator_direction(), draw_hex(), get_attack_indicator_src(), and set_attack_indicator().
|
private |
Definition at line 234 of file game_display.hpp.
Referenced by get_chat_manager(), observers(), update(), and ~game_display().
|
private |
Definition at line 230 of file game_display.hpp.
Referenced by display_unit_hex(), displayed_unit_hex(), highlight_hex(), and invalidate_unit_after_move().
|
private |
Definition at line 232 of file game_display.hpp.
Referenced by new_turn().
|
private |
Definition at line 232 of file game_display.hpp.
Referenced by begin_game(), and in_game().
|
private |
Definition at line 236 of file game_display.hpp.
Referenced by draw_hex(), and set_game_mode().
|
private |
Definition at line 238 of file game_display.hpp.
Referenced by maybe_rebuild(), and needs_rebuild().
|
private |
Definition at line 220 of file game_display.hpp.
Referenced by get_overlays().
|
private |
Definition at line 226 of file game_display.hpp.
Referenced by draw_hex(), draw_movement_info(), get_route(), invalidate_route(), and set_route().
|
protected |
Definition at line 173 of file game_display.hpp.
Referenced by highlight_another_reach(), unhighlight_reach(), and units_that_can_reach_goal().