OpenTTD
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,
39 };
40 
50 };
51 
52 extern GameMode _game_mode;
54 extern bool _exit_game;
55 
57 enum PauseMode {
59  PM_PAUSED_NORMAL = 1 << 0,
60  PM_PAUSED_SAVELOAD = 1 << 1,
61  PM_PAUSED_JOIN = 1 << 2,
62  PM_PAUSED_ERROR = 1 << 3,
65 
68 };
71 
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 */
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
DisplayOptions
Display Options.
Definition: openttd.h:42
A game paused for &#39;min_active_clients&#39;.
Definition: openttd.h:63
A game normally paused.
Definition: openttd.h:59
A normal unpaused game.
Definition: openttd.h:58
Load heightmap from scenario editor.
Definition: openttd.h:38
Display waypoint names.
Definition: openttd.h:48
Switch to game intro menu.
Definition: openttd.h:32
Load game, Play Scenario.
Definition: openttd.h:31
Display station names.
Definition: openttd.h:44
A game paused by a game script.
Definition: openttd.h:64
Display town names.
Definition: openttd.h:43
Display signs, station names and waypoint names of opponent companies. Buoys and oilrig-stations are ...
Definition: openttd.h:49
Also draw details of track and roads.
Definition: openttd.h:47
A game paused for &#39;pause_on_join&#39;.
Definition: openttd.h:61
A game paused because a (critical) error.
Definition: openttd.h:62
Type (helpers) for enums.
Display signs.
Definition: openttd.h:45
Load a heightmap and start a new game from it.
Definition: openttd.h:37
Switch to scenario editor.
Definition: openttd.h:30
GameMode
Mode which defines the state of the game.
Definition: openttd.h:18
int openttd_main(int argc, char *argv[])
Main entry point for this lovely game.
Definition: openttd.cpp:534
SwitchMode _switch_mode
The next mainloop command.
Definition: gfx.cpp:47
Template of struct holding enum types (on most archs, enums are stored in an int32).
Definition: enum_type.hpp:139
Save game.
Definition: openttd.h:33
Restart –> &#39;Random game&#39; with current settings.
Definition: openttd.h:29
PauseMode
Modes of pausing we&#39;ve got.
Definition: openttd.h:57
Perform palette animation.
Definition: openttd.h:46
Load scenario from scenario editor.
Definition: openttd.h:36
Pause mode bits when paused for network reasons.
Definition: openttd.h:67
A game paused for saving/loading.
Definition: openttd.h:60
Generate random land within scenario editor.
Definition: openttd.h:35
PauseModeByte _pause_mode
The current pause mode.
Definition: gfx.cpp:48
New Game –> &#39;Random game&#39;.
Definition: openttd.h:28
SwitchMode
Mode which defines what mode we&#39;re switching to.
Definition: openttd.h:26
Save heightmap.
Definition: openttd.h:34