about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-17 12:28:37 +0100
committeroy <Tom_Adams@web.de>2011-01-17 12:28:37 +0100
commit216967c3bf72ccff9d069327a5531e50f8f88b5a (patch)
treeedda4389c670ddbb9e37885a948f5231babbf496 /src/engine
parent5483eb66294aabea76624659886a7c39a0758e66 (diff)
downloadzcatch-216967c3bf72ccff9d069327a5531e50f8f88b5a.tar.gz
zcatch-216967c3bf72ccff9d069327a5531e50f8f88b5a.zip
release gameclient components when opening the editor. Closes #429
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client.h1
-rw-r--r--src/engine/client/client.cpp10
-rw-r--r--src/engine/client/client.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/engine/client.h b/src/engine/client.h
index 80a0241d..a0ebb3e7 100644
--- a/src/engine/client.h
+++ b/src/engine/client.h
@@ -149,6 +149,7 @@ public:
 	virtual void OnConnected() = 0;
 	virtual void OnMessage(int MsgId, CUnpacker *pUnpacker) = 0;
 	virtual void OnPredict() = 0;
+	virtual void OnActivateEditor() = 0;
 	
 	virtual int OnSnapInput(int *pData) = 0;
 	
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp
index d67e3332..9b8c4151 100644
--- a/src/engine/client/client.cpp
+++ b/src/engine/client/client.cpp
@@ -414,6 +414,7 @@ CClient::CClient() : m_DemoPlayer(&m_SnapshotDelta), m_DemoRecorder(&m_SnapshotD
 	m_WindowMustRefocus = 0;
 	m_SnapCrcErrors = 0;
 	m_AutoScreenshotRecycle = false;
+	m_EditorActive = false;
 
 	m_AckGameTick = -1;
 	m_CurrentRecvTick = 0;
@@ -1914,12 +1915,21 @@ void CClient::Run()
 		// render
 		if(g_Config.m_ClEditor)
 		{
+			if(!m_EditorActive)
+			{
+				GameClient()->OnActivateEditor();
+				m_EditorActive = true;
+			}
+
 			Update();
 			m_pEditor->UpdateAndRender();
 			m_pGraphics->Swap();
 		}
 		else
 		{
+			if(m_EditorActive)
+				m_EditorActive = false;
+
 			Update();
 
 			if(g_Config.m_DbgStress)
diff --git a/src/engine/client/client.h b/src/engine/client/client.h
index 406b0ac7..f25e7cf7 100644
--- a/src/engine/client/client.h
+++ b/src/engine/client/client.h
@@ -141,6 +141,7 @@ class CClient : public IClient, public CDemoPlayer::IListner
 	int m_WindowMustRefocus;
 	int m_SnapCrcErrors;
 	bool m_AutoScreenshotRecycle;
+	bool m_EditorActive;
 
 	int m_AckGameTick;
 	int m_CurrentRecvTick;