|
@@ -67,25 +67,25 @@
|
|
|
|
|
|
#include "linkgraph/linkgraphschedule.h"
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
void CallLandscapeTick();
|
|
|
void IncreaseDate();
|
|
|
void DoPaletteAnimations();
|
|
|
void MusicLoop();
|
|
|
void ResetMusic();
|
|
|
void CallWindowTickEvent();
|
|
|
void CallWindowGameTickEvent();
|
|
|
bool HandleBootstrap();
|
|
|
|
|
|
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
|
|
|
extern void ShowOSErrorBox(const char *buf, bool system);
|
|
|
extern char *_config_file;
|
|
|
|
|
|
/**
|
|
|
* Error handling for fatal user errors.
|
|
|
* @param s the string to print.
|
|
|
* @note Does NEVER return.
|
|
|
*/
|
|
|
void CDECL usererror(const char *s, ...)
|
|
@@ -1354,43 +1354,42 @@ void StateGameLoop()
|
|
|
PerformanceMeasurer::Paused(PFE_GAMELOOP);
|
|
|
PerformanceMeasurer::Paused(PFE_GL_ECONOMY);
|
|
|
PerformanceMeasurer::Paused(PFE_GL_TRAINS);
|
|
|
PerformanceMeasurer::Paused(PFE_GL_ROADVEHS);
|
|
|
PerformanceMeasurer::Paused(PFE_GL_SHIPS);
|
|
|
PerformanceMeasurer::Paused(PFE_GL_AIRCRAFT);
|
|
|
PerformanceMeasurer::Paused(PFE_GL_LANDSCAPE);
|
|
|
|
|
|
UpdateLandscapingLimits();
|
|
|
#ifndef DEBUG_DUMP_COMMANDS
|
|
|
Game::GameLoop();
|
|
|
#endif
|
|
|
CallWindowTickEvent();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
PerformanceMeasurer framerate(PFE_GAMELOOP);
|
|
|
PerformanceAccumulator::Reset(PFE_GL_LANDSCAPE);
|
|
|
if (HasModalProgress()) return;
|
|
|
|
|
|
Layouter::ReduceLineCache();
|
|
|
|
|
|
if (_game_mode == GM_EDITOR) {
|
|
|
BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
|
|
|
RunTileLoop();
|
|
|
CallVehicleTicks();
|
|
|
CallLandscapeTick();
|
|
|
BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
|
|
|
UpdateLandscapingLimits();
|
|
|
|
|
|
CallWindowTickEvent();
|
|
|
CallWindowGameTickEvent();
|
|
|
NewsLoop();
|
|
|
} else {
|
|
|
if (_debug_desync_level > 2 && _date_fract == 0 && (_date & 0x1F) == 0) {
|
|
|
/* Save the desync savegame if needed. */
|
|
|
char name[MAX_PATH];
|
|
|
seprintf(name, lastof(name), "dmp_cmds_%08x_%08x.sav", _settings_game.game_creation.generation_seed, _date);
|
|
|
SaveOrLoad(name, SLO_SAVE, DFT_GAME_FILE, AUTOSAVE_DIR, false);
|
|
|
}
|
|
|
|
|
|
CheckCaches();
|
|
|
|
|
|
/* All these actions has to be done from OWNER_NONE
|
|
@@ -1402,25 +1401,25 @@ void StateGameLoop()
|
|
|
IncreaseDate();
|
|
|
RunTileLoop();
|
|
|
CallVehicleTicks();
|
|
|
CallLandscapeTick();
|
|
|
BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
|
|
|
|
|
|
#ifndef DEBUG_DUMP_COMMANDS
|
|
|
AI::GameLoop();
|
|
|
Game::GameLoop();
|
|
|
#endif
|
|
|
UpdateLandscapingLimits();
|
|
|
|
|
|
CallWindowTickEvent();
|
|
|
CallWindowGameTickEvent();
|
|
|
NewsLoop();
|
|
|
cur_company.Restore();
|
|
|
}
|
|
|
|
|
|
assert(IsLocalCompany());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Create an autosave. The default name is "autosave#.sav". However with
|
|
|
* the setting 'keep_all_autosave' the name defaults to company-name + date
|
|
|
*/
|
|
|
static void DoAutosave()
|