Changeset View
Changeset View
Standalone View
Standalone View
source/ps/Replay.cpp
Show First 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | while ((*m_Stream >> type).good()) | ||||
{ | { | ||||
std::string replayHash; | std::string replayHash; | ||||
*m_Stream >> replayHash; | *m_Stream >> replayHash; | ||||
TestHash(type, replayHash, testHashFull, testHashQuick); | TestHash(type, replayHash, testHashFull, testHashQuick); | ||||
} | } | ||||
else if (type == "end") | else if (type == "end") | ||||
{ | { | ||||
{ | { | ||||
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()); | ||||
g_Game->GetSimulation2()->Update(turnLength, commands); | g_Game->GetSimulation2()->Update(turnLength, commands); | ||||
commands.clear(); | commands.clear(); | ||||
} | } | ||||
g_Profiler.Frame(); | g_Profiler.Frame(); | ||||
if (turn % PROFILE_TURN_INTERVAL == 0) | if (turn % PROFILE_TURN_INTERVAL == 0) | ||||
g_ProfileViewer.SaveToFile(); | g_ProfileViewer.SaveToFile(); | ||||
} | } | ||||
else | else | ||||
debug_printf("Unrecognised replay token %s\n", type.c_str()); | debug_printf("Unrecognised replay token %s\n", type.c_str()); | ||||
} | } | ||||
} | } | ||||
SAFE_DELETE(m_Stream); | SAFE_DELETE(m_Stream); | ||||
g_Profiler2.SaveToFile(); | g_Profiler2->SaveToFile(); | ||||
std::string hash; | std::string hash; | ||||
bool ok = g_Game->GetSimulation2()->ComputeStateHash(hash, false); | bool ok = g_Game->GetSimulation2()->ComputeStateHash(hash, false); | ||||
ENSURE(ok); | ENSURE(ok); | ||||
debug_printf("# Final state: %s\n", Hexify(hash).c_str()); | debug_printf("# Final state: %s\n", Hexify(hash).c_str()); | ||||
timer_DisplayClientTotals(); | timer_DisplayClientTotals(); | ||||
SAFE_DELETE(g_Game); | SAFE_DELETE(g_Game); | ||||
Show All 26 Lines |
Wildfire Games · Phabricator