diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/clientsideeffects.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/clientsideeffects.h')
| -rw-r--r-- | game/client/clientsideeffects.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/game/client/clientsideeffects.h b/game/client/clientsideeffects.h new file mode 100644 index 0000000..fd74956 --- /dev/null +++ b/game/client/clientsideeffects.h @@ -0,0 +1,98 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef CLIENTSIDEEFFECTS_H +#define CLIENTSIDEEFFECTS_H +#ifdef _WIN32 +#pragma once +#endif + +class Vector; +struct FXQuadData_t; +struct FXLineData_t; +//----------------------------------------------------------------------------- +// Purpose: Base class for client side effects +//----------------------------------------------------------------------------- +abstract_class CClientSideEffect +{ +public: + // Constructs the named effect + CClientSideEffect( const char *name ); + virtual ~CClientSideEffect( void ); + + // Update/Draw the effect + // Derived classes must implement this method! + virtual void Draw( double frametime ) = 0; + // Returns name of effect + virtual const char *GetName( void ); + // Retuns whether the effect is still active + virtual bool IsActive( void ); + // Sets the effect to inactive so it can be destroed + virtual void Destroy( void ); + + // Sets the effect name (useful for debugging). + virtual void SetEffectName( const char *pszName ); + +private: + // Name of effect ( static data ) + const char *m_pszName; + // Is the effect active + bool m_bActive; +}; + +//----------------------------------------------------------------------------- +// Purpose: Base interface to effects list +//----------------------------------------------------------------------------- +abstract_class IEffectsList +{ +public: + virtual ~IEffectsList( void ) {} + + // Add an effect to the list of effects + virtual void AddEffect( CClientSideEffect *effect ) = 0; + // Remove the specified effect + virtual void RemoveEffect( CClientSideEffect *effect ) = 0; + // Simulate/Update/Draw effects on list + virtual void DrawEffects( double frametime ) = 0; + // Flush out all effects fbrom the list + virtual void Flush( void ) = 0; +}; + +extern IEffectsList *clienteffects; + +class IMaterialSystem; +extern IMaterialSystem *materials; + +//Actual function references +void FX_AddCube( const Vector &mins, const Vector &maxs, const Vector &vColor, float life, const char *materialName ); +void FX_AddCenteredCube( const Vector ¢er, float size, const Vector &vColor, float life, const char *materialName ); +void FX_AddStaticLine( const Vector& start, const Vector& end, float scale, float life, const char *materialName, unsigned char flags ); +void FX_AddDiscreetLine( const Vector& start, const Vector& direction, float velocity, float length, float clipLength, float scale, float life, const char *shader ); + +void FX_AddLine( const FXLineData_t &data ); + +void FX_AddQuad( const FXQuadData_t &data ); + +void FX_AddQuad( const Vector &origin, + const Vector &normal, + float startSize, + float endSize, + float sizeBias, + float startAlpha, + float endAlpha, + float alphaBias, + float yaw, + float deltaYaw, + const Vector &color, + float lifeTime, + const char *shader, + unsigned int flags ); + +// For safe addition of client effects +void SetFXCreationAllowed( bool state ); +bool FXCreationAllowed( void ); + +#endif // CLIENTSIDEEFFECTS_H |