diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index d334c0613e4..236331f6d21 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -86,7 +86,7 @@ static const ColorRGBA gs_ClientNetworkErrPrintColor{1.0f, 0.25f, 0.25f, 1.0f}; CClient::CClient() : m_DemoPlayer(&m_SnapshotDelta, true, [&]() { UpdateDemoIntraTimers(); }), m_InputtimeMarginGraph(128), - m_GametimeMarginGraph(128), + m_aGametimeMarginGraphs{128, 128}, m_FpsGraph(4096) { m_StateStartTime = time_get(); @@ -634,7 +634,7 @@ void CClient::Connect(const char *pAddress, const char *pPassword) SetState(IClient::STATE_CONNECTING); m_InputtimeMarginGraph.Init(-150.0f, 150.0f); - m_GametimeMarginGraph.Init(-150.0f, 150.0f); + m_aGametimeMarginGraphs[CONN_MAIN].Init(-150.0f, 150.0f); GenerateTimeoutCodes(aConnectAddrs, NumConnectAddrs); } @@ -753,6 +753,8 @@ void CClient::DummyConnect() m_aNetClient[CONN_DUMMY].Connect7(m_aNetClient[CONN_MAIN].ServerAddress(), 1); else m_aNetClient[CONN_DUMMY].Connect(m_aNetClient[CONN_MAIN].ServerAddress(), 1); + + m_aGametimeMarginGraphs[CONN_DUMMY].Init(-150.0f, 150.0f); } void CClient::DummyDisconnect(const char *pReason) @@ -963,8 +965,8 @@ void CClient::DebugRender() m_FpsGraph.Render(Graphics(), TextRender(), x, sp * 5, w, h, "FPS"); m_InputtimeMarginGraph.Scale(5 * time_freq()); m_InputtimeMarginGraph.Render(Graphics(), TextRender(), x, sp * 6 + h, w, h, "Prediction Margin"); - m_GametimeMarginGraph.Scale(5 * time_freq()); - m_GametimeMarginGraph.Render(Graphics(), TextRender(), x, sp * 7 + h * 2, w, h, "Gametime Margin"); + m_aGametimeMarginGraphs[g_Config.m_ClDummy].Scale(5 * time_freq()); + m_aGametimeMarginGraphs[g_Config.m_ClDummy].Render(Graphics(), TextRender(), x, sp * 7 + h * 2, w, h, "Gametime Margin"); } } @@ -2085,7 +2087,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy) int64_t Now = m_aGameTime[Conn].Get(time_get()); int64_t TickStart = GameTick * time_freq() / GameTickSpeed(); int64_t TimeLeft = (TickStart - Now) * 1000 / time_freq(); - m_aGameTime[Conn].Update(&m_GametimeMarginGraph, (GameTick - 1) * time_freq() / GameTickSpeed(), TimeLeft, CSmoothTime::ADJUSTDIRECTION_DOWN); + m_aGameTime[Conn].Update(&m_aGametimeMarginGraphs[Conn], (GameTick - 1) * time_freq() / GameTickSpeed(), TimeLeft, CSmoothTime::ADJUSTDIRECTION_DOWN); } if(m_aReceivedSnapshots[Conn] > GameTickSpeed() && !m_aCodeRunAfterJoin[Conn]) diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 9ca2699fd76..56e92ac05cf 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -187,7 +187,7 @@ class CClient : public IClient, public CDemoPlayer::IListener // graphs CGraph m_InputtimeMarginGraph; - CGraph m_GametimeMarginGraph; + CGraph m_aGametimeMarginGraphs[NUM_DUMMIES]; CGraph m_FpsGraph; // the game snapshots are modifiable by the game