OpenTTD: src/openttd.h Source File

OpenTTD

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

- File List
- Globals

openttd.h
Go to the documentation of this file.
1 /* $Id: openttd.h 25506 2013-06-28 21:11:35Z rubidium $ */
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 OPENTTD_H
13 #define OPENTTD_H
14
15 #include "core/enum_type.hpp"
16
18 enum GameMode {
19 GM_MENU,
20 GM_NORMAL,
21 GM_EDITOR,
22 GM_BOOTSTRAP
23 };
24
26 enum SwitchMode {
27 SM_NONE,
28 SM_NEWGAME,
29 SM_RESTARTGAME,
30 SM_EDITOR,
31 SM_LOAD_GAME,
32 SM_MENU,
33 SM_SAVE_GAME,
34 SM_SAVE_HEIGHTMAP,
35 SM_GENRANDLAND,
36 SM_LOAD_SCENARIO,
37 SM_START_HEIGHTMAP,
38 SM_LOAD_HEIGHTMAP,
39 };
40
42 enum DisplayOptions {
43 DO_SHOW_TOWN_NAMES = 0,
44 DO_SHOW_STATION_NAMES = 1,
45 DO_SHOW_SIGNS = 2,
46 DO_FULL_ANIMATION = 3,
47 DO_FULL_DETAIL = 5,
48 DO_SHOW_WAYPOINT_NAMES = 6,
49 DO_SHOW_COMPETITOR_SIGNS = 7,
50 };
51
52 extern GameMode _game_mode;
53 extern SwitchMode _switch_mode;
54 extern bool _exit_game;
55
57 enum PauseMode {
58 PM_UNPAUSED = 0,
59 PM_PAUSED_NORMAL = 1 << 0,
60 PM_PAUSED_SAVELOAD = 1 << 1,
61 PM_PAUSED_JOIN = 1 << 2,
62 PM_PAUSED_ERROR = 1 << 3,
63 PM_PAUSED_ACTIVE_CLIENTS = 1 << 4,
64 PM_PAUSED_GAME_SCRIPT = 1 << 5,
65
67 PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
68 };
69 DECLARE_ENUM_AS_BIT_SET(PauseMode)
70 typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
71
73 extern PauseModeByte _pause_mode;
74
75 void AskExitGame();
76 void AskExitToGameMenu();
77
78 int openttd_main(int argc, char *argv[]);
79 void HandleExitGameRequest();
80
81 void SwitchToMode(SwitchMode new_mode);
82
83 #endif /* OPENTTD_H */