Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/overview_common.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
overview_common.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <math.h> /* floor */
19
20/* utility */
21#include "log.h"
22
23/* client */
24#include "client_main.h" /* can_client_change_view() */
25#include "climap.h"
26#include "control.h"
27#include "mapview_g.h"
28#include "options.h"
29#include "zoom.h"
30
31#include "overview_common.h"
32
33 int OVERVIEW_TILE_SIZE = 2;
34#if 0
35struct overview overview = {
36 /* These are the default values. All others are zeroed automatically. */
37 .fog = TRUE,
38 .layers = {[OLAYER_BACKGROUND] = TRUE,
39 [OLAYER_UNITS] = TRUE,
40 [OLAYER_CITIES] = TRUE,
41 [OLAYER_BORDERS_ON_OCEAN] = TRUE}
42};
43#endif
44
45/*
46 * Set to TRUE if the backing store is more recent than the version
47 * drawn into overview.window.
48 */
49 static bool overview_dirty = FALSE;
50
51/************************************************************************/
56 static void gui_to_natural_pos(const struct tileset *t,
57 double *ntl_x, double *ntl_y,
58 int gui_x, int gui_y)
59{
60 const double gui_xd = gui_x, gui_yd = gui_y;
61 const double W = tileset_tile_width(t) * map_zoom;
62 const double H = tileset_tile_height(t) * map_zoom;
63 double map_x, map_y;
64
65 /* First convert to map positions. This ignores hex conversions; we're
66 * not looking for an exact tile. */
67 if (tileset_is_isometric(t)) {
68 /* Includes hex cases. */
69 map_x = (gui_xd * H + gui_yd * W) / (W * H);
70 map_y = (gui_yd * W - gui_xd * H) / (W * H);
71 } else {
72 map_x = gui_xd / W;
73 map_y = gui_yd / H;
74 }
75
76 /* Now convert to natural positions. Note this assumes the macro form
77 * of the conversion will work with floating-point values. */
78 MAP_TO_NATURAL_POS(ntl_x, ntl_y, map_x, map_y);
79
80}
81
82/************************************************************************/
85 static void gui_to_overview_pos(const struct tileset *t,
86 int *ovr_x, int *ovr_y,
87 int gui_x, int gui_y)
88{
89 double ntl_x, ntl_y;
90
91 gui_to_natural_pos(t, &ntl_x, &ntl_y, gui_x, gui_y);
92
93 /* Now convert straight to overview coordinates. */
94 *ovr_x = floor((ntl_x - (double)gui_options.overview.map_x0) * OVERVIEW_TILE_SIZE);
95 *ovr_y = floor((ntl_y - (double)gui_options.overview.map_y0) * OVERVIEW_TILE_SIZE);
96
97 /* Now do additional adjustments. See map_to_overview_pos(). */
98 if (current_wrap_has_flag(WRAP_X)) {
99 *ovr_x = FC_WRAP(*ovr_x, NATURAL_WIDTH * OVERVIEW_TILE_SIZE);
100 } else {
101 if (MAP_IS_ISOMETRIC) {
102 /* HACK: For iso-maps that don't wrap in the X direction we clip
103 * a half-tile off of the left and right of the overview. This
104 * means some tiles only are halfway shown. However it means we
105 * don't show any unreal tiles, which we'd otherwise be doing. The
106 * rest of the code can't handle unreal tiles in the overview. */
107 *ovr_x -= OVERVIEW_TILE_SIZE;
108 }
109 }
110
111 if (current_wrap_has_flag(WRAP_Y)) {
112 *ovr_y = FC_WRAP(*ovr_y, NATURAL_HEIGHT * OVERVIEW_TILE_SIZE);
113 }
114}
115
116/************************************************************************/
119 static struct color *overview_tile_color(struct tile *ptile)
120{
121 if (gui_options.overview.layers[OLAYER_CITIES]) {
122 struct city *pcity = tile_city(ptile);
123
124 if (pcity) {
125 if (NULL == client.conn.playing
126 || city_owner(pcity) == client.conn.playing) {
127 return get_color(tileset, COLOR_OVERVIEW_MY_CITY);
128 } else if (pplayers_allied(city_owner(pcity), client.conn.playing)) {
129 /* Includes teams. */
130 return get_color(tileset, COLOR_OVERVIEW_ALLIED_CITY);
131 } else {
132 return get_color(tileset, COLOR_OVERVIEW_ENEMY_CITY);
133 }
134 }
135 }
136 if (gui_options.overview.layers[OLAYER_UNITS]) {
137 struct unit *punit = find_visible_unit(ptile);
138
139 if (punit) {
140 if (NULL == client.conn.playing
141 || unit_owner(punit) == client.conn.playing) {
142 return get_color(tileset, COLOR_OVERVIEW_MY_UNIT);
143 } else if (pplayers_allied(unit_owner(punit), client.conn.playing)) {
144 /* Includes teams. */
145 return get_color(tileset, COLOR_OVERVIEW_ALLIED_UNIT);
146 } else {
147 return get_color(tileset, COLOR_OVERVIEW_ENEMY_UNIT);
148 }
149 }
150 }
151 if (gui_options.overview.layers[OLAYER_BORDERS]) {
152 struct player *owner = tile_owner(ptile);
153
154 if (owner) {
155 if (gui_options.overview.layers[OLAYER_BORDERS_ON_OCEAN]) {
156 return get_player_color(tileset, owner);
157 } else if (!is_ocean_tile(ptile)) {
158 return get_player_color(tileset, owner);
159 }
160 }
161 }
162 if (gui_options.overview.layers[OLAYER_RELIEF]
163 && tile_terrain(ptile) != T_UNKNOWN) {
164 return get_terrain_color(tileset, tile_terrain(ptile));
165 }
166 if (gui_options.overview.layers[OLAYER_BACKGROUND]
167 && tile_terrain(ptile) != T_UNKNOWN) {
168 if (terrain_has_flag(tile_terrain(ptile), TER_FROZEN)) {
169 return get_color(tileset, COLOR_OVERVIEW_FROZEN);
170 } else {
171 if (is_ocean_tile(ptile)) {
172 return get_color(tileset, COLOR_OVERVIEW_OCEAN);
173 } else {
174 return get_color(tileset, COLOR_OVERVIEW_LAND);
175 }
176 }
177 }
178
179 return get_color(tileset, COLOR_OVERVIEW_UNKNOWN);
180}
181
182/************************************************************************/
186 void refresh_overview_from_canvas(void)
187{
188 struct canvas *dest = get_overview_window();
189
190 if (!dest) {
191 return;
192 }
193 canvas_copy(dest, gui_options.overview.window,
194 0, 0, 0, 0,
195 gui_options.overview.width, gui_options.overview.height);
196}
197
198/************************************************************************/
202 static void redraw_overview(void)
203{
204 int i, x[4], y[4];
205
206 if (!gui_options.overview.map) {
207 return;
208 }
209
210 {
211 struct canvas *src = gui_options.overview.map;
212 struct canvas *dst = gui_options.overview.window;
213 int x_left = gui_options.overview.map_x0 * OVERVIEW_TILE_SIZE;
214 int y_top = gui_options.overview.map_y0 * OVERVIEW_TILE_SIZE;
215 int ix = gui_options.overview.width - x_left;
216 int iy = gui_options.overview.height - y_top;
217
218 canvas_copy(dst, src, 0, 0, ix, iy, x_left, y_top);
219 canvas_copy(dst, src, 0, y_top, ix, 0, x_left, iy);
220 canvas_copy(dst, src, x_left, 0, 0, iy, ix, y_top);
221 canvas_copy(dst, src, x_left, y_top, 0, 0, ix, iy);
222 }
223
224 gui_to_overview_pos(tileset, &x[0], &y[0],
225 mapview.gui_x0, mapview.gui_y0);
226 gui_to_overview_pos(tileset, &x[1], &y[1],
227 mapview.gui_x0 + mapview.width, mapview.gui_y0);
228 gui_to_overview_pos(tileset, &x[2], &y[2],
229 mapview.gui_x0 + mapview.width,
230 mapview.gui_y0 + mapview.height);
231 gui_to_overview_pos(tileset, &x[3], &y[3],
232 mapview.gui_x0, mapview.gui_y0 + mapview.height);
233
234 for (i = 0; i < 4; i++) {
235 int src_x = x[i];
236 int src_y = y[i];
237 int dst_x = x[(i + 1) % 4];
238 int dst_y = y[(i + 1) % 4];
239
240 canvas_put_line(gui_options.overview.window,
241 get_color(tileset, COLOR_OVERVIEW_VIEWRECT),
242 LINE_NORMAL,
243 src_x, src_y, dst_x - src_x, dst_y - src_y);
244 }
245
246 refresh_overview_from_canvas();
247
248 overview_dirty = FALSE;
249}
250
251/************************************************************************/
254 static void dirty_overview(void)
255{
256 overview_dirty = TRUE;
257}
258
259/************************************************************************/
262 void flush_dirty_overview(void)
263{
264 /* Currently this function is called from mapview_common. However it
265 * should be made static eventually. */
266 if (overview_dirty) {
267 redraw_overview();
268 }
269}
270
271/************************************************************************/
274 static double wrap_double(double value, double wrap)
275{
276 while (value < 0) {
277 value += wrap;
278 }
279 while (value >= wrap) {
280 value -= wrap;
281 }
282 return value;
283}
284
285/************************************************************************/
288 void center_tile_overviewcanvas(void)
289{
290 double ntl_x, ntl_y;
291 int ox, oy;
292
293 gui_to_natural_pos(tileset, &ntl_x, &ntl_y,
294 mapview.gui_x0 + mapview.width / 2,
295 mapview.gui_y0 + mapview.height / 2);
296
297 /* NOTE: this embeds the map wrapping in the overview code. This is
298 * basically necessary for the overview to be efficiently
299 * updated. */
300 if (current_wrap_has_flag(WRAP_X)) {
301 gui_options.overview.map_x0 = wrap_double(ntl_x - (double)NATURAL_WIDTH / 2.0,
302 NATURAL_WIDTH);
303 } else {
304 gui_options.overview.map_x0 = 0;
305 }
306 if (current_wrap_has_flag(WRAP_Y)) {
307 gui_options.overview.map_y0 = wrap_double(ntl_y - (double)NATURAL_HEIGHT / 2.0,
308 NATURAL_HEIGHT);
309 } else {
310 gui_options.overview.map_y0 = 0;
311 }
312
313 redraw_overview();
314
315 gui_to_overview_pos(tileset, &ox, &oy,
316 mapview.gui_x0, mapview.gui_y0);
317 update_overview_scroll_window_pos(ox, oy);
318}
319
320/************************************************************************/
323 void map_to_overview_pos(int *overview_x, int *overview_y,
324 int map_x, int map_y)
325{
326 /* The map position may not be normal, for instance when the mapview
327 * origin is not a normal position.
328 *
329 * NOTE: this embeds the map wrapping in the overview code. */
330 do_in_natural_pos(ntl_x, ntl_y, map_x, map_y) {
331 int ovr_x = ntl_x - gui_options.overview.map_x0;
332 int ovr_y = ntl_y - gui_options.overview.map_y0;
333
334 if (current_wrap_has_flag(WRAP_X)) {
335 ovr_x = FC_WRAP(ovr_x, NATURAL_WIDTH);
336 } else {
337 if (MAP_IS_ISOMETRIC) {
338 /* HACK: For iso-maps that don't wrap in the X direction we clip
339 * a half-tile off of the left and right of the overview. This
340 * means some tiles only are halfway shown. However it means we
341 * don't show any unreal tiles, which we'd otherwise be doing. The
342 * rest of the code can't handle unreal tiles in the overview. */
343 ovr_x--;
344 }
345 }
346 if (current_wrap_has_flag(WRAP_Y)) {
347 ovr_y = FC_WRAP(ovr_y, NATURAL_HEIGHT);
348 }
349 *overview_x = OVERVIEW_TILE_SIZE * ovr_x;
350 *overview_y = OVERVIEW_TILE_SIZE * ovr_y;
351 } do_in_natural_pos_end;
352}
353
354/************************************************************************/
357 void overview_to_map_pos(int *map_x, int *map_y,
358 int overview_x, int overview_y)
359{
360 int ntl_x = overview_x / OVERVIEW_TILE_SIZE + gui_options.overview.map_x0;
361 int ntl_y = overview_y / OVERVIEW_TILE_SIZE + gui_options.overview.map_y0;
362
363 if (MAP_IS_ISOMETRIC && !current_wrap_has_flag(WRAP_X)) {
364 /* Clip half tile left and right. See comment in map_to_overview_pos. */
365 ntl_x++;
366 }
367
368 NATURAL_TO_MAP_POS(map_x, map_y, ntl_x, ntl_y);
369 /* All positions on the overview should be valid. */
370 fc_assert(normalize_map_pos(&(wld.map), map_x, map_y));
371}
372
373/************************************************************************/
376 void refresh_overview_canvas(void)
377{
378 if (!can_client_change_view()) {
379 return;
380 }
381 whole_map_iterate(&(wld.map), ptile) {
382 overview_update_tile(ptile);
383 } whole_map_iterate_end;
384 redraw_overview();
385}
386
387/************************************************************************/
393 static void put_overview_tile_area(struct canvas *pcanvas,
394 struct tile *ptile,
395 int x, int y, int w, int h)
396{
397 canvas_put_rectangle(pcanvas,
398 overview_tile_color(ptile),
399 x, y, w, h);
400 if (gui_options.overview.fog
401 && TILE_KNOWN_UNSEEN == client_tile_get_known(ptile)) {
402 canvas_put_sprite(pcanvas, x, y, get_basic_fog_sprite(tileset),
403 0, 0, w, h);
404 }
405}
406
407/************************************************************************/
410 void overview_update_tile(struct tile *ptile)
411{
412 int tile_x, tile_y;
413
414 /* Base overview positions are just like natural positions, but scaled to
415 * the overview tile dimensions. */
416 index_to_map_pos(&tile_x, &tile_y, tile_index(ptile));
417 do_in_natural_pos(ntl_x, ntl_y, tile_x, tile_y) {
418 int overview_y = ntl_y * OVERVIEW_TILE_SIZE;
419 int overview_x = ntl_x * OVERVIEW_TILE_SIZE;
420
421 if (MAP_IS_ISOMETRIC) {
422 if (current_wrap_has_flag(WRAP_X)) {
423 if (overview_x > gui_options.overview.width - OVERVIEW_TILE_WIDTH) {
424 /* This tile is shown half on the left and half on the right
425 * side of the overview. So we have to draw it in two parts. */
426 put_overview_tile_area(gui_options.overview.map, ptile,
427 overview_x - gui_options.overview.width,
428 overview_y,
429 OVERVIEW_TILE_WIDTH, OVERVIEW_TILE_HEIGHT);
430 }
431 } else {
432 /* Clip half tile left and right.
433 * See comment in map_to_overview_pos. */
434 overview_x -= OVERVIEW_TILE_SIZE;
435 }
436 }
437
438 put_overview_tile_area(gui_options.overview.map, ptile,
439 overview_x, overview_y,
440 OVERVIEW_TILE_WIDTH, OVERVIEW_TILE_HEIGHT);
441
442 dirty_overview();
443 } do_in_natural_pos_end;
444}
445
446/************************************************************************/
449 void calculate_overview_dimensions(void)
450{
451 int w, h;
452 int xfact = MAP_IS_ISOMETRIC ? 2 : 1;
453
454 static int recursion = 0; /* Just to be safe. */
455
456 /* Clip half tile left and right. See comment in map_to_overview_pos. */
457 int shift = (MAP_IS_ISOMETRIC && !current_wrap_has_flag(WRAP_X)) ? -1 : 0;
458
459 if (recursion > 0 || wld.map.xsize <= 0 || wld.map.ysize <= 0) {
460 return;
461 }
462 recursion++;
463
464 get_overview_area_dimensions(&w, &h);
465 get_overview_area_dimensions(&w, &h);
466
467 /* Set the scale of the overview map. This attempts to limit the
468 * overview to the size of the area available.
469 *
470 * It rounds up since this gives good results with the default settings.
471 * It may need tweaking if the panel resizes itself. */
472 OVERVIEW_TILE_SIZE = MIN((w - 1) / (wld.map.xsize * xfact) + 1,
473 (h - 1) / wld.map.ysize + 1);
474 OVERVIEW_TILE_SIZE = MAX(OVERVIEW_TILE_SIZE, 1);
475
476 log_debug("Map size %d,%d - area size %d,%d - scale: %d", wld.map.xsize,
477 wld.map.ysize, w, h, OVERVIEW_TILE_SIZE);
478
479 gui_options.overview.width
480 = OVERVIEW_TILE_WIDTH * wld.map.xsize + shift * OVERVIEW_TILE_SIZE;
481 gui_options.overview.height = OVERVIEW_TILE_HEIGHT * wld.map.ysize;
482
483 if (gui_options.overview.map) {
484 canvas_free(gui_options.overview.map);
485 canvas_free(gui_options.overview.window);
486 }
487 gui_options.overview.map = canvas_create(gui_options.overview.width,
488 gui_options.overview.height);
489 gui_options.overview.window = canvas_create(gui_options.overview.width,
490 gui_options.overview.height);
491 canvas_put_rectangle(gui_options.overview.map,
492 get_color(tileset, COLOR_OVERVIEW_UNKNOWN),
493 0, 0,
494 gui_options.overview.width, gui_options.overview.height);
495 update_map_canvas_scrollbars_size();
496
497 /* Call gui specific function. */
498 overview_size_changed();
499
500 if (can_client_change_view()) {
501 refresh_overview_canvas();
502 }
503
504 recursion--;
505}
506
507/************************************************************************/
510 void overview_free(void)
511{
512 if (gui_options.overview.map) {
513 canvas_free(gui_options.overview.map);
514 canvas_free(gui_options.overview.window);
515 gui_options.overview.map = NULL;
516 gui_options.overview.window = NULL;
517 }
518}
519
520/************************************************************************/
523 void overview_redraw_callback(struct option *option)
524{
525 /* This is called once for each option changed so it is slower than
526 * necessary. If this becomes a problem it could be switched to use a
527 * queue system like the mapview drawing code does. */
528 refresh_overview_canvas();
529}
canvas_put_rectangle
struct canvas int int int int struct sprite *sprite canvas_put_rectangle
Definition canvas_g.h:55
canvas_put_line
struct canvas int int int int struct sprite *sprite struct canvas struct color int int int int height canvas_put_line
Definition canvas_g.h:62
canvas_put_sprite
canvas_put_sprite
Definition canvas_g.h:42
pcanvas
struct canvas * pcanvas
Definition canvas_g.h:42
LINE_NORMAL
@ LINE_NORMAL
Definition canvas_g.h:26
city_owner
#define city_owner(_pcity_)
Definition city.h:563
client
struct civclient client
Definition client_main.c:150
can_client_change_view
bool can_client_change_view(void)
Definition client_main.c:1312
client_main.h
client_tile_get_known
enum known_type client_tile_get_known(const struct tile *ptile)
Definition climap.c:36
climap.h
get_player_color
struct color * get_player_color(const struct tileset *t, const struct player *pplayer)
Definition colors_common.c:125
get_color
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
Definition colors_common.c:100
get_terrain_color
struct color * get_terrain_color(const struct tileset *t, const struct terrain *pterrain)
Definition colors_common.c:137
incite_cost
char * incite_cost
Definition comments.c:74
find_visible_unit
struct unit * find_visible_unit(struct tile *ptile)
Definition control.c:804
control.h
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
wld
struct world wld
Definition game.c:63
canvas_free
void canvas_free(struct canvas *store)
Definition canvas.c:44
canvas_copy
void canvas_copy(struct canvas *dest, struct canvas *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
Definition canvas.c:76
canvas_create
struct canvas * canvas_create(int width, int height)
Definition canvas.c:28
owner
struct city * owner
Definition citydlg.c:220
update_map_canvas_scrollbars_size
void update_map_canvas_scrollbars_size(void)
Definition mapview.c:696
get_overview_area_dimensions
void get_overview_area_dimensions(int *width, int *height)
Definition mapview.c:317
update_overview_scroll_window_pos
void update_overview_scroll_window_pos(int x, int y)
Definition mapview.c:657
overview_size_changed
void overview_size_changed(void)
Definition mapview.c:326
get_overview_window
struct canvas * get_overview_window(void)
Definition mapview.c:337
log.h
fc_assert
#define fc_assert(condition)
Definition log.h:176
log_debug
#define log_debug(message,...)
Definition log.h:115
normalize_map_pos
bool normalize_map_pos(const struct civ_map *nmap, int *x, int *y)
Definition map.c:979
NATURAL_TO_MAP_POS
#define NATURAL_TO_MAP_POS(pmap_x, pmap_y, nat_x, nat_y)
Definition map.h:178
do_in_natural_pos
#define do_in_natural_pos(ntl_x, ntl_y, map_x, map_y)
Definition map.h:210
NATURAL_HEIGHT
#define NATURAL_HEIGHT
Definition map.h:227
MAP_IS_ISOMETRIC
#define MAP_IS_ISOMETRIC
Definition map.h:42
MAP_TO_NATURAL_POS
#define MAP_TO_NATURAL_POS(pnat_x, pnat_y, map_x, map_y)
Definition map.h:184
whole_map_iterate
#define whole_map_iterate(_map, _tile)
Definition map.h:545
current_wrap_has_flag
#define current_wrap_has_flag(flag)
Definition map.h:51
NATURAL_WIDTH
#define NATURAL_WIDTH
Definition map.h:226
do_in_natural_pos_end
#define do_in_natural_pos_end
Definition map.h:217
whole_map_iterate_end
#define whole_map_iterate_end
Definition map.h:554
index_to_map_pos
#define index_to_map_pos(pmap_x, pmap_y, mindex)
Definition map.h:233
mapview
struct view mapview
Definition mapview_common.c:75
mapview_g.h
H
#define H(x, y, z)
Definition md5.c:92
gui_options
struct client_options gui_options
Definition options.c:71
options.h
OLAYER_BORDERS
@ OLAYER_BORDERS
Definition options.h:83
OLAYER_BACKGROUND
@ OLAYER_BACKGROUND
Definition options.h:81
OLAYER_CITIES
@ OLAYER_CITIES
Definition options.h:86
OLAYER_BORDERS_ON_OCEAN
@ OLAYER_BORDERS_ON_OCEAN
Definition options.h:84
OLAYER_UNITS
@ OLAYER_UNITS
Definition options.h:85
OLAYER_RELIEF
@ OLAYER_RELIEF
Definition options.h:82
wrap_double
static double wrap_double(double value, double wrap)
Definition overview_common.c:274
gui_to_overview_pos
static void gui_to_overview_pos(const struct tileset *t, int *ovr_x, int *ovr_y, int gui_x, int gui_y)
Definition overview_common.c:85
flush_dirty_overview
void flush_dirty_overview(void)
Definition overview_common.c:262
overview_to_map_pos
void overview_to_map_pos(int *map_x, int *map_y, int overview_x, int overview_y)
Definition overview_common.c:357
gui_to_natural_pos
static void gui_to_natural_pos(const struct tileset *t, double *ntl_x, double *ntl_y, int gui_x, int gui_y)
Definition overview_common.c:56
overview_redraw_callback
void overview_redraw_callback(struct option *option)
Definition overview_common.c:523
refresh_overview_canvas
void refresh_overview_canvas(void)
Definition overview_common.c:376
overview_dirty
static bool overview_dirty
Definition overview_common.c:49
center_tile_overviewcanvas
void center_tile_overviewcanvas(void)
Definition overview_common.c:288
refresh_overview_from_canvas
void refresh_overview_from_canvas(void)
Definition overview_common.c:186
redraw_overview
static void redraw_overview(void)
Definition overview_common.c:202
overview_tile_color
static struct color * overview_tile_color(struct tile *ptile)
Definition overview_common.c:119
overview_update_tile
void overview_update_tile(struct tile *ptile)
Definition overview_common.c:410
OVERVIEW_TILE_SIZE
int OVERVIEW_TILE_SIZE
Definition overview_common.c:33
put_overview_tile_area
static void put_overview_tile_area(struct canvas *pcanvas, struct tile *ptile, int x, int y, int w, int h)
Definition overview_common.c:393
calculate_overview_dimensions
void calculate_overview_dimensions(void)
Definition overview_common.c:449
overview_free
void overview_free(void)
Definition overview_common.c:510
dirty_overview
static void dirty_overview(void)
Definition overview_common.c:254
map_to_overview_pos
void map_to_overview_pos(int *overview_x, int *overview_y, int map_x, int map_y)
Definition overview_common.c:323
overview_common.h
OVERVIEW_TILE_WIDTH
#define OVERVIEW_TILE_WIDTH
Definition overview_common.h:32
OVERVIEW_TILE_HEIGHT
#define OVERVIEW_TILE_HEIGHT
Definition overview_common.h:33
pplayers_allied
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
Definition player.c:1405
FC_WRAP
#define FC_WRAP(value, range)
Definition shared.h:65
MIN
#define MIN(x, y)
Definition shared.h:55
MAX
#define MAX(x, y)
Definition shared.h:54
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
recursion
static int recursion[AIT_LAST]
Definition srv_log.c:45
canvas
Definition canvas.h:22
city
Definition city.h:320
civ_map::xsize
int xsize
Definition map_types.h:78
civ_map::ysize
int ysize
Definition map_types.h:78
civclient::conn
struct connection conn
Definition client_main.h:96
client_options::overview
struct overview overview
Definition options.h:426
color
Definition colors.h:21
connection::playing
struct player * playing
Definition connection.h:151
option
Definition options.c:478
overview
Definition options.h:91
overview::map_y0
double map_y0
Definition options.h:93
overview::map_x0
double map_x0
Definition options.h:93
overview::fog
bool fog
Definition options.h:102
overview::layers
bool layers[OLAYER_COUNT]
Definition options.h:103
overview::map
struct canvas * map
Definition options.h:97
overview::width
int width
Definition options.h:94
overview::window
struct canvas * window
Definition options.h:100
overview::height
int height
Definition options.h:94
player
Definition player.h:247
tile
Definition tile.h:50
tileset
Definition tilespec.c:481
unit
Definition unit.h:138
view::height
int height
Definition mapview_common.h:38
view::gui_x0
float gui_x0
Definition mapview_common.h:37
view::gui_y0
float gui_y0
Definition mapview_common.h:37
view::width
int width
Definition mapview_common.h:38
world::map
struct civ_map map
Definition world_object.h:38
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
T_UNKNOWN
#define T_UNKNOWN
Definition terrain.h:57
is_ocean_tile
#define is_ocean_tile(ptile)
Definition terrain.h:303
terrain_has_flag
#define terrain_has_flag(terr, flag)
Definition terrain.h:283
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile_index
#define tile_index(_pt_)
Definition tile.h:88
TILE_KNOWN_UNSEEN
@ TILE_KNOWN_UNSEEN
Definition tile.h:37
tile_terrain
#define tile_terrain(_tile)
Definition tile.h:110
tile_owner
#define tile_owner(_tile)
Definition tile.h:96
get_basic_fog_sprite
struct sprite * get_basic_fog_sprite(const struct tileset *t)
Definition tilespec.c:7057
tileset_is_isometric
bool tileset_is_isometric(const struct tileset *t)
Definition tilespec.c:712
tileset_tile_height
int tileset_tile_height(const struct tileset *t)
Definition tilespec.c:765
tileset_tile_width
int tileset_tile_width(const struct tileset *t)
Definition tilespec.c:753
unit_owner
#define unit_owner(_pu)
Definition unit.h:389
map_zoom
float map_zoom
Definition zoom.c:25
zoom.h