openttd.h

Go to the documentation of this file.
00001 /* $Id: openttd.h 22080 2011-02-14 19:52:26Z planetmaker $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef OPENTTD_H
00013 #define OPENTTD_H
00014 
00015 #include "core/enum_type.hpp"
00016 
00018 enum GameMode {
00019   GM_MENU,
00020   GM_NORMAL,
00021   GM_EDITOR,
00022 };
00023 
00025 enum SwitchMode {
00026   SM_NONE,
00027   SM_NEWGAME,
00028   SM_RESTARTGAME,
00029   SM_EDITOR,
00030   SM_LOAD,
00031   SM_MENU,
00032   SM_SAVE,
00033   SM_GENRANDLAND,
00034   SM_LOAD_SCENARIO,
00035   SM_START_HEIGHTMAP,
00036   SM_LOAD_HEIGHTMAP,
00037 };
00038 
00039 /* Display Options */
00040 enum DisplayOptions {
00041   DO_SHOW_TOWN_NAMES     = 0,
00042   DO_SHOW_STATION_NAMES  = 1,
00043   DO_SHOW_SIGNS          = 2,
00044   DO_FULL_ANIMATION      = 3,
00045   DO_FULL_DETAIL         = 5,
00046   DO_SHOW_WAYPOINT_NAMES = 6,
00047 };
00048 
00049 extern GameMode _game_mode;
00050 extern SwitchMode _switch_mode;
00051 extern bool _exit_game;
00052 
00054 enum PauseMode {
00055   PM_UNPAUSED              = 0,      
00056   PM_PAUSED_NORMAL         = 1 << 0, 
00057   PM_PAUSED_SAVELOAD       = 1 << 1, 
00058   PM_PAUSED_JOIN           = 1 << 2, 
00059   PM_PAUSED_ERROR          = 1 << 3, 
00060   PM_PAUSED_ACTIVE_CLIENTS = 1 << 4, 
00061 
00062   /* Pause mode bits when paused for network reasons */
00063   PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
00064 };
00065 DECLARE_ENUM_AS_BIT_SET(PauseMode)
00066 typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
00067 
00069 extern PauseModeByte _pause_mode;
00070 
00071 void AskExitGame();
00072 void AskExitToGameMenu();
00073 
00074 int ttd_main(int argc, char *argv[]);
00075 void HandleExitGameRequest();
00076 
00077 #endif /* OPENTTD_H */

Generated on Sun May 15 19:20:12 2011 for OpenTTD by  doxygen 1.6.1