mirror of https://github.com/OpenTTD/OpenTTD
(svn r15575) -Codechange: Rename GameModes to GameMode and store _game_mode as GameMode instead of as byte.
parent
d86ae1fde6
commit
901230bde1
|
@ -588,7 +588,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLAND_TERRAIN_PULLDOWN: {
|
case GLAND_TERRAIN_PULLDOWN: {
|
||||||
byte old_gm = _game_mode;
|
GameMode old_gm = _game_mode;
|
||||||
_game_mode = GM_MENU;
|
_game_mode = GM_MENU;
|
||||||
IConsoleSetSetting("difficulty.terrain_type", index);
|
IConsoleSetSetting("difficulty.terrain_type", index);
|
||||||
_game_mode = old_gm;
|
_game_mode = old_gm;
|
||||||
|
@ -596,7 +596,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
case GLAND_WATER_PULLDOWN: {
|
case GLAND_WATER_PULLDOWN: {
|
||||||
byte old_gm = _game_mode;
|
GameMode old_gm = _game_mode;
|
||||||
_game_mode = GM_MENU;
|
_game_mode = GM_MENU;
|
||||||
IConsoleSetSetting("difficulty.quantity_sea_lakes", index);
|
IConsoleSetSetting("difficulty.quantity_sea_lakes", index);
|
||||||
_game_mode = old_gm;
|
_game_mode = old_gm;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
/** @file gfx.cpp Handling of drawing text and other gfx related stuff. */
|
/** @file gfx.cpp Handling of drawing text and other gfx related stuff. */
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "openttd.h"
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
#include "spritecache.h"
|
#include "spritecache.h"
|
||||||
|
@ -36,7 +37,7 @@ DrawPixelInfo _screen;
|
||||||
bool _screen_disable_anim = false; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
|
bool _screen_disable_anim = false; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
|
||||||
bool _exit_game;
|
bool _exit_game;
|
||||||
bool _networking; ///< are we in networking mode?
|
bool _networking; ///< are we in networking mode?
|
||||||
byte _game_mode;
|
GameMode _game_mode;
|
||||||
int8 _pause_game;
|
int8 _pause_game;
|
||||||
int _pal_first_dirty;
|
int _pal_first_dirty;
|
||||||
int _pal_count_dirty;
|
int _pal_count_dirty;
|
||||||
|
|
|
@ -334,7 +334,7 @@ DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_MOVE)(CompanyID company, const char
|
||||||
// DEF_CLIENT_RECEIVE_COMMAND has parameter: Packet *p
|
// DEF_CLIENT_RECEIVE_COMMAND has parameter: Packet *p
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm, Subdirectory subdir);
|
extern bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory subdir);
|
||||||
extern StringID _switch_mode_errorstr;
|
extern StringID _switch_mode_errorstr;
|
||||||
|
|
||||||
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_FULL)
|
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_FULL)
|
||||||
|
|
|
@ -844,9 +844,9 @@ static void StartScenario()
|
||||||
* @param newgm switch to this mode of loading fails due to some unknown error
|
* @param newgm switch to this mode of loading fails due to some unknown error
|
||||||
* @param subdir default directory to look for filename, set to 0 if not needed
|
* @param subdir default directory to look for filename, set to 0 if not needed
|
||||||
*/
|
*/
|
||||||
bool SafeSaveOrLoad(const char *filename, int mode, int newgm, Subdirectory subdir)
|
bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory subdir)
|
||||||
{
|
{
|
||||||
byte ogm = _game_mode;
|
GameMode ogm = _game_mode;
|
||||||
|
|
||||||
_game_mode = newgm;
|
_game_mode = newgm;
|
||||||
assert(mode == SL_LOAD || mode == SL_OLD_LOAD);
|
assert(mode == SL_LOAD || mode == SL_OLD_LOAD);
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
#ifndef OPENTTD_H
|
#ifndef OPENTTD_H
|
||||||
#define OPENTTD_H
|
#define OPENTTD_H
|
||||||
|
|
||||||
enum GameModes {
|
enum GameMode {
|
||||||
GM_MENU,
|
GM_MENU,
|
||||||
GM_NORMAL,
|
GM_NORMAL,
|
||||||
GM_EDITOR
|
GM_EDITOR,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SwitchModes {
|
enum SwitchModes {
|
||||||
|
@ -35,7 +35,7 @@ enum {
|
||||||
DO_WAYPOINTS = 6,
|
DO_WAYPOINTS = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern byte _game_mode;
|
extern GameMode _game_mode;
|
||||||
extern bool _exit_game;
|
extern bool _exit_game;
|
||||||
extern int8 _pause_game;
|
extern int8 _pause_game;
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ static void CloseWindowsConsoleThread()
|
||||||
|
|
||||||
static void *_dedicated_video_mem;
|
static void *_dedicated_video_mem;
|
||||||
|
|
||||||
extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm, Subdirectory subdir);
|
extern bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory subdir);
|
||||||
extern void SwitchMode(int new_mode);
|
extern void SwitchMode(int new_mode);
|
||||||
|
|
||||||
static FVideoDriver_Dedicated iFVideoDriver_Dedicated;
|
static FVideoDriver_Dedicated iFVideoDriver_Dedicated;
|
||||||
|
|
Loading…
Reference in New Issue