From bd9850cae2d17b713e5795ed1e90d4cea1f165b8 Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 8 Dec 2010 00:02:24 +0100 Subject: [PATCH] added single function to stop recording by Batchyx --- src/engine/client.h | 1 + src/engine/client/client.cpp | 13 +++++++++---- src/engine/client/client.h | 1 + src/game/client/components/menus_ingame.cpp | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/engine/client.h b/src/engine/client.h index 454f5d8a9..100ed408b 100644 --- a/src/engine/client.h +++ b/src/engine/client.h @@ -77,6 +77,7 @@ public: virtual void Quit() = 0; virtual const char *DemoPlayer_Play(const char *pFilename, int StorageType) = 0; virtual void DemoRecorder_Start(const char *pFilename) = 0; + virtual void DemoRecorder_Stop() = 0; // networking virtual void EnterGame() = 0; diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 7cd61b9bf..3db258132 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -526,7 +526,7 @@ void CClient::Connect(const char *pAddress) SetState(IClient::STATE_CONNECTING); if(m_DemoRecorder.IsRecording()) - m_DemoRecorder.Stop(); + DemoRecorder_Stop(); m_InputtimeMarginGraph.Init(-150.0f, 150.0f); m_GametimeMarginGraph.Init(-150.0f, 150.0f); @@ -540,7 +540,7 @@ void CClient::DisconnectWithReason(const char *pReason) // stop demo playback and recorder m_DemoPlayer.Stop(); - m_DemoRecorder.Stop(); + DemoRecorder_Stop(); // m_RconAuthed = 0; @@ -780,7 +780,7 @@ const char *CClient::LoadMap(const char *pName, const char *pFilename, unsigned } // stop demo recording if we loaded a new map - m_DemoRecorder.Stop(); + DemoRecorder_Stop(); char aBuf[256]; str_format(aBuf, sizeof(aBuf), "loaded map '%s'", pFilename); @@ -1938,6 +1938,11 @@ void CClient::DemoRecorder_Start(const char *pFilename) } } +void CClient::DemoRecorder_Stop() +{ + m_DemoRecorder.Stop(); +} + void CClient::Con_Record(IConsole::IResult *pResult, void *pUserData) { CClient *pSelf = (CClient *)pUserData; @@ -1947,7 +1952,7 @@ void CClient::Con_Record(IConsole::IResult *pResult, void *pUserData) void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData) { CClient *pSelf = (CClient *)pUserData; - pSelf->m_DemoRecorder.Stop(); + pSelf->DemoRecorder_Stop(); } void CClient::RegisterCommands() diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 07b1d08c1..b6a82199c 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -285,6 +285,7 @@ public: const char *DemoPlayer_Play(const char *pFilename, int StorageType); void DemoRecorder_Start(const char *pFilename); + void DemoRecorder_Stop(); virtual class CEngine *Engine() { return &m_Engine; } }; diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index eacabebaf..75292249e 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -110,7 +110,7 @@ void CMenus::RenderGame(CUIRect MainView) Client()->DemoRecorder_Start(aFilename); } else - DemoRecorder()->Stop(); + Client()->DemoRecorder_Stop(); } /*