about summary refs log tree commit diff
path: root/src/game/client/components/spectator.h
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-03-10 10:08:14 +0100
committeroy <Tom_Adams@web.de>2011-03-10 10:08:14 +0100
commitee2f625754ca9f01be6732550f16098c5afa704a (patch)
tree9776edf90fac02d1bf03606dbc8b79fd071ed917 /src/game/client/components/spectator.h
parent6205583d6411e300edd1ebf2eb170fbc8e7119e8 (diff)
downloadzcatch-ee2f625754ca9f01be6732550f16098c5afa704a.tar.gz
zcatch-ee2f625754ca9f01be6732550f16098c5afa704a.zip
added extended spectator mode. Closes #28
Diffstat (limited to 'src/game/client/components/spectator.h')
-rw-r--r--src/game/client/components/spectator.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/game/client/components/spectator.h b/src/game/client/components/spectator.h
new file mode 100644
index 00000000..607780f5
--- /dev/null
+++ b/src/game/client/components/spectator.h
@@ -0,0 +1,37 @@
+/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
+/* If you are missing that file, acquire a complete release at teeworlds.com.                */
+#ifndef GAME_CLIENT_COMPONENTS_SPECTATOR_H
+#define GAME_CLIENT_COMPONENTS_SPECTATOR_H
+#include <base/vmath.h>
+
+#include <game/client/component.h>
+
+class CSpectator : public CComponent
+{
+	enum
+	{
+		NO_SELECTION=-2,
+	};
+
+	bool m_Active;
+	bool m_WasActive;
+	
+	int m_SelectedSpectatorID;
+	vec2 m_SelectorMouse;
+
+	static void ConKeySpectator(IConsole::IResult *pResult, void *pUserData);
+	static void ConSpectate(IConsole::IResult *pResult, void *pUserData);
+	
+public:
+	CSpectator();
+	
+	virtual void OnConsoleInit();
+	virtual bool OnMouseMove(float x, float y);
+	virtual void OnRender();
+	virtual void OnRelease();
+	virtual void OnReset();
+
+	void Spectate(int SpectatorID);
+};
+
+#endif