OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

zoom_type.h
Go to the documentation of this file.
1 /* $Id: zoom_type.h 27134 2015-02-01 20:54:24Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef ZOOM_TYPE_H
13 #define ZOOM_TYPE_H
14
15 #include "core/enum_type.hpp"
16
17 static int const ZOOM_LVL_SHIFT = 2;
18 static int const ZOOM_LVL_BASE = 1 << ZOOM_LVL_SHIFT;
19
21 enum ZoomLevel {
22 /* Our possible zoom-levels */
23 ZOOM_LVL_BEGIN = 0,
24 ZOOM_LVL_NORMAL = 0,
25 ZOOM_LVL_OUT_2X,
26 ZOOM_LVL_OUT_4X,
27 ZOOM_LVL_OUT_8X,
28 ZOOM_LVL_OUT_16X,
29 ZOOM_LVL_OUT_32X,
30 ZOOM_LVL_END,
31
32 ZOOM_LVL_COUNT = ZOOM_LVL_END - ZOOM_LVL_BEGIN,
33
34 /* Here we define in which zoom viewports are */
35 ZOOM_LVL_VIEWPORT = ZOOM_LVL_OUT_4X,
36 ZOOM_LVL_NEWS = ZOOM_LVL_OUT_4X,
37 ZOOM_LVL_INDUSTRY = ZOOM_LVL_OUT_8X,
38 ZOOM_LVL_TOWN = ZOOM_LVL_OUT_8X,
39 ZOOM_LVL_AIRCRAFT = ZOOM_LVL_OUT_4X,
40 ZOOM_LVL_SHIP = ZOOM_LVL_OUT_4X,
41 ZOOM_LVL_TRAIN = ZOOM_LVL_OUT_4X,
42 ZOOM_LVL_ROADVEH = ZOOM_LVL_OUT_4X,
43 ZOOM_LVL_WORLD_SCREENSHOT = ZOOM_LVL_OUT_4X,
44
45 ZOOM_LVL_DETAIL = ZOOM_LVL_OUT_8X,
46
47 ZOOM_LVL_MIN = ZOOM_LVL_NORMAL,
48 ZOOM_LVL_MAX = ZOOM_LVL_OUT_32X,
49 };
50 DECLARE_POSTFIX_INCREMENT(ZoomLevel)
51
52
53 typedef SimpleTinyEnumT<ZoomLevel, byte> ZoomLevelByte;
54
55 extern ZoomLevelByte _gui_zoom;
56 #define ZOOM_LVL_GUI (_gui_zoom)
57
58 #endif /* ZOOM_TYPE_H */