#include <SDL3/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.
|
void | update_map_canvas_scrollbars_size (void) |
|
static void | flush_mapcanvas (int canvas_x, int canvas_y, int pixel_width, int pixel_height) |
|
void | flush_rect (SDL_Rect *rect, bool force_flush) |
|
void | unqueue_flush (void) |
|
void | queue_flush (void) |
|
void | dirty_rect (int canvas_x, int canvas_y, int pixel_width, int pixel_height) |
|
void | dirty_sdl_rect (SDL_Rect *Rect) |
|
void | dirty_all (void) |
|
void | flush_all (void) |
|
void | flush_dirty (void) |
|
void | gui_flush (void) |
|
void | set_indicator_icons (struct sprite *bulb, struct sprite *sol, struct sprite *flake, struct sprite *gov) |
|
void | overview_size_changed (void) |
|
void | update_info_label (void) |
|
static int | focus_units_info_callback (struct widget *pwidget) |
|
void | redraw_unit_info_label (struct unit_list *punitlist) |
|
static bool | is_focus_anim_enabled (void) |
|
void | set_unit_icon (int idx, struct unit *punit) |
|
void | set_unit_icons_more_arrow (bool onoff) |
|
void | real_focus_units_changed (void) |
|
void | update_unit_info_label (struct unit_list *punitlist) |
|
void | update_timeout_label (void) |
|
void | update_turn_done_button (bool do_restore) |
|
void | update_city_descriptions (void) |
|
struct canvas * | get_overview_window (void) |
|
void | get_overview_area_dimensions (int *width, int *height) |
|
void | refresh_overview (void) |
|
void | update_map_canvas_scrollbars (void) |
|
void | put_cross_overlay_tile (struct tile *ptile) |
|
void | draw_selection_rectangle (int canvas_x, int canvas_y, int w, int h) |
|
void | tileset_changed (void) |
|
void | city_map_canvas_free (void) |
|
SDL_Surface * | create_city_map (struct city *pcity) |
|
SDL_Surface * | get_terrain_surface (struct tile *ptile) |
|
void | update_overview_scroll_window_pos (int x, int y) |
|
void | start_turn (void) |
|
void | map_canvas_size_refresh (void) |
|
◆ city_map_canvas_free()
Free memory allocated for the city map canvas
Definition at line 1186 of file mapview.c.
◆ create_city_map()
Create new city map surface.
Definition at line 1197 of file mapview.c.
◆ dirty_all()
Select entire screen area to "end" flush and block "save" new areas.
Definition at line 188 of file mapview.c.
◆ dirty_rect()
void dirty_rect |
( |
int |
canvas_x, |
|
|
int |
canvas_y, |
|
|
int |
pixel_width, |
|
|
int |
pixel_height |
|
) |
| |
Save Flush area used by "end" flush.
Definition at line 166 of file mapview.c.
◆ dirty_sdl_rect()
Save Flush rect used by "end" flush.
Definition at line 177 of file mapview.c.
◆ draw_selection_rectangle()
◆ flush_all()
flush entire screen.
Definition at line 197 of file mapview.c.
◆ flush_dirty()
Make "end" Flush "saved" parts/areas of the buffer(s) to the screen. Function is called in handle_procesing_finished and handle_thaw_hint
Definition at line 208 of file mapview.c.
◆ flush_mapcanvas()
Flush the mapcanvas part of the buffer(s) to the screen.
Definition at line 88 of file mapview.c.
◆ flush_rect()
Flush the given part of the buffer(s) to the screen.
Definition at line 99 of file mapview.c.
◆ focus_units_info_callback()
User interacted with the focus units widget.
Definition at line 500 of file mapview.c.
◆ get_overview_area_dimensions()
void get_overview_area_dimensions |
( |
int * |
width, |
|
|
int * |
height |
|
) |
| |
Return the dimensions of the area (container widget; maximum size) for the overview.
Definition at line 1088 of file mapview.c.
◆ get_overview_window()
Return a canvas that is the overview window.
Definition at line 1079 of file mapview.c.
◆ get_terrain_surface()
Return surface containing terrain of the tile.
Definition at line 1213 of file mapview.c.
◆ gui_flush()
This function is called when the map has changed.
Definition at line 283 of file mapview.c.
◆ is_focus_anim_enabled()
Is the focus animation enabled?
Definition at line 975 of file mapview.c.
◆ map_canvas_size_refresh()
Refresh map canvas size information
Definition at line 1246 of file mapview.c.
◆ overview_size_changed()
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.
Definition at line 379 of file mapview.c.
◆ put_cross_overlay_tile()
Draw a cross-hair overlay on a tile.
Definition at line 1152 of file mapview.c.
◆ queue_flush()
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 148 of file mapview.c.
◆ real_focus_units_changed()
◆ redraw_unit_info_label()
void redraw_unit_info_label |
( |
struct unit_list * |
punitlist | ) |
|
◆ refresh_overview()
Refresh (update) the viewrect on the overview. This is the rectangle showing the area covered by the mapview.
Definition at line 1120 of file mapview.c.
◆ set_indicator_icons()
Set information for the indicator icons typically shown in the main client window. The parameters tell which sprite to use for the indicator.
Definition at line 297 of file mapview.c.
◆ set_unit_icon()
Set one of the unit icons in the information area based on punit. NULL will be passed to clear the icon. idx == -1 will be passed to indicate this is the active unit, or idx in [0..num_units_below - 1] for secondary (inactive) units on the same tile.
Definition at line 986 of file mapview.c.
◆ set_unit_icons_more_arrow()
void set_unit_icons_more_arrow |
( |
bool |
onoff | ) |
|
Most clients use an arrow (e.g., sprites.right_arrow) to indicate when the units_below will not fit. This function is called to activate and deactivate the arrow.
Definition at line 997 of file mapview.c.
◆ start_turn()
◆ tileset_changed()
This function is called when the tileset is changed.
Definition at line 1171 of file mapview.c.
◆ unqueue_flush()
A callback invoked as a result of a FLUSH event, this function simply flushes the mapview canvas.
Definition at line 136 of file mapview.c.
◆ update_city_descriptions()
Update (refresh) all of the city descriptions on the mapview.
Definition at line 1065 of file mapview.c.
◆ update_info_label()
Typically an info box is provided to tell the player about the state of their civilization. This function is called when the label is changed.
Definition at line 397 of file mapview.c.
◆ update_map_canvas_scrollbars()
void update_map_canvas_scrollbars |
( |
void |
| ) |
|
Update (refresh) the locations of the mapview scrollbars (if it uses them).
Definition at line 1144 of file mapview.c.
◆ update_map_canvas_scrollbars_size()
void update_map_canvas_scrollbars_size |
( |
void |
| ) |
|
Refresh map canvas scrollbar as canvas size changes
Update the size of the sliders on the scrollbars.
Definition at line 78 of file mapview.c.
◆ update_overview_scroll_window_pos()
void update_overview_scroll_window_pos |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Sets the position of the overview scroll window based on mapview position.
Definition at line 1232 of file mapview.c.
◆ update_timeout_label()
Refresh timeout label.
Definition at line 1045 of file mapview.c.
◆ update_turn_done_button()
void update_turn_done_button |
( |
bool |
do_restore | ) |
|
Refresh turn done button.
Definition at line 1053 of file mapview.c.
◆ update_unit_info_label()
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.
Definition at line 1024 of file mapview.c.
◆ city_map_canvas
◆ info_area
◆ is_flush_queued
◆ overview_canvas
◆ overview_start_x
◆ overview_start_y
◆ terrain_canvas