summaryrefslogtreecommitdiff
path: root/game/client/particle_prototype.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/particle_prototype.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/particle_prototype.h')
-rw-r--r--game/client/particle_prototype.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/game/client/particle_prototype.h b/game/client/particle_prototype.h
new file mode 100644
index 0000000..ff4d690
--- /dev/null
+++ b/game/client/particle_prototype.h
@@ -0,0 +1,70 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+
+// This defines things that allow particle effects to hook into the particle app.
+#ifndef PARTICLE_PROTOTYPE_H
+#define PARTICLE_PROTOTYPE_H
+
+
+class CParticleMgr;
+class RecvTable;
+
+
+// Command-line args can be passed in to set state or options in the effects.
+class IPrototypeArgAccess
+{
+public:
+ virtual const char* FindArg(const char *pName, const char *pDefault=0)=0;
+};
+
+
+
+// You must implement this interface for the prototype app to be able to run your effect.
+class IPrototypeAppEffect
+{
+public:
+ virtual ~IPrototypeAppEffect() {}
+
+ // Start the effect. You can get command-line args with pArgs.
+ virtual void Start(CParticleMgr *pParticleMgr, IPrototypeArgAccess *pArgs)=0;
+
+ // Return false if you don't allow properties to be edited in the prototype app.
+ virtual bool GetPropEditInfo(RecvTable **ppTable, void **ppObj) {return false;}
+};
+
+
+
+// Used internally.
+typedef IPrototypeAppEffect* (*PrototypeEffectCreateFn)();
+class PrototypeEffectLink
+{
+public:
+ PrototypeEffectLink(PrototypeEffectCreateFn fn, const char *pName);
+
+ PrototypeEffectCreateFn m_CreateFn;
+ const char *m_pEffectName;
+ PrototypeEffectLink *m_pNext;
+};
+
+
+#ifdef PARTICLEPROTOTYPE_APP
+ extern PrototypeEffectLink *g_pPrototypeEffects; // The list of prototype effects..
+
+
+ // Expose your effect with this macro.
+ #define EXPOSE_PROTOTYPE_EFFECT(effectName, className) \
+ static IPrototypeAppEffect* ___Create##effectName##() {return new className;} \
+ static PrototypeEffectLink ___effectlink_##effectName##(___Create##effectName##, #effectName);
+#else
+ #define EXPOSE_PROTOTYPE_EFFECT(effectName, className)
+#endif
+
+
+#endif
+
+