Changeset View
Changeset View
Standalone View
Standalone View
source/main.cpp
Show First 20 Lines • Show All 449 Lines • ▼ Show 20 Lines | |||||
static void NonVisualFrame() | static void NonVisualFrame() | ||||
{ | { | ||||
g_Profiler2.RecordFrameStart(); | g_Profiler2.RecordFrameStart(); | ||||
PROFILE2("frame"); | PROFILE2("frame"); | ||||
g_Profiler2.IncrementFrameNumber(); | g_Profiler2.IncrementFrameNumber(); | ||||
PROFILE2_ATTR("%d", g_Profiler2.GetFrameNumber()); | PROFILE2_ATTR("%d", g_Profiler2.GetFrameNumber()); | ||||
if (g_NetClient) | |||||
g_NetClient->Poll(); | |||||
static u32 turn = 0; | static u32 turn = 0; | ||||
if (g_Game && g_Game->IsGameStarted() && g_Game->GetTurnManager()) | |||||
if (g_Game->GetTurnManager()->Update(DEFAULT_TURN_LENGTH, 1)) | |||||
debug_printf("Turn %u (%u)...\n", turn++, DEFAULT_TURN_LENGTH); | debug_printf("Turn %u (%u)...\n", turn++, DEFAULT_TURN_LENGTH); | ||||
vladislavbelov: Can a game be started without the turn manager? | |||||
g_Game->GetSimulation2()->Update(DEFAULT_TURN_LENGTH); | |||||
g_Profiler.Frame(); | g_Profiler.Frame(); | ||||
if (g_Game->IsGameFinished()) | if (g_Game->IsGameFinished()) | ||||
QuitEngine(); | QuitEngine(); | ||||
} | } | ||||
static void MainControllerInit() | static void MainControllerInit() | ||||
{ | { | ||||
Show All 29 Lines | static void RunGameOrAtlas(int argc, const char* argv[]) | ||||
g_CmdLineArgs = args; | g_CmdLineArgs = args; | ||||
if (args.Has("version")) | if (args.Has("version")) | ||||
{ | { | ||||
debug_printf("Pyrogenesis %s\n", engine_version); | debug_printf("Pyrogenesis %s\n", engine_version); | ||||
return; | return; | ||||
} | } | ||||
if (args.Has("autostart-nonvisual") && args.Get("autostart").empty() && !args.Has("rl-interface")) | if (args.Has("autostart-nonvisual") && args.Get("autostart").empty() && !args.Has("rl-interface") && !args.Has("autostart-client")) | ||||
{ | { | ||||
LOGERROR("-autostart-nonvisual cant be used alone. A map with -autostart=\"TYPEDIR/MAPNAME\" is needed."); | LOGERROR("-autostart-nonvisual cant be used alone. A map with -autostart=\"TYPEDIR/MAPNAME\" is needed."); | ||||
return; | return; | ||||
} | } | ||||
if (args.Has("unique-logs")) | if (args.Has("unique-logs")) | ||||
g_UniqueLogPostfix = L"_" + std::to_wstring(std::time(nullptr)) + L"_" + std::to_wstring(getpid()); | g_UniqueLogPostfix = L"_" + std::to_wstring(std::time(nullptr)) + L"_" + std::to_wstring(getpid()); | ||||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Can a game be started without the turn manager?