Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends

game_display Class Reference

#include <game_display.hpp>

Inheritance diagram for game_display:
Inheritance graph
[legend]
Collaboration diagram for game_display:
Collaboration graph
[legend]

List of all members.

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< surfacefootsteps_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_dayget_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_mapget_units ()
const unit_mapget_const_units () const
const map_locationdisplayed_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_displaycreate_dummy_display (CVideo &video)
static game_displayget_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_mapunits_
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_managertod_manager_
const std::vector< team > & teams_
const configlevel_
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_messagechat_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_displaysingleton_ = NULL

Friends

class game_display::fake_unit

Detailed Description

Definition at line 38 of file game_display.hpp.


Member Typedef Documentation

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.


Member Enumeration Documentation

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.

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

no linger overlay, show fog and shroud.

LINGER_SP 

linger overlay, show fog and shroud.

LINGER_MP 

Definition at line 327 of file game_display.hpp.


Constructor & Destructor Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

game_display::~game_display (  ) 

Definition at line 150 of file game_display.cpp.

References prune_chat_messages(), and singleton_.

Here is the call graph for this function:

game_display::game_display ( const game_display  )  [private]

Member Function Documentation

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 
)
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.

Parameters:
loc The location of the unit requesting exclusivity.
unit The unit requesting exlusivity.
Returns:
false if there's already an exclusive draw request for this location.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void game_display::begin_game (  ) 

Definition at line 1321 of file game_display.cpp.

References display::create_buttons(), in_game_, and display::invalidate_all().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void game_display::clear_attack_indicator (  ) 
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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 
)
void game_display::draw_hex ( const map_location loc  )  [protected, virtual]
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().

Here is the call graph for this function:

void game_display::draw_minimap_units (  )  [protected, virtual]
void game_display::draw_movement_info ( const map_location loc  ) 
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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_.

Here is the call graph for this function:

void game_display::float_label ( const map_location loc,
const std::string &  text,
int  red,
int  green,
int  blue 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static game_display* game_display::get_singleton (  )  [inline, static]
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().

Here is the caller graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool game_display::in_game (  )  const [inline, virtual]

Reimplemented from display.

Definition at line 313 of file game_display.hpp.

References in_game_.

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_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void game_display::invalidate_unit (  )  [inline]
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void game_display::new_turn (  ) 
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().

Here is the caller graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

void game_display::pre_draw (  )  [protected, virtual]

game_display pre_draw does specific things related e.g.

to unit rendering

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

Reimplemented from display.

Definition at line 276 of file game_display.cpp.

References process_reachmap_changes(), and prune_chat_messages().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void game_display::prune_chat_messages ( bool  remove_all = false  )  [private]
std::string game_display::remove_exclusive_draw ( const map_location loc  ) 

Cancels an exclusive draw request.

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

Definition at line 996 of file game_display.cpp.

References exclusive_unit_draw_requests_, and map_location::valid().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this 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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void game_display::unhighlight_reach (  ) 
int game_display::viewing_side (  )  const [inline]
size_t game_display::viewing_team (  )  const [inline]

Friends And Related Function Documentation

friend class game_display::fake_unit [friend]

Definition at line 195 of file game_display.hpp.


Member Data Documentation

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().

Definition at line 411 of file game_display.hpp.

Referenced by add_chat_message(), and prune_chat_messages().

size_t game_display::currentTeam_ [private]
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().

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().

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().

Definition at line 416 of file game_display.hpp.

Referenced by process_reachmap_changes().

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 366 of file game_display.hpp.

Referenced by get_time_of_day(), has_time_area(), and new_turn().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu Feb 9 2012 01:06:35 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs