aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/client/c_te_effect_dispatch.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/client/c_te_effect_dispatch.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/client/c_te_effect_dispatch.h')
-rw-r--r--sp/src/game/client/c_te_effect_dispatch.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/sp/src/game/client/c_te_effect_dispatch.h b/sp/src/game/client/c_te_effect_dispatch.h
new file mode 100644
index 00000000..ab62c709
--- /dev/null
+++ b/sp/src/game/client/c_te_effect_dispatch.h
@@ -0,0 +1,46 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef C_TE_EFFECT_DISPATCH_H
+#define C_TE_EFFECT_DISPATCH_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "effect_dispatch_data.h"
+
+
+typedef void (*ClientEffectCallback)( const CEffectData &data );
+
+
+class CClientEffectRegistration
+{
+public:
+ CClientEffectRegistration( const char *pEffectName, ClientEffectCallback fn );
+
+public:
+ const char *m_pEffectName;
+ ClientEffectCallback m_pFunction;
+ CClientEffectRegistration *m_pNext;
+
+ static CClientEffectRegistration *s_pHead;
+};
+
+
+//
+// Use this macro to register a client effect callback.
+// If you do DECLARE_CLIENT_EFFECT( "MyEffectName", MyCallback ), then MyCallback will be
+// called when the server does DispatchEffect( "MyEffect", data )
+//
+#define DECLARE_CLIENT_EFFECT( effectName, callbackFunction ) \
+ static CClientEffectRegistration ClientEffectReg_##callbackFunction( effectName, callbackFunction );
+
+void DispatchEffectToCallback( const char *pEffectName, const CEffectData &m_EffectData );
+void DispatchEffect( const char *pName, const CEffectData &data );
+
+#endif // C_TE_EFFECT_DISPATCH_H