# openttd.h

Go to the documentation of this file.

    00001 /* $Id: openttd.h 23618 2011-12-19 20:58:59Z truebrain $ */
    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   GM_BOOTSTRAP
    00023 };
    00024
    00026 enum SwitchMode {
    00027   SM_NONE,
    00028   SM_NEWGAME,
    00029   SM_RESTARTGAME,
    00030   SM_EDITOR,
    00031   SM_LOAD_GAME,
    00032   SM_MENU,
    00033   SM_SAVE_GAME,
    00034   SM_SAVE_HEIGHTMAP,
    00035   SM_GENRANDLAND,
    00036   SM_LOAD_SCENARIO,
    00037   SM_START_HEIGHTMAP,
    00038   SM_LOAD_HEIGHTMAP,
    00039 };
    00040
    00042 enum DisplayOptions {
    00043   DO_SHOW_TOWN_NAMES     = 0,
    00044   DO_SHOW_STATION_NAMES  = 1,
    00045   DO_SHOW_SIGNS          = 2,
    00046   DO_FULL_ANIMATION      = 3,
    00047   DO_FULL_DETAIL         = 5,
    00048   DO_SHOW_WAYPOINT_NAMES = 6,
    00049   DO_SHOW_COMPETITOR_SIGNS = 7,
    00050 };
    00051
    00052 extern GameMode _game_mode;
    00053 extern SwitchMode _switch_mode;
    00054 extern bool _exit_game;
    00055
    00057 enum PauseMode {
    00058   PM_UNPAUSED              = 0,
    00059   PM_PAUSED_NORMAL         = 1 << 0,
    00060   PM_PAUSED_SAVELOAD       = 1 << 1,
    00061   PM_PAUSED_JOIN           = 1 << 2,
    00062   PM_PAUSED_ERROR          = 1 << 3,
    00063   PM_PAUSED_ACTIVE_CLIENTS = 1 << 4,
    00064   PM_PAUSED_GAME_SCRIPT    = 1 << 5,
    00065
    00067   PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
    00068 };
    00069 DECLARE_ENUM_AS_BIT_SET(PauseMode)
    00070 typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
    00071
    00073 extern PauseModeByte _pause_mode;
    00074
    00075 void AskExitGame();
    00076 void AskExitToGameMenu();
    00077
    00078 int ttd_main(int argc, char *argv[]);
    00079 void HandleExitGameRequest();
    00080
    00081 void SwitchToMode(SwitchMode new_mode);
    00082
    00083 #endif /* OPENTTD_H */