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)
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 ***********************************************************************/
14 #ifndef FC__OVERVIEW_COMMON_H
15 #define FC__OVERVIEW_COMMON_H
19 #endif /* __cplusplus */
27 enum overview_layers
{
31 OLAYER_BORDERS_ON_OCEAN
,
37 /* Holds all information about the overview aka minimap. */
39 /* The following fields are controlled by mapview_common.c. */
40 double map_x0
, map_y0
; /* Origin of the overview, in natural coords. */
41 int width
, height
; /* Size in pixels. */
43 /* Holds the map, unwrapped. */
46 /* A backing store for the window itself, wrapped. */
47 struct canvas
*window
;
50 bool layers
[OLAYER_COUNT
];
53 extern struct overview overview
;
55 /* The overview tile width and height are defined in terms of the base
56 * size. For iso-maps the width is twice the height since "natural"
57 * coordinates are used. For classical maps the width and height are
58 * equal. The base size may be adjusted to get the correct scale. */
59 extern int OVERVIEW_TILE_SIZE
;
60 #define OVERVIEW_TILE_WIDTH ((MAP_IS_ISOMETRIC ? 2 : 1) * OVERVIEW_TILE_SIZE)
61 #define OVERVIEW_TILE_HEIGHT OVERVIEW_TILE_SIZE
63 void map_to_overview_pos(int *overview_x
, int *overview_y
,
64 int map_x
, int map_y
);
65 void overview_to_map_pos(int *map_x
, int *map_y
,
66 int overview_x
, int overview_y
);
68 void refresh_overview_canvas(void);
69 void refresh_overview_from_canvas(void);
70 void overview_update_tile(struct tile
*ptile
);
71 void calculate_overview_dimensions(void);
73 void center_tile_overviewcanvas(void);
75 void flush_dirty_overview(void);
77 void overview_redraw_callback(struct option
*option
);
81 #endif /* __cplusplus */
83 #endif /* FC__OVERVIEW_COMMON_H */