2005-07-24 16:12:37 +02:00
|
|
|
/* $Id$ */
|
2008-04-19 12:18:38 +02:00
|
|
|
|
2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 17:11:33 +02:00
|
|
|
/** @file openttd.h Some generic types. */
|
2005-07-24 16:12:37 +02:00
|
|
|
|
2005-07-15 23:28:26 +02:00
|
|
|
#ifndef OPENTTD_H
|
|
|
|
#define OPENTTD_H
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2009-05-06 17:06:57 +02:00
|
|
|
#include "core/enum_type.hpp"
|
|
|
|
|
2011-02-14 20:52:26 +01:00
|
|
|
/** Mode which defines the state of the game. */
|
2009-02-25 01:14:46 +01:00
|
|
|
enum GameMode {
|
2007-12-23 00:30:28 +01:00
|
|
|
GM_MENU,
|
|
|
|
GM_NORMAL,
|
2009-02-25 01:14:46 +01:00
|
|
|
GM_EDITOR,
|
2007-12-23 00:30:28 +01:00
|
|
|
};
|
|
|
|
|
2011-02-14 20:52:26 +01:00
|
|
|
/** Mode which defines what mode we're switching to. */
|
2009-02-25 01:45:52 +01:00
|
|
|
enum SwitchMode {
|
|
|
|
SM_NONE,
|
|
|
|
SM_NEWGAME,
|
2009-08-07 00:00:32 +02:00
|
|
|
SM_RESTARTGAME,
|
2009-02-25 01:45:52 +01:00
|
|
|
SM_EDITOR,
|
|
|
|
SM_LOAD,
|
|
|
|
SM_MENU,
|
|
|
|
SM_SAVE,
|
|
|
|
SM_GENRANDLAND,
|
|
|
|
SM_LOAD_SCENARIO,
|
|
|
|
SM_START_HEIGHTMAP,
|
|
|
|
SM_LOAD_HEIGHTMAP,
|
2004-08-09 19:04:08 +02:00
|
|
|
};
|
|
|
|
|
2011-05-14 20:38:54 +02:00
|
|
|
/** Display Options */
|
2010-05-13 11:44:44 +02:00
|
|
|
enum DisplayOptions {
|
2011-05-14 20:38:54 +02:00
|
|
|
DO_SHOW_TOWN_NAMES = 0, ///< Display town names.
|
|
|
|
DO_SHOW_STATION_NAMES = 1, ///< Display station names.
|
|
|
|
DO_SHOW_SIGNS = 2, ///< Display signs.
|
|
|
|
DO_FULL_ANIMATION = 3, ///< Perform palette animation.
|
|
|
|
DO_FULL_DETAIL = 5, ///< Also draw details of track and roads.
|
|
|
|
DO_SHOW_WAYPOINT_NAMES = 6, ///< Display waypoint names.
|
2007-04-05 09:49:04 +02:00
|
|
|
};
|
|
|
|
|
2009-02-25 01:14:46 +01:00
|
|
|
extern GameMode _game_mode;
|
2009-02-25 01:45:52 +01:00
|
|
|
extern SwitchMode _switch_mode;
|
2007-12-23 00:30:28 +01:00
|
|
|
extern bool _exit_game;
|
2009-05-06 17:06:57 +02:00
|
|
|
|
|
|
|
/** Modes of pausing we've got */
|
|
|
|
enum PauseMode {
|
2009-11-12 18:46:04 +01:00
|
|
|
PM_UNPAUSED = 0, ///< A normal unpaused game
|
|
|
|
PM_PAUSED_NORMAL = 1 << 0, ///< A game normally paused
|
|
|
|
PM_PAUSED_SAVELOAD = 1 << 1, ///< A game paused for saving/loading
|
|
|
|
PM_PAUSED_JOIN = 1 << 2, ///< A game paused for 'pause_on_join'
|
|
|
|
PM_PAUSED_ERROR = 1 << 3, ///< A game paused because a (critical) error
|
|
|
|
PM_PAUSED_ACTIVE_CLIENTS = 1 << 4, ///< A game paused for 'min_active_clients'
|
2009-11-17 15:06:28 +01:00
|
|
|
|
2011-05-14 20:38:54 +02:00
|
|
|
/** Pause mode bits when paused for network reasons. */
|
2009-11-17 15:06:28 +01:00
|
|
|
PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
|
2009-05-06 17:06:57 +02:00
|
|
|
};
|
2010-03-23 23:25:43 +01:00
|
|
|
DECLARE_ENUM_AS_BIT_SET(PauseMode)
|
2009-05-06 17:06:57 +02:00
|
|
|
typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
|
|
|
|
|
|
|
|
/** The current pause mode */
|
|
|
|
extern PauseModeByte _pause_mode;
|
2007-12-23 00:30:28 +01:00
|
|
|
|
2011-02-07 23:15:46 +01:00
|
|
|
void AskExitGame();
|
|
|
|
void AskExitToGameMenu();
|
|
|
|
|
|
|
|
int ttd_main(int argc, char *argv[]);
|
|
|
|
void HandleExitGameRequest();
|
|
|
|
|
2005-07-15 23:28:26 +02:00
|
|
|
#endif /* OPENTTD_H */
|