Some miscellaneous updates to main help, for new features and otherwise.
[freeciv.git] / client / overview_common.h
blobcd2a2e803d6c859ab963d5f7285b4b6d60852bd4
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.
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
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 #include "fc_types.h"
23 #include "canvas_g.h"
25 #include "options.h"
27 enum overview_layers {
28 OLAYER_BACKGROUND,
29 OLAYER_RELIEF,
30 OLAYER_BORDERS,
31 OLAYER_BORDERS_ON_OCEAN,
32 OLAYER_UNITS,
33 OLAYER_CITIES,
34 OLAYER_COUNT
37 /* Holds all information about the overview aka minimap. */
38 struct overview {
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. */
44 struct canvas *map;
46 /* A backing store for the window itself, wrapped. */
47 struct canvas *window;
49 bool fog;
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);
79 #ifdef __cplusplus
81 #endif /* __cplusplus */
83 #endif /* FC__OVERVIEW_COMMON_H */