Freeciv21
Develop your civilization from humble roots to a global empire
overview_common.h
Go to the documentation of this file.
1 /***********************************************************************
2 _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors.
3  \ | This file is part of Freeciv21. Freeciv21 is free software: you
4  \_| can redistribute it and/or modify it under the terms of the
5  .' '. GNU General Public License as published by the Free
6  :O O: Software Foundation, either version 3 of the License,
7  '/ \' or (at your option) any later version. You should have
8  :X: received a copy of the GNU General Public License along with
9  :X: Freeciv21. If not, see https://www.gnu.org/licenses/.
10 ***********************************************************************/
11 #pragma once
12 
13 /* The overview tile width and height are defined in terms of the base
14  * size. For iso-maps the width is twice the height since "natural"
15  * coordinates are used. For classical maps the width and height are
16  * equal. The base size may be adjusted to get the correct scale. */
17 extern int OVERVIEW_TILE_SIZE;
18 #define OVERVIEW_TILE_WIDTH ((MAP_IS_ISOMETRIC ? 2 : 1) * OVERVIEW_TILE_SIZE)
19 #define OVERVIEW_TILE_HEIGHT OVERVIEW_TILE_SIZE
20 
21 void overview_to_map_pos(int *map_x, int *map_y, int overview_x,
22  int overview_y);
23 
26 void overview_init();
27 void overview_free();
28 
30 
32 void gui_to_natural_pos(const struct tileset *t, double *ntl_x,
33  double *ntl_y, int gui_x, int gui_y);
34 void gui_to_overview_pos(const struct tileset *t, int *ovr_x, int *ovr_y,
35  int gui_x, int gui_y);
void overview_init()
Allocates overview resources.
void overview_to_map_pos(int *map_x, int *map_y, int overview_x, int overview_y)
Finds the map coordinates for a given overview (canvas) position.
void gui_to_overview_pos(const struct tileset *t, int *ovr_x, int *ovr_y, int gui_x, int gui_y)
Translate from gui to overview coordinate systems.
void overview_redraw_callback(struct option *option)
Callback to be called when an overview option is changed.
void refresh_overview_canvas()
Redraw the entire backing store for the overview minimap.
void flush_dirty_overview()
Redraw the overview if it is "dirty".
void overview_free()
Free overview resources.
int OVERVIEW_TILE_SIZE
void calculate_overview_dimensions()
Called if the map size is know or changes.
void gui_to_natural_pos(const struct tileset *t, double *ntl_x, double *ntl_y, int gui_x, int gui_y)
Translate from gui to natural coordinate systems.
The base class for options.
Definition: options.cpp:209