Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef CLIENTSIDEEFFECTS_H
  7. #define CLIENTSIDEEFFECTS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class Vector;
  12. struct FXQuadData_t;
  13. struct FXLineData_t;
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Base class for client side effects
  16. //-----------------------------------------------------------------------------
  17. abstract_class CClientSideEffect
  18. {
  19. public:
  20. // Constructs the named effect
  21. CClientSideEffect( const char *name );
  22. virtual ~CClientSideEffect( void );
  23. // Update/Draw the effect
  24. // Derived classes must implement this method!
  25. virtual void Draw( double frametime ) = 0;
  26. // Returns name of effect
  27. virtual const char *GetName( void );
  28. // Retuns whether the effect is still active
  29. virtual bool IsActive( void );
  30. // Sets the effect to inactive so it can be destroed
  31. virtual void Destroy( void );
  32. private:
  33. // Name of effect ( static data )
  34. const char *m_pszName;
  35. // Is the effect active
  36. bool m_bActive;
  37. };
  38. //-----------------------------------------------------------------------------
  39. // Purpose: Base interface to effects list
  40. //-----------------------------------------------------------------------------
  41. abstract_class IEffectsList
  42. {
  43. public:
  44. virtual ~IEffectsList( void ) {}
  45. // Add an effect to the list of effects
  46. virtual void AddEffect( CClientSideEffect *effect ) = 0;
  47. // Simulate/Update/Draw effects on list
  48. virtual void DrawEffects( double frametime ) = 0;
  49. // Flush out all effects fbrom the list
  50. virtual void Flush( void ) = 0;
  51. };
  52. extern IEffectsList *clienteffects;
  53. class IMaterialSystem;
  54. //Actual function references
  55. void FX_AddCube( const Vector &mins, const Vector &maxs, const Vector &vColor, float life, const char *materialName );
  56. void FX_AddCenteredCube( const Vector &center, float size, const Vector &vColor, float life, const char *materialName );
  57. void FX_AddStaticLine( const Vector& start, const Vector& end, float scale, float life, const char *materialName, unsigned char flags );
  58. void FX_AddDiscreetLine( const Vector& start, const Vector& direction, float velocity, float length, float clipLength, float scale, float life, const char *shader );
  59. void FX_AddLine( const FXLineData_t &data );
  60. void FX_AddQuad( const FXQuadData_t &data );
  61. void FX_AddQuad( const Vector &origin,
  62. const Vector &normal,
  63. float startSize,
  64. float endSize,
  65. float sizeBias,
  66. float startAlpha,
  67. float endAlpha,
  68. float alphaBias,
  69. float yaw,
  70. float deltaYaw,
  71. const Vector &color,
  72. float lifeTime,
  73. const char *shader,
  74. unsigned int flags );
  75. // For safe addition of client effects
  76. void SetFXCreationAllowed( bool state );
  77. bool FXCreationAllowed( void );
  78. #endif // CLIENTSIDEEFFECTS_H