#include <game_display.hpp>


Classes | |
| struct | chat_message |
| class | fake_unit |
| A temporary unit that can be placed on the map. More... | |
| struct | overlay |
Public Types | |
| enum | tgame_mode { RUNNING, LINGER_SP, LINGER_MP } |
Sets the linger mode for the display. More... | |
Public Member Functions | |
| game_display (unit_map &units, CVideo &video, const gamemap &map, const tod_manager &tod_manager, const std::vector< team > &t, const config &theme_cfg, const config &level) | |
| ~game_display () | |
| void | new_turn () |
| Update lighting settings. | |
| void | scroll_to_leader (unit_map &units, int side, SCROLL_TYPE scroll_type=ONSCREEN, bool force=true) |
| Scrolls to the leader of a certain side. | |
| virtual void | select_hex (map_location hex) |
| Function to display a location as selected. | |
| virtual void | highlight_hex (map_location hex) |
| Function to highlight a location. | |
| void | display_unit_hex (map_location hex) |
| Change the unit to be displayed in the sidebar. | |
| void | highlight_reach (const pathfind::paths &paths_list) |
| Sets the paths that are currently displayed as available for the unit to move along. | |
| void | highlight_another_reach (const pathfind::paths &paths_list) |
| Add more paths to highlight. | |
| void | unhighlight_reach () |
| Reset highlighting of paths. | |
| void | set_route (const pathfind::marked_route *route) |
| Sets the route along which footsteps are drawn to show movement of a unit. | |
| void | float_label (const map_location &loc, const std::string &text, int red, int green, int blue) |
| Function to float a label above a tile. | |
| std::vector< surface > | footsteps_images (const map_location &loc) |
| Function to return 2 half-hex footsteps images for the given location. | |
| void | draw_movement_info (const map_location &loc) |
| Draws the movement info (turns available) for a given location. | |
| void | draw_report (const std::string &report_name) |
| void | invalidate_unit () |
| Function to invalidate that unit status displayed on the sidebar. | |
| void | invalidate_unit_after_move (const map_location &src, const map_location &dst) |
| Same as invalidate_unit() if moving the displayed unit. | |
| const time_of_day & | get_time_of_day (const map_location &loc) const |
| bool | has_time_area () 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. | |
| std::string | remove_exclusive_draw (const map_location &loc) |
| Cancels an exclusive draw request. | |
| void | clear_exclusive_draws () |
| Cancels all the exclusive draw requests. | |
| void | set_attack_indicator (const map_location &src, const map_location &dst) |
| Set the attack direction indicator. | |
| void | clear_attack_indicator () |
| std::string | attack_indicator_direction () const |
| Function to get attack direction suffix. | |
| void | add_overlay (const map_location &loc, const std::string &image, const std::string &halo="", const std::string &team_name="", bool visible_under_fog=true) |
| Functions to add and remove overlays from locations. | |
| void | remove_overlay (const map_location &loc) |
| remove_overlay will remove all overlays on a tile. | |
| void | remove_single_overlay (const map_location &loc, const std::string &toDelete) |
| remove_single_overlay will remove a single overlay from a tile | |
| void | parse_team_overlays () |
| Check the overlay_map for proper team-specific overlays to be displayed/hidden. | |
| t_translation::t_terrain | get_terrain_on (int palx, int paly, int x, int y) |
| void | send_notification (const std::string &owner, const std::string &message) |
| void | set_team (size_t team, bool observe=false) |
| Sets the team controlled by the player using the computer. | |
| void | set_playing_team (size_t team) |
| const std::vector< team > & | get_teams () |
| unit_map & | get_units () |
| const unit_map & | get_const_units () const |
| const map_location & | displayed_unit_hex () const |
| bool | show_everything () const |
| size_t | viewing_team () const |
| The viewing team is the team currently viewing the game. | |
| int | viewing_side () const |
| size_t | playing_team () const |
| The playing team is the team whose turn it is. | |
| int | playing_side () const |
| bool | team_valid () const |
| std::string | current_team_name () const |
| void | add_observer (const std::string &name) |
| void | remove_observer (const std::string &name) |
| const std::set< std::string > & | observers () const |
| void | add_chat_message (const time_t &time, const std::string &speaker, int side, const std::string &msg, events::chat_handler::MESSAGE_TYPE type, bool bell) |
| void | clear_chat_messages () |
| void | begin_game () |
| virtual bool | in_game () const |
| void | draw_bar (const std::string &image, int xpos, int ypos, const map_location &loc, size_t height, double filled, const SDL_Color &col, fixed_t alpha) |
| void | set_game_mode (const tgame_mode game_mode) |
Static Public Member Functions | |
| static game_display * | create_dummy_display (CVideo &video) |
| static game_display * | get_singleton () |
| static int & | debug_highlight (const map_location &loc) |
| annotate hex with number, useful for debugging or UI prototype | |
| static void | clear_debug_highlights () |
Protected Member Functions | |
| void | pre_draw () |
| game_display pre_draw does specific things related e.g. | |
| void | draw_invalidated () |
| Only called when there's actual redrawing to do. | |
| void | post_commit () |
| Hook for actions to take right after draw() calls drawing_buffer_commit No action here by default. | |
| void | draw_hex (const map_location &loc) |
| Redraws a single gamemap location. | |
| void | invalidate_animations () |
| Animated hex invalidation specific to gameplay. | |
| void | invalidate_animations_location (const map_location &loc) |
| Extra game per-location invalidation (village ownership). | |
| virtual void | draw_minimap_units () |
Private Types | |
| typedef std::map< map_location, std::string > | exclusive_unit_draw_requests_t |
| typedef std::multimap < map_location, overlay > | overlay_map |
| typedef std::map< map_location, unsigned int > | reach_map |
Private Member Functions | |
| void | place_temporary_unit (unit *u) |
| Temporarily place a unit on map (moving: can overlap others). | |
| int | remove_temporary_unit (unit *u) |
| Removes any instances of this temporary unit from the temporary unit vector. | |
| game_display (const game_display &) | |
| void | operator= (const game_display &) |
| void | draw_sidebar () |
| Called near the end of a draw operation, derived classes can use this to render a specific sidebar. | |
| surface | get_flag (const map_location &loc) |
| const SDL_Rect & | calculate_energy_bar (surface surf) |
| Finds the start and end rows on the energy bar image. | |
| void | invalidate_route () |
| void | prune_chat_messages (bool remove_all=false) |
| void | process_reachmap_changes () |
Private Attributes | |
| unit_map & | units_ |
| std::deque< unit * > | fake_units_ |
| collection of units destined to be drawn but not put into the unit map | |
| 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 | |
| map_location | attack_indicator_src_ |
| map_location | attack_indicator_dst_ |
| std::map< surface, SDL_Rect > | energy_bar_rects_ |
| pathfind::marked_route | route_ |
| const tod_manager & | tod_manager_ |
| const std::vector< team > & | teams_ |
| const config & | level_ |
| map_location | displayedUnitHex_ |
| overlay_map | overlays_ |
| size_t | currentTeam_ |
| size_t | activeTeam_ |
| double | sidebarScaling_ |
| bool | first_turn_ |
| bool | in_game_ |
| std::set< std::string > | observers_ |
| std::vector< chat_message > | chat_messages_ |
| reach_map | reach_map_ |
| reach_map | reach_map_old_ |
| bool | reach_map_changed_ |
| tgame_mode | game_mode_ |
| std::vector< animated < image::locator > > | flags_ |
| Animated flags for each team. | |
Static Private Attributes | |
| static std::map< map_location, int > | debugHighlights_ |
| static game_display * | singleton_ = NULL |
Friends | |
| class | game_display::fake_unit |
Definition at line 38 of file game_display.hpp.
typedef std::map<map_location, std::string> game_display::exclusive_unit_draw_requests_t [private] |
Definition at line 348 of file game_display.hpp.
typedef std::multimap<map_location,overlay> game_display::overlay_map [private] |
Definition at line 387 of file game_display.hpp.
typedef std::map<map_location,unsigned int> game_display::reach_map [private] |
Definition at line 414 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 behaviour. There might even be a split between victory and defeat.
| RUNNING |
no linger overlay, show fog and shroud. |
| LINGER_SP |
linger overlay, show fog and shroud. |
| LINGER_MP |
Definition at line 327 of file game_display.hpp.
| game_display::game_display | ( | unit_map & | units, | |
| CVideo & | video, | |||
| const gamemap & | map, | |||
| const tod_manager & | tod_manager, | |||
| const std::vector< team > & | t, | |||
| const config & | theme_cfg, | |||
| const config & | level | |||
| ) |
Definition at line 59 of file game_display.cpp.
References animated< T, T_void_value >::add_frame(), display::clear_screen(), game_config::images::flag, game_config::flag_rgb, flags_, team::get_side_color_index(), LOG_DP, image::set_team_colors(), singleton_, utils::split(), and teams_.
Referenced by create_dummy_display().


| game_display::~game_display | ( | ) |
Definition at line 150 of file game_display.cpp.
References prune_chat_messages(), and singleton_.

| game_display::game_display | ( | const game_display & | ) | [private] |
| void game_display::add_chat_message | ( | const time_t & | time, | |
| const std::string & | speaker, | |||
| int | side, | |||
| const std::string & | msg, | |||
| events::chat_handler::MESSAGE_TYPE | type, | |||
| bool | bell | |||
| ) |
Definition at line 1336 of file game_display.cpp.
References font::add_floating_label(), chat_message(), chat_messages_, ERR_NG, preferences::get_chat_timestamp(), font::get_floating_label_rect(), team::get_side_color_range(), int_to_color(), preferences::is_friend(), preferences::is_ignored(), is_observer(), font::LEFT_ALIGN, preferences::login(), display::map_outside_area(), events::chat_handler::MESSAGE_PRIVATE, events::chat_handler::MESSAGE_PUBLIC, preferences::parse_admin_authentication(), preferences::parse_should_show_lobby_join(), sound::play_UI_sound(), prune_chat_messages(), game_config::sounds::receive_message, game_config::sounds::receive_message_friend, game_config::sounds::receive_message_highlight, game_config::sounds::receive_message_server, send_notification(), font::SIZE_SMALL, display::w(), utils::word_match(), and font::word_wrap_text().
Referenced by events::menu_handler::add_chat_message(), chat_message(), check_checksums(), ai::formula_ai::display_message(), do_replay_handle(), ai::readonly_context_impl::log_message(), turn_info::process_network_data(), show_wml_errors(), show_wml_messages(), and gui::floating_textbox::tab().


| bool game_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 exlusivity. |
Definition at line 983 of file game_display.cpp.
References exclusive_unit_draw_requests_, unit::id(), and map_location::valid().
Referenced by wb::highlight_visitor::visit().


| void game_display::add_observer | ( | const std::string & | name | ) | [inline] |
Definition at line 303 of file game_display.hpp.
References observers_.
Referenced by turn_info::process_network_data().

| void game_display::add_overlay | ( | const map_location & | loc, | |
| const std::string & | image, | |||
| const std::string & | halo = "", |
|||
| const std::string & | team_name = "", |
|||
| bool | visible_under_fog = true | |||
| ) |
Functions to add and remove overlays from locations.
An overlay is an image that is displayed on top of the tile. One tile may have multiple overlays.
Definition at line 1027 of file game_display.cpp.
References halo::add(), display::get_location_x(), display::get_location_y(), display::hex_size(), and overlays_.
Referenced by intf_add_tile_overlay().


| std::string game_display::attack_indicator_direction | ( | ) | const [inline] |
Function to get attack direction suffix.
Definition at line 236 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 1321 of file game_display.cpp.
References display::create_buttons(), in_game_, and display::invalidate_all().

| const SDL_Rect & game_display::calculate_energy_bar | ( | surface | surf | ) | [private] |
Finds the start and end rows on the energy bar image.
White pixels are substituted for the color of the energy.
Definition at line 838 of file game_display.cpp.
References preferences::editor::TransitionUpdateMode::count, gui2::create_rect(), energy_bar_rects_, make_neutral_surface(), and const_surface_lock::pixels().
Referenced by draw_bar().


| void game_display::clear_attack_indicator | ( | ) |
Definition at line 1022 of file game_display.cpp.
References map_location::null_location, and set_attack_indicator().
Referenced by events::mouse_handler::attack_enemy_(), events::mouse_handler::left_click(), events::mouse_handler::mouse_motion(), events::mouse_handler::save_whiteboard_attack(), and events::mouse_handler::select_hex().


| void game_display::clear_chat_messages | ( | ) | [inline] |
Definition at line 309 of file game_display.hpp.
References prune_chat_messages().
Referenced by events::menu_handler::clear_messages(), events::console_handler::do_clear(), and intf_clear_messages().


| static void game_display::clear_debug_highlights | ( | ) | [inline, static] |
Definition at line 290 of file game_display.hpp.
References debugHighlights_.
| void game_display::clear_exclusive_draws | ( | ) | [inline] |
Cancels all the exclusive draw requests.
Definition at line 229 of file game_display.hpp.
References exclusive_unit_draw_requests_.
| game_display * game_display::create_dummy_display | ( | CVideo & | video | ) | [static] |
Definition at line 139 of file game_display.cpp.
References game_display().
Referenced by game_controller_abstract::disp().


| std::string game_display::current_team_name | ( | ) | const |
Definition at line 1083 of file game_display.cpp.
References currentTeam_, team_valid(), and teams_.
Referenced by events::menu_handler::clear_labels().


| int & game_display::debug_highlight | ( | const map_location & | loc | ) | [static] |
annotate hex with number, useful for debugging or UI prototype
Definition at line 915 of file game_display.cpp.
References assert, game_config::debug, and debugHighlights_.
| 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.
Definition at line 240 of file game_display.cpp.
References displayedUnitHex_, get_visible_unit(), invalidate_unit(), teams_, map_location::valid(), viewing_team(), and display::viewpoint_.
Referenced by events::mouse_handler::attack_enemy_(), intf_highlight_hex(), and select_hex().


| const map_location& game_display::displayed_unit_hex | ( | ) | const [inline] |
Definition at line 283 of file game_display.hpp.
References displayedUnitHex_.
Referenced by REPORT_GENERATOR(), unit_hp(), unit_status(), and unit_weapons().

| void game_display::draw_bar | ( | const std::string & | image, | |
| int | xpos, | |||
| int | ypos, | |||
| const map_location & | loc, | |||
| size_t | height, | |||
| double | filled, | |||
| const SDL_Color & | col, | |||
| fixed_t | alpha | |||
| ) |
Definition at line 483 of file game_display.cpp.
References calculate_energy_bar(), create_compatible_surface(), gui2::create_rect(), display::drawing_buffer_add(), ftofxp, fxpdiv, fxpmult, fxptoi, image::get_image(), display::get_zoom_factor(), display::h(), display::LAYER_UNIT_BAR, image::SCALED_TO_HEX, sdl_fill_rect(), display::w(), and map_location::x.
Referenced by unit::redraw_unit().


| void game_display::draw_hex | ( | const map_location & | loc | ) | [protected, virtual] |
Redraws a single gamemap location.
Reimplemented from display.
Definition at line 313 of file game_display.cpp.
References attack_indicator_direction(), attack_indicator_dst_, attack_indicator_src_, font::BAD_COLOR, game_config::debug, debugHighlights_, wb::manager::draw_hex(), draw_movement_info(), display::draw_text_in_hex(), display::drawing_buffer_add(), display::fogged(), footsteps_images(), game_mode_, get_flag(), image::get_image(), display::get_image_type(), display::get_location_x(), display::get_location_y(), display::get_map(), get_visible_unit(), is_shrouded(), display::LAYER_ATTACK_INDICATOR, display::LAYER_FOOTSTEPS, display::LAYER_LINGER_OVERLAY, display::LAYER_MOUSEOVER_BOTTOM, display::LAYER_MOVE_INFO, display::LAYER_REACHMAP, display::LAYER_SELECTED_HEX, display::LAYER_TERRAIN_BG, lexical_cast(), game_config::images::linger, display::mouseoverHex_, gamemap::on_board(), overlays_, playing_team(), reach_map_, RUNNING, image::SCALED_TO_HEX, game_config::images::selected, display::selectedHex_, display::shrouded(), teams_, image::TOD_COLORED, game_config::images::unreachable, viewing_team(), and resources::whiteboard.

| void game_display::draw_invalidated | ( | ) | [protected, virtual] |
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 285 of file game_display.cpp.
References unit_map::end(), exclusive_unit_draw_requests_, fake_units_, unit_map::find(), unit::get_location(), unit::id(), display::invalidated_, unit::redraw_unit(), units_, and halo::unrender().

| void game_display::draw_minimap_units | ( | ) | [protected, virtual] |
Reimplemented from display.
Definition at line 451 of file game_display.cpp.
References unit_map::begin(), gui2::create_rect(), currentTeam_, unit_map::end(), display::fogged(), display::get_map(), team::get_minimap_color(), gamemap::h(), is_odd(), display::minimap_location_, round_double(), sdl_fill_rect(), teams_, units_, display::video(), and gamemap::w().

| void game_display::draw_movement_info | ( | const map_location & | loc | ) |
Draws the movement info (turns available) for a given location.
Definition at line 558 of file game_display.cpp.
References schema_validation::at(), currentTeam_, display::draw_text_in_hex(), display::drawing_buffer_add(), unit_map::end(), unit_map::find(), find_visible_unit(), image::get_image(), display::get_location_x(), display::get_location_y(), display::get_map(), wb::manager::get_temp_move_unit(), int_to_color(), display::LAYER_MOVE_INFO, lexical_cast(), pathfind::marked_route::marks, display::mouseoverHex_, font::NORMAL_COLOR, reach_map_, game_config::red_to_green(), route_, image::SCALED_TO_HEX, display::selectedHex_, pathfind::marked_route::steps, resources::teams, units_, map_location::valid(), unit_map::iterator_base< iter_types >::valid(), display::w(), resources::whiteboard, and font::YELLOW_COLOR.
Referenced by draw_hex().


| void game_display::draw_report | ( | const std::string & | report_name | ) |
Definition at line 420 of file game_display.cpp.
References reports::generate_report(), display::refresh_report(), and team_valid().
Referenced by draw_sidebar().


| void game_display::draw_sidebar | ( | ) | [private, virtual] |
Called near the end of a draw operation, derived classes can use this to render a specific sidebar.
Very similar to post_commit.
Reimplemented from display.
Definition at line 429 of file game_display.cpp.
References draw_report(), display::invalidateGameStatus_, reports::report_list(), and teams_.

| void game_display::float_label | ( | const map_location & | loc, | |
| const std::string & | text, | |||
| int | red, | |||
| int | green, | |||
| int | blue | |||
| ) |
Function to float a label above a tile.
Definition at line 812 of file game_display.cpp.
References font::add_floating_label(), font::ANCHOR_LABEL_MAP, create_color(), display::fogged(), display::get_location_x(), display::get_location_y(), 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(), preferences::show_floating_labels(), font::SIZE_XLARGE, display::turbo_speed(), and display::zoom_.
Referenced by intf_float_label(), unit_frame::redraw(), and WML_HANDLER_FUNCTION().


| std::vector< surface > game_display::footsteps_images | ( | const map_location & | loc | ) |
Function to return 2 half-hex footsteps images for the given location.
Only loc is on the current route set by set_route.
Definition at line 638 of file game_display.cpp.
References unit_map::end(), unit_map::find(), gui2::event::find(), game_config::foot_speed_prefix, game_config::foot_teleport_enter, game_config::foot_teleport_exit, image::get_image(), display::get_map(), display::h(), route_, image::SCALED_TO_HEX, map_location::SOUTH_EAST, pathfind::marked_route::steps, tiles_adjacent(), and units_.
Referenced by draw_hex().


| const unit_map& game_display::get_const_units | ( | ) | const [inline] |
Definition at line 281 of file game_display.hpp.
References units_.
Referenced by unit_animation::matches().

| surface game_display::get_flag | ( | const map_location & | loc | ) | [private] |
Definition at line 706 of file game_display.cpp.
References display::animate_map_, currentTeam_, flags_, display::fogged(), image::get_image(), display::get_map(), gamemap::get_terrain(), teams_, gui2::terrain, and image::TOD_COLORED.
Referenced by draw_hex().


| static game_display* game_display::get_singleton | ( | ) | [inline, static] |
Definition at line 49 of file game_display.hpp.
References singleton_.
Referenced by unit_animator::add_animation(), ai::testing_ai_default::display_label(), test_utils::end_position_collector::fire_event(), unit_frame::get_overlaped_hex(), unit_animation::invalidate(), unit::invalidate(), move_unit_between(), unit_frame::redraw(), unit::redraw_unit(), unit::refresh(), unit_animator::replace_anim_if_invalid(), unit_display::reset_helpers(), unit::set_disabled_ghosted(), unit::set_ghosted(), unit::set_idling(), unit::set_selecting(), unit::set_standing(), unit::start_animation(), teleport_unit_between(), unit_animation::update_last_draw_time(), gui2::twindow::update_screen_size(), unit_animator::wait_for_end(), unit_animator::wait_until(), and WML_HANDLER_FUNCTION().

| const std::vector<team>& game_display::get_teams | ( | ) | [inline] |
Definition at line 278 of file game_display.hpp.
References teams_.
Referenced by unit::redraw_unit().

| t_translation::t_terrain game_display::get_terrain_on | ( | int | palx, | |
| int | paly, | |||
| int | x, | |||
| int | y | |||
| ) |
| const time_of_day & game_display::get_time_of_day | ( | const map_location & | loc | ) | const [virtual] |
Reimplemented from display.
Definition at line 410 of file game_display.cpp.
References tod_manager::get_time_of_day(), and tod_manager_.

| unit_map& game_display::get_units | ( | ) | [inline] |
Definition at line 280 of file game_display.hpp.
References units_.
Referenced by test_utils::end_position_collector::fire_event(), and unit_display::reset_helpers().

| bool game_display::has_time_area | ( | ) | const [virtual] |
Reimplemented from display.
Definition at line 415 of file game_display.cpp.
References tod_manager::has_time_area(), and tod_manager_.

| void game_display::highlight_another_reach | ( | const pathfind::paths & | paths_list | ) |
Add more paths to highlight.
Print numbers where they overlap. Used only by Show Enemy Moves.
Definition at line 734 of file game_display.cpp.
References pathfind::paths::step::curr, pathfind::paths::destinations, reach_map_, and reach_map_changed_.
Referenced by highlight_reach(), and events::menu_handler::show_enemy_moves().

| void game_display::highlight_hex | ( | map_location | hex | ) | [virtual] |
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.
Reimplemented from display.
Definition at line 216 of file game_display.cpp.
References unit_map::count(), displayedUnitHex_, get_visible_unit(), display::invalidate_game_status(), invalidate_unit(), display::mouseoverHex_, display::selectedHex_, teams_, units_, viewing_team(), and display::viewpoint_.
Referenced by events::mouse_handler::attack_enemy_(), events::menu_handler::do_search(), intf_highlight_hex(), intf_select_hex(), and events::mouse_handler::mouse_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 728 of file game_display.cpp.
References highlight_another_reach(), and unhighlight_reach().
Referenced by intf_highlight_hex(), events::mouse_handler::mouse_motion(), and events::mouse_handler::select_hex().


| virtual bool game_display::in_game | ( | ) | const [inline, virtual] |
| void game_display::invalidate_animations | ( | ) | [protected, virtual] |
Animated hex invalidation specific to gameplay.
Reimplemented from display.
Definition at line 887 of file game_display.cpp.
References fake_units_, get_location(), unit::refresh(), and units_.

| void game_display::invalidate_animations_location | ( | const map_location & | loc | ) | [protected, virtual] |
Extra game per-location invalidation (village ownership).
Reimplemented from display.
Definition at line 877 of file game_display.cpp.
References currentTeam_, flags_, display::fogged(), display::get_map(), display::invalidate(), teams_, and village_owner().

| void game_display::invalidate_route | ( | ) | [private] |
Definition at line 790 of file game_display.cpp.
References display::invalidate(), route_, and pathfind::marked_route::steps.
Referenced by set_route().


| void game_display::invalidate_unit | ( | ) | [inline] |
Function to invalidate that unit status displayed on the sidebar.
Definition at line 129 of file game_display.hpp.
References display::invalidateGameStatus_.
Referenced by apply_shroud_changes(), calculate_healing(), events::menu_handler::create_unit(), events::menu_handler::create_unit_2(), display_unit_hex(), events::console_handler::do_create(), events::console_handler::do_unit(), highlight_hex(), invalidate_unit_after_move(), attack::perform(), events::menu_handler::redo(), events::menu_handler::rename_unit(), events::menu_handler::undo(), and WML_HANDLER_FUNCTION().

| 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 254 of file game_display.cpp.
References displayedUnitHex_, and invalidate_unit().
Referenced by move_unit(), events::menu_handler::redo(), events::menu_handler::undo(), and WML_HANDLER_FUNCTION().


| void game_display::new_turn | ( | ) |
Update lighting settings.
Should be called on every new turn.
Definition at line 157 of file game_display.cpp.
References adjust_surface_alpha(), surface::assign(), display::draw(), first_turn_, ftofxp, fxpdiv, image::get_image(), tod_manager::get_previous_time_of_day(), tod_manager::get_time_of_day(), time_of_day::image_mask, display::invalidate_all(), image::SCALED_TO_HEX, display::tod_hex_mask1, display::tod_hex_mask2, tod_manager_, display::turbo_speed(), and display::update_tod().
Referenced by events::console_handler::do_turn(), and WML_HANDLER_FUNCTION().


| const std::set<std::string>& game_display::observers | ( | ) | const [inline] |
Definition at line 305 of file game_display.hpp.
References observers_.
Referenced by events::menu_handler::has_friends(), REPORT_GENERATOR(), and gui2::side_controller::show_nicks_list().

| void game_display::operator= | ( | const game_display & | ) | [private] |
| void game_display::parse_team_overlays | ( | ) |
Check the overlay_map for proper team-specific overlays to be displayed/hidden.
Definition at line 1068 of file game_display.cpp.
References display::invalidate(), overlays_, playing_team(), team::team_name(), game_display::overlay::team_name, and teams_.

| void game_display::place_temporary_unit | ( | unit * | u | ) | [private] |
Temporarily place a unit on map (moving: can overlap others).
The temp unit is added at the end of the temporary unit deque, and therefore gets drawn last, over other units and temp units. Adding the same unit twice isn't allowed.
Definition at line 954 of file game_display.cpp.
References ERR_NG, fake_units_, gui2::event::find(), unit::get_location(), and display::invalidate().
Referenced by game_display::fake_unit::place_on_game_display().


| int game_display::playing_side | ( | ) | const [inline] |
Definition at line 298 of file game_display.hpp.
References activeTeam_.
Referenced by turn_info::process_network_data(), and unit_moves().

| size_t game_display::playing_team | ( | ) | const [inline] |
The playing team is the team whose turn it is.
Definition at line 297 of file game_display.hpp.
References activeTeam_.
Referenced by draw_hex(), parse_team_overlays(), turn_info::process_network_data(), unit::redraw_unit(), REPORT_GENERATOR(), and savegame::game_savegame::write_game_snapshot().

| void game_display::post_commit | ( | ) | [protected, virtual] |
Hook for actions to take right after draw() calls drawing_buffer_commit No action here by default.
Reimplemented from display.
Definition at line 308 of file game_display.cpp.
References halo::render().

| void game_display::pre_draw | ( | ) | [protected, virtual] |
game_display pre_draw does specific things related e.g.
to unit rendering
Reimplemented from display.
Definition at line 276 of file game_display.cpp.
References process_reachmap_changes(), and prune_chat_messages().

| void game_display::process_reachmap_changes | ( | ) | [private] |
Definition at line 749 of file game_display.cpp.
References display::rect_of_hexes::begin(), display::rect_of_hexes::end(), display::get_visible_hexes(), display::invalidate(), reach_map_, reach_map_changed_, and reach_map_old_.
Referenced by pre_draw().


| void game_display::prune_chat_messages | ( | bool | remove_all = false |
) | [private] |
Definition at line 1458 of file game_display.cpp.
References preferences::chat_lines(), preferences::chat_message_aging(), chat_messages_, font::get_floating_label_rect(), game_display::chat_message::handle, font::move_floating_label(), font::remove_floating_label(), and game_display::chat_message::speaker_handle.
Referenced by add_chat_message(), clear_chat_messages(), pre_draw(), and ~game_display().


| std::string game_display::remove_exclusive_draw | ( | const map_location & | loc | ) |
Cancels an exclusive draw request.
Definition at line 996 of file game_display.cpp.
References exclusive_unit_draw_requests_, and map_location::valid().

| void game_display::remove_observer | ( | const std::string & | name | ) | [inline] |
Definition at line 304 of file game_display.hpp.
References observers_.
Referenced by turn_info::process_network_data().

| void game_display::remove_overlay | ( | const map_location & | loc | ) |
remove_overlay will remove all overlays on a tile.
Definition at line 1036 of file game_display.cpp.
References overlays_, and schema_validation::remove.
Referenced by intf_remove_tile_overlay().

| void game_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 1048 of file game_display.cpp.
References overlays_, and schema_validation::remove.
Referenced by intf_remove_tile_overlay().

| int game_display::remove_temporary_unit | ( | unit * | u | ) | [private] |
Removes any instances of this temporary unit from the temporary unit vector.
Returns the number of temp units deleted (0 or 1, any other number indicates an error).
Definition at line 964 of file game_display.cpp.
References unit::clear_haloes(), gui2::distance(), ERR_NG, fake_units_, unit::get_location(), display::invalidate(), and schema_validation::remove.
Referenced by game_display::fake_unit::remove_from_game_display().


| void game_display::scroll_to_leader | ( | unit_map & | units, | |
| 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 262 of file game_display.cpp.
References unit_map::end(), unit_map::find_leader(), display::scroll_to_tile(), and units_.
Referenced by events::menu_handler::scenario_settings_table(), and events::menu_handler::status_table().


| void game_display::select_hex | ( | map_location | hex | ) | [virtual] |
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 206 of file game_display.cpp.
References display_unit_hex(), display::fogged(), and map_location::valid().
Referenced by events::mouse_handler::attack_enemy_(), events::mouse_handler::left_click(), events::mouse_handler::move_unit_along_current_route(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), events::menu_handler::unit_list(), and WML_HANDLER_FUNCTION().


| void game_display::send_notification | ( | const std::string & | owner, | |
| const std::string & | message | |||
| ) |
Definition at line 1231 of file game_display.cpp.
Referenced by add_chat_message().

| void game_display::set_attack_indicator | ( | const map_location & | src, | |
| const map_location & | dst | |||
| ) |
Set the attack direction indicator.
Definition at line 1008 of file game_display.cpp.
References attack_indicator_dst_, attack_indicator_src_, and display::invalidate().
Referenced by clear_attack_indicator(), and events::mouse_handler::mouse_motion().


| void game_display::set_game_mode | ( | const tgame_mode | game_mode | ) |
Definition at line 550 of file game_display.cpp.
References game_mode_, and display::invalidate_all().

| void game_display::set_playing_team | ( | size_t | team | ) |
Definition at line 1314 of file game_display.cpp.
References activeTeam_, assert, display::invalidate_game_status(), and teams_.

| 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 NULL, no route is displayed. route does not have to remain valid after being set.
Definition at line 798 of file game_display.cpp.
References invalidate_route(), pathfind::marked_route::marks, route_, and pathfind::marked_route::steps.
Referenced by events::menu_handler::execute_gotos(), events::mouse_handler::left_click(), events::mouse_handler::mouse_motion(), events::mouse_handler::move_unit_along_current_route(), events::menu_handler::move_unit_to_loc(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), and events::mouse_handler::set_current_paths().


| void game_display::set_team | ( | size_t | team, | |
| bool | observe = false | |||
| ) |
Sets the team controlled by the player using the computer.
Data from this team will be displayed in the game status. set_playing_team sets the team whose turn it currently is
Definition at line 1295 of file game_display.cpp.
References assert, currentTeam_, display::labels(), wb::manager::on_viewer_change(), map_labels::recalculate_labels(), map_labels::set_team(), teams_, display::viewpoint_, and resources::whiteboard.
Referenced by turn_info::process_network_data().


| bool game_display::show_everything | ( | ) | const [inline] |
Definition at line 284 of file game_display.hpp.
References display::viewpoint_.
| bool game_display::team_valid | ( | ) | const [inline] |
Definition at line 300 of file game_display.hpp.
References currentTeam_, and teams_.
Referenced by events::menu_handler::clear_labels(), current_team_name(), draw_report(), and unit::redraw_unit().

| void game_display::unhighlight_reach | ( | ) |
Reset highlighting of paths.
Definition at line 743 of file game_display.cpp.
References reach_map_, and reach_map_changed_.
Referenced by events::mouse_handler::attack_enemy_(), highlight_reach(), events::mouse_handler::left_click(), events::mouse_handler::mouse_motion(), events::mouse_handler::move_unit_along_route(), events::mouse_handler::save_whiteboard_attack(), events::mouse_handler::select_hex(), events::mouse_handler::set_current_paths(), and events::menu_handler::show_enemy_moves().

| int game_display::viewing_side | ( | ) | const [inline] |
Definition at line 294 of file game_display.hpp.
References currentTeam_.
Referenced by wb::move::calculate_move_cost(), events::mouse_handler::current_unit_attacks_from(), play_controller::in_context_menu(), events::menu_handler::label_terrain(), events::mouse_handler::move_unit_along_route(), playsingle_controller::recall(), playsingle_controller::recruit(), events::menu_handler::rename_unit(), playsingle_controller::repeat_recruit(), REPORT_GENERATOR(), events::mouse_handler::select_hex(), events::menu_handler::send_chat_message(), and events::menu_handler::unit_list().

| size_t game_display::viewing_team | ( | ) | const [inline] |
The viewing team is the team currently viewing the game.
Definition at line 293 of file game_display.hpp.
References currentTeam_.
Referenced by attack_info(), calculate_healing(), events::menu_handler::current_unit(), events::mouse_handler::current_unit_attacks_from(), display_unit_hex(), events::menu_handler::do_search(), draw_hex(), events::menu_handler::has_friends(), highlight_hex(), pathfind::mark_route(), unit::redraw_unit(), REPORT_GENERATOR(), events::menu_handler::scenario_settings_table(), events::menu_handler::send_chat_message(), events::menu_handler::show_enemy_moves(), events::menu_handler::status_table(), time_of_day_at(), and events::mouse_handler::viewing_team().

friend class game_display::fake_unit [friend] |
Definition at line 195 of file game_display.hpp.
size_t game_display::activeTeam_ [private] |
Definition at line 391 of file game_display.hpp.
Referenced by playing_side(), playing_team(), and set_playing_team().
Definition at line 354 of file game_display.hpp.
Referenced by attack_indicator_direction(), draw_hex(), and set_attack_indicator().
Definition at line 353 of file game_display.hpp.
Referenced by attack_indicator_direction(), draw_hex(), and set_attack_indicator().
std::vector<chat_message> game_display::chat_messages_ [private] |
Definition at line 411 of file game_display.hpp.
Referenced by add_chat_message(), and prune_chat_messages().
size_t game_display::currentTeam_ [private] |
Definition at line 391 of file game_display.hpp.
Referenced by current_team_name(), draw_minimap_units(), draw_movement_info(), get_flag(), invalidate_animations_location(), set_team(), team_valid(), viewing_side(), and viewing_team().
std::map< map_location, fixed_t > game_display::debugHighlights_ [static, private] |
Definition at line 423 of file game_display.hpp.
Referenced by clear_debug_highlights(), debug_highlight(), and draw_hex().
map_location game_display::displayedUnitHex_ [private] |
Definition at line 374 of file game_display.hpp.
Referenced by display_unit_hex(), displayed_unit_hex(), highlight_hex(), and invalidate_unit_after_move().
std::map<surface,SDL_Rect> game_display::energy_bar_rects_ [private] |
Definition at line 362 of file game_display.hpp.
Referenced by calculate_energy_bar().
map of hexes where only one unit should be drawn, the one identified by the associated id string
Definition at line 350 of file game_display.hpp.
Referenced by add_exclusive_draw(), clear_exclusive_draws(), draw_invalidated(), and remove_exclusive_draw().
std::deque<unit*> game_display::fake_units_ [private] |
collection of units destined to be drawn but not put into the unit map
Definition at line 346 of file game_display.hpp.
Referenced by draw_invalidated(), invalidate_animations(), place_temporary_unit(), and remove_temporary_unit().
bool game_display::first_turn_ [private] |
Definition at line 395 of file game_display.hpp.
Referenced by new_turn().
std::vector<animated<image::locator> > game_display::flags_ [private] |
Animated flags for each team.
Definition at line 426 of file game_display.hpp.
Referenced by game_display(), get_flag(), and invalidate_animations_location().
tgame_mode game_display::game_mode_ [private] |
Definition at line 420 of file game_display.hpp.
Referenced by draw_hex(), and set_game_mode().
bool game_display::in_game_ [private] |
Definition at line 395 of file game_display.hpp.
Referenced by begin_game(), and in_game().
const config& game_display::level_ [private] |
Definition at line 370 of file game_display.hpp.
std::set<std::string> game_display::observers_ [private] |
Definition at line 397 of file game_display.hpp.
Referenced by add_observer(), observers(), and remove_observer().
overlay_map game_display::overlays_ [private] |
Definition at line 389 of file game_display.hpp.
Referenced by add_overlay(), draw_hex(), parse_team_overlays(), remove_overlay(), and remove_single_overlay().
reach_map game_display::reach_map_ [private] |
Definition at line 415 of file game_display.hpp.
Referenced by draw_hex(), draw_movement_info(), highlight_another_reach(), process_reachmap_changes(), and unhighlight_reach().
bool game_display::reach_map_changed_ [private] |
Definition at line 417 of file game_display.hpp.
Referenced by highlight_another_reach(), process_reachmap_changes(), and unhighlight_reach().
reach_map game_display::reach_map_old_ [private] |
Definition at line 416 of file game_display.hpp.
Referenced by process_reachmap_changes().
pathfind::marked_route game_display::route_ [private] |
Definition at line 364 of file game_display.hpp.
Referenced by draw_movement_info(), footsteps_images(), invalidate_route(), and set_route().
double game_display::sidebarScaling_ [private] |
Definition at line 393 of file game_display.hpp.
game_display * game_display::singleton_ = NULL [static, private] |
Definition at line 428 of file game_display.hpp.
Referenced by game_display(), get_singleton(), and ~game_display().
const std::vector<team>& game_display::teams_ [private] |
Definition at line 368 of file game_display.hpp.
Referenced by current_team_name(), display_unit_hex(), draw_hex(), draw_minimap_units(), draw_sidebar(), game_display(), get_flag(), get_teams(), highlight_hex(), invalidate_animations_location(), parse_team_overlays(), set_playing_team(), set_team(), and team_valid().
const tod_manager& game_display::tod_manager_ [private] |
Definition at line 366 of file game_display.hpp.
Referenced by get_time_of_day(), has_time_area(), and new_turn().
unit_map& game_display::units_ [private] |
Definition at line 343 of file game_display.hpp.
Referenced by draw_invalidated(), draw_minimap_units(), draw_movement_info(), footsteps_images(), get_const_units(), get_units(), highlight_hex(), invalidate_animations(), and scroll_to_leader().
| Generated by doxygen 1.7.1 on Thu Feb 9 2012 01:06:35 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |