Freeciv-3.1
|
#include <SDL2/SDL.h>
#include "astring.h"
#include "bugs.h"
#include "fcintl.h"
#include "log.h"
#include "calendar.h"
#include "game.h"
#include "goto.h"
#include "government.h"
#include "movement.h"
#include "research.h"
#include "unitlist.h"
#include "citydlg_common.h"
#include "client_main.h"
#include "climisc.h"
#include "overview_common.h"
#include "pages_g.h"
#include "text.h"
#include "colors.h"
#include "dialogs.h"
#include "graphics.h"
#include "gui_id.h"
#include "gui_main.h"
#include "gui_mouse.h"
#include "gui_tilespec.h"
#include "mapctrl.h"
#include "sprite.h"
#include "themespec.h"
#include "widget.h"
#include "mapview.h"
Go to the source code of this file.
Variables | |
SDL_Rect * | info_area |
int | overview_start_x = 0 |
int | overview_start_y = 0 |
static struct canvas * | overview_canvas |
static struct canvas * | city_map_canvas = NULL |
static struct canvas * | terrain_canvas |
static bool | is_flush_queued = FALSE |
void city_map_canvas_free | ( | void | ) |
Free memory allocated for the city map canvas
Definition at line 1190 of file mapview.c.
Referenced by create_city_map(), and ui_main().
SDL_Surface * create_city_map | ( | struct city * | pcity | ) |
Create new city map surface.
Definition at line 1201 of file mapview.c.
Referenced by get_scaled_city_map().
void dirty_all | ( | void | ) |
void dirty_rect | ( | int | canvas_x, |
int | canvas_y, | ||
int | pixel_width, | ||
int | pixel_height | ||
) |
void dirty_sdl_rect | ( | SDL_Rect * | Rect | ) |
Save Flush rect used by "end" flush.
Definition at line 181 of file mapview.c.
Referenced by arrange_widgets(), dirty_rect(), flush_rect(), option_dialog_worklist(), refresh_production_label(), refresh_worklist_count_label(), update_info_label(), widget_core_mark_dirty(), and widget_pressed_action().
void draw_selection_rectangle | ( | int | canvas_x, |
int | canvas_y, | ||
int | w, | ||
int | h | ||
) |
void flush_all | ( | void | ) |
flush entire screen.
Definition at line 201 of file mapview.c.
Referenced by arrange_widgets(), notify_goto_dialog_update(), popup_join_game_dialog(), popup_new_user_passwd_dialog(), popup_user_passwd_dialog(), real_resize_window_callback(), redraw_unit_info_label(), and show_main_page().
void flush_dirty | ( | void | ) |
|
static |
Flush the mapcanvas part of the buffer(s) to the screen.
Definition at line 92 of file mapview.c.
Referenced by flush_dirty(), and flush_rect().
void flush_rect | ( | SDL_Rect * | rect, |
bool | force_flush | ||
) |
Flush the given part of the buffer(s) to the screen.
Definition at line 103 of file mapview.c.
Referenced by draw_mouse_cursor(), unselect_widget_action(), and widget_core_flush().
|
static |
User interacted with the focus units widget.
Definition at line 504 of file mapview.c.
Referenced by redraw_unit_info_label().
void get_overview_area_dimensions | ( | int * | width, |
int * | height | ||
) |
struct canvas * get_overview_window | ( | void | ) |
SDL_Surface * get_terrain_surface | ( | struct tile * | ptile | ) |
Return surface containing terrain of the tile.
Definition at line 1217 of file mapview.c.
Referenced by popup_terrain_info_dialog().
void gui_flush | ( | void | ) |
|
static |
Is the focus animation enabled?
Definition at line 979 of file mapview.c.
Referenced by update_unit_info_label().
void map_canvas_size_refresh | ( | void | ) |
void overview_size_changed | ( | void | ) |
Called when the map size changes. This may be used to change the size of the GUI element holding the overview canvas. The overview.width and overview.height are updated if this function is called.
void put_cross_overlay_tile | ( | struct tile * | ptile | ) |
void queue_flush | ( | void | ) |
Called when a region is marked dirty, this function queues a flush event to be handled later by SDL. The flush may end up being done by freeciv before then, in which case it will be a wasted call.
Definition at line 152 of file mapview.c.
Referenced by dirty_all(), dirty_sdl_rect(), exit_meta_server_dlg_callback(), options_callback(), popdown_diplomat_dialog(), popup_connection_dialog(), popup_join_game_dialog(), popup_new_user_passwd_dialog(), popup_user_passwd_dialog(), and update_info_label().
void real_focus_units_changed | ( | void | ) |
Called when the set of units in focus (get_units_in_focus()) changes. Standard updates like update_unit_info_label() are handled in the platform- independent code, so some clients will not need to do anything here.
void redraw_unit_info_label | ( | struct unit_list * | punitlist | ) |
Read Function Name :) FIXME: should use same method as client/text.c popup_info_text()
Definition at line 522 of file mapview.c.
Referenced by set_turn_done_button_state(), toggle_unit_info_window_callback(), and update_unit_info_label().
void refresh_overview | ( | void | ) |
Refresh (update) the viewrect on the overview. This is the rectangle showing the area covered by the mapview.
Definition at line 1124 of file mapview.c.
Referenced by flush_dirty(), gui_flush(), real_set_client_page(), resize_minimap(), and toggle_map_window_callback().
void set_unit_icon | ( | int | idx, |
struct unit * | punit | ||
) |
void set_unit_icons_more_arrow | ( | bool | onoff | ) |
void tileset_changed | ( | void | ) |
void unqueue_flush | ( | void | ) |
A callback invoked as a result of a FLUSH event, this function simply flushes the mapview canvas.
Definition at line 140 of file mapview.c.
Referenced by gui_event_loop().
void update_city_descriptions | ( | void | ) |
void update_info_label | ( | void | ) |
void update_map_canvas_scrollbars | ( | void | ) |
void update_map_canvas_scrollbars_size | ( | void | ) |
void update_overview_scroll_window_pos | ( | int | x, |
int | y | ||
) |
void update_timeout_label | ( | void | ) |
void update_turn_done_button | ( | bool | do_restore | ) |
void update_unit_info_label | ( | struct unit_list * | punitlist | ) |
Update the information label which gives info on the current unit and the square under the current unit, for specified unit. Note that in practice punit is always the focus unit.
Clears label if punitlist is NULL or empty.
Typically also updates the cursor for the map_canvas (this is related because the info label may includes "select destination" prompt etc). And it may call update_unit_pix_label() to update the icons for units on this square.
|
static |
|
extern |
Definition at line 49 of file widget.c.
Referenced by flush_dirty(), redraw_widget_info_label(), unselect_widget_action(), and widget_pressed_action().
Definition at line 87 of file mapview.c.
Referenced by flush_all(), flush_rect(), queue_flush(), and unqueue_flush().
int overview_start_x = 0 |
Definition at line 73 of file mapview.c.
Referenced by minimap_window_callback(), refresh_overview(), and resize_minimap().
int overview_start_y = 0 |
Definition at line 74 of file mapview.c.
Referenced by minimap_window_callback(), refresh_overview(), and resize_minimap().
|
static |
Definition at line 78 of file mapview.c.
Referenced by get_terrain_surface(), help_dialog::make_tree(), and help_widget::set_topic_terrain().