Changeset - r15514:7e3c6c9e07c2
[Not reviewed]
master
0 6 0
rubidium - 14 years ago 2010-07-19 15:44:49
rubidium@openttd.org
(svn r20183) -Codechange: make _do_autosave and _dedicated_forks not use VARDEF and put them in a more logical location
6 files changed with 9 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/openttd.cpp
Show inline comments
 
@@ -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();
src/saveload/saveload.cpp
Show inline comments
 
@@ -55,6 +55,7 @@ uint32 _ttdp_version;     ///< version o
 
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();
src/saveload/saveload.h
Show inline comments
 
@@ -342,5 +342,6 @@ bool SlObjectMember(void *object, const 
 
bool SaveloadCrashWithMissingNewGRFs();
 

	
 
extern char _savegame_format[8];
 
extern bool _do_autosave;
 

	
 
#endif /* SAVELOAD_H */
src/statusbar_gui.cpp
Show inline comments
 
@@ -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"
src/variables.h
Show inline comments
 
@@ -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 */
src/video/dedicated_v.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)