(svn r20183) -Codechange: make _do_autosave and _dedicated_forks not use VARDEF and put them in a more logical location

pull/155/head
rubidium 14 years ago
parent 1441de3950
commit 8894ae2ccb

@ -90,6 +90,7 @@ void CallWindowTickEvent();
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
extern void ShowOSErrorBox(const char *buf, bool system);
extern bool _dedicated_forks;
/**
* Error handling for fatal user errors.
@ -567,8 +568,7 @@ int ttd_main(int argc, char *argv[])
#if defined(UNIX) && !defined(__MORPHOS__)
/* We must fork here, or we'll end up without some resources we need (like sockets) */
if (_dedicated_forks)
DedicatedFork();
if (_dedicated_forks) DedicatedFork();
#endif
AI::Initialize();

@ -55,6 +55,7 @@ uint32 _ttdp_version; ///< version of TTDP savegame (if applicable)
uint16 _sl_version; ///< the major savegame version identifier
byte _sl_minor_version; ///< the minor savegame version, DO NOT USE!
char _savegame_format[8]; ///< how to compress savegames
bool _do_autosave; ///< are we doing an autosave at the moment?
typedef void WriterProc(size_t len);
typedef size_t ReaderProc();

@ -342,5 +342,6 @@ bool SlObjectMember(void *object, const SaveLoad *sld);
bool SaveloadCrashWithMissingNewGRFs();
extern char _savegame_format[8];
extern bool _do_autosave;
#endif /* SAVELOAD_H */

@ -22,7 +22,7 @@
#include "news_gui.h"
#include "company_gui.h"
#include "window_gui.h"
#include "variables.h"
#include "saveload/saveload.h"
#include "window_func.h"
#include "statusbar_gui.h"
#include "core/geometry_func.hpp"

@ -30,8 +30,6 @@ VARDEF int _palette_animation_counter;
VARDEF uint32 _realtime_tick;
VARDEF bool _do_autosave;
VARDEF byte _display_opt;
VARDEF bool _rightclick_emulate;
@ -46,7 +44,4 @@ VARDEF char *_log_file;
/* landscape.cpp */
extern const byte _tileh_to_sprite[32];
/* Forking stuff */
VARDEF bool _dedicated_forks;
#endif /* VARIABLES_H */

@ -132,6 +132,9 @@ static void CloseWindowsConsoleThread()
static void *_dedicated_video_mem;
/* Whether a fork has been done. */
bool _dedicated_forks;
extern bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory subdir);
extern void SwitchToMode(SwitchMode new_mode);
@ -295,8 +298,7 @@ void VideoDriver_Dedicated::MainLoop()
uint32 prev_cur_ticks = cur_ticks; // to check for wrapping
InteractiveRandom(); // randomness
if (!_dedicated_forks)
DedicatedHandleKeyInput();
if (!_dedicated_forks) DedicatedHandleKeyInput();
cur_ticks = GetTime();
_realtime_tick += cur_ticks - prev_cur_ticks;

Loading…
Cancel
Save