53 std::map<freeciv::map_updates_handler::update_type, QRectF>
update_rects();
56 int map_dx,
int map_dy);
58 int map_x,
int map_y);
64 float *gui_dy,
float gui_x0,
float gui_y0,
65 float gui_x1,
float gui_y1);
68 float *ymax,
int *xsize,
int *ysize);
77 void put_unit(
const struct unit *punit, QPixmap *pcanvas,
78 const QPoint &canvas_loc);
80 const QPoint &canvas_loc);
83 int canvas_x,
int canvas_y,
84 const int *upkeep_cost,
int happy_cost);
91 const std::vector<drawn_sprite> &sprites,
bool fog,
92 bool city_unit =
false);
100 int width_base,
int height_base);
107 struct unit *punit1,
int hp1);
113 struct unit **punit);
118 size_t name_buffer_len,
120 size_t growth_buffer_len,
121 enum color_std *growth_color,
122 enum color_std *production_color);
124 char *trade_routes_buffer,
125 size_t trade_routes_buffer_len,
126 enum color_std *trade_routes_color);
bool can_do_cached_drawing
void link_mark_restore(enum text_link_type type, int id)
Add a visible link for 1 turn.
void get_city_mapview_trade_routes(const city *pcity, char *trade_routes_buffer, size_t trade_routes_buffer_len, enum color_std *trade_routes_color)
Find the mapview city trade routes text for the given city, and place it into the buffer.
void put_nuke_mushroom_pixmaps(struct tile *ptile)
Animate the nuke explosion at map(x, y).
bool tile_visible_mapcanvas(struct tile *ptile)
Return TRUE iff the given map position has a tile visible on the map canvas.
void link_marks_draw_all()
Draw all link marks.
void mapdeco_init()
Called when we receive map dimensions.
void set_mapview_origin(float gui_x0, float gui_y0)
Change the mapview origin, clip it, and update everything.
void update_tile_label(struct tile *ptile)
void map_to_gui_vector(const struct tileset *t, float *gui_dx, float *gui_dy, int map_dx, int map_dy)
Translate from a cartesian system to the GUI system.
struct tile * canvas_pos_to_tile(float canvas_x, float canvas_y)
Finds the tile corresponding to pixel coordinates.
void mapdeco_set_crosshair(const struct tile *ptile, bool crosshair)
Marks the given tile as having a "crosshair" map decoration.
void draw_segment(const tile *ptile, enum direction8 dir, bool safe)
Draw a goto line at the given location and direction.
void init_mapcanvas_and_overview()
Sets up data for the mapview and overview.
void get_city_mapview_production(const city *pcity, char *buf, size_t buf_len)
Find the mapview city production text for the given city, and place it into the buffer.
void get_mapview_scroll_pos(int *scroll_x, int *scroll_y)
Find the current scroll position (origin) of the mapview.
void mapdeco_clear_crosshairs()
Clears all previous set tile crosshair decorations.
bool mapdeco_is_highlight_set(const struct tile *ptile)
Return TRUE if the given tile is highlighted.
void get_mapview_scroll_window(float *xmin, float *ymin, float *xmax, float *ymax, int *xsize, int *ysize)
Return the scroll dimensions of the clipping window for the mapview window.
void move_unit_map_canvas(struct unit *punit, struct tile *ptile, int dx, int dy)
Animates punit's "smooth" move from (x0, y0) to (x0+dx, y0+dy).
bool mapdeco_is_gotoline_set(const struct tile *ptile, enum direction8 dir, bool *safe)
Returns TRUE if a goto line should be drawn from the given tile in the given direction.
struct tile * get_center_tile_mapcanvas()
Finds the current center tile of the mapcanvas.
struct city * find_city_or_settler_near_tile(const struct tile *ptile, struct unit **punit)
Find the "best" city/settlers to associate with the selected tile.
void get_city_mapview_name_and_growth(const city *pcity, char *name_buffer, size_t name_buffer_len, char *growth_buffer, size_t growth_buffer_len, enum color_std *growth_color, enum color_std *production_color)
Fill the two buffers which information about the city which is shown below it.
void refresh_tile_mapcanvas(const tile *ptile, bool full_refresh)
Refreshes a single tile on the map canvas.
void mapdeco_set_gotoroute(const struct unit *punit)
Set the map decorations for the given unit's goto route.
void show_city_descriptions(int canvas_base_x, int canvas_base_y, int width_base, int height_base)
Show descriptions for all cities visible on the map canvas.
void mapdeco_add_gotoline(const struct tile *ptile, enum direction8 dir, bool safe)
Add a goto line from the given tile 'ptile' in the direction 'dir'.
void map_canvas_resized(int width, int height)
Called if the map in the GUI is resized.
void free_mapcanvas_and_overview()
Frees resources allocated for mapview and overview.
void put_drawn_sprites(QPixmap *pcanvas, const QPoint &canvas_loc, const std::vector< drawn_sprite > &sprites, bool fog, bool city_unit=false)
Draw an array of drawn sprites onto the canvas.
void mapdeco_free()
Free all memory used for map decorations.
void put_terrain(struct tile *ptile, QPixmap *pcanvas, const QPoint &canvas_loc)
Draw the given tile terrain onto the canvas store at the given location.
void link_marks_free()
Free the link marks.
void toggle_city_color(struct city *pcity)
Toggle the city color.
void update_map_canvas(int canvas_x, int canvas_y, int width, int height)
Update (refresh) the map canvas starting at the given tile (in map coordinates) and with the given di...
void link_marks_clear_all()
Clear all visible links.
void animate_unit_explosion(const tile *location)
Draws an explosion animation on the given sprite.
void refresh_city_mapcanvas(struct city *pcity, struct tile *ptile, bool full_refresh)
Refreshes a single city on the map canvas.
void update_city_description(struct city *pcity)
Update the city description for the given city.
void put_unit_city_overlays(const unit *punit, QPixmap *pcanvas, int canvas_x, int canvas_y, const int *upkeep_cost, int happy_cost)
Draw food, gold, and shield upkeep values on the unit.
void map_to_gui_pos(const struct tileset *t, float *gui_x, float *gui_y, int map_x, int map_y)
Translate from map to gui coordinate systems.
void gui_distance_vector(const struct tileset *t, float *gui_dx, float *gui_dy, float gui_x0, float gui_y0, float gui_x1, float gui_y1)
Find the vector with minimum "real" distance between two GUI positions.
void toggle_unit_color(struct unit *punit)
Toggle the unit color.
void refresh_unit_mapcanvas(struct unit *punit, struct tile *ptile, bool full_refresh)
Refreshes a single unit on the map canvas.
void link_mark_add_new(enum text_link_type type, int id)
Add a visible link for 2 turns.
void link_marks_decrease_turn_counters()
Clear all visible links.
bool tile_to_canvas_pos(float *canvas_x, float *canvas_y, const tile *ptile)
Finds the canvas coordinates for a map position.
void link_marks_init()
Initialize the link marks.
void decrease_unit_hp_smooth(struct unit *punit0, int hp0, struct unit *punit1, int hp1)
This function is called to decrease a unit's HP smoothly in battle when combat_animation is turned on...
void mapdeco_clear_gotoroutes()
Clear all goto line map decorations and queues mapview updates for the affected tiles.
bool tile_visible_and_not_on_border_mapcanvas(struct tile *ptile)
Return TRUE iff the given map position has a tile visible within the interior of the map canvas.
enum topo_comp_lvl tileset_map_topo_compatible(int topology_id, struct tileset *tset)
Are the topology and tileset compatible?
bool mapdeco_is_crosshair_set(const struct tile *ptile)
Returns TRUE if there is a "crosshair" decoration set at the given tile.
void show_tile_labels(int canvas_base_x, int canvas_base_y, int width_base, int height_base)
Show labels for all tiles visible on the map canvas.
void update_map_canvas_visible()
Schedules an update of (only) the visible part of the map at the next unqueue_mapview_update().
struct tile * canvas_pos_to_nearest_tile(float canvas_x, float canvas_y)
Finds the tile corresponding to pixel coordinates.
std::map< freeciv::map_updates_handler::update_type, QRectF > update_rects()
Calculates the area covered by each update type.
void put_unit(const struct unit *punit, QPixmap *pcanvas, const QPoint &canvas_loc)
Draw the given unit onto the canvas store at the given location.
void unqueue_mapview_updates()
See comment in update_map_canvas_visible().