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.

129 lines
2.5 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef EFFECT_DISPATCH_DATA_H
  8. #define EFFECT_DISPATCH_DATA_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #ifdef CLIENT_DLL
  13. #include "dt_recv.h"
  14. #include "client_class.h"
  15. EXTERN_RECV_TABLE( DT_EffectData );
  16. #else
  17. #include "dt_send.h"
  18. #include "server_class.h"
  19. EXTERN_SEND_TABLE( DT_EffectData );
  20. #endif
  21. #define EFFECTDATA_SERVER_IGNOREPREDICTIONCULL 0x4
  22. // NOTE: These flags are specifically *not* networked; so it's placed above the max effect flag bits
  23. #define EFFECTDATA_NO_RECORD 0x80000000
  24. #define MAX_EFFECT_FLAG_BITS 8
  25. // This is the class that holds whatever data we're sending down to the client to make the effect.
  26. class CEffectData
  27. {
  28. public:
  29. Vector m_vOrigin;
  30. Vector m_vStart;
  31. Vector m_vNormal;
  32. QAngle m_vAngles;
  33. int m_fFlags;
  34. #ifdef CLIENT_DLL
  35. ClientEntityHandle_t m_hEntity;
  36. #else
  37. int m_nEntIndex;
  38. #endif
  39. float m_flScale;
  40. float m_flMagnitude;
  41. float m_flRadius;
  42. int m_nAttachmentIndex;
  43. short m_nSurfaceProp;
  44. // Some TF2 specific things
  45. int m_nMaterial;
  46. int m_nDamageType;
  47. int m_nHitBox;
  48. int m_nOtherEntIndex;
  49. unsigned char m_nColor;
  50. bool m_bPositionsAreRelativeToEntity;
  51. // Don't mess with stuff below here. DispatchEffect handles all of this.
  52. public:
  53. CEffectData()
  54. {
  55. m_vOrigin.Init();
  56. m_vStart.Init();
  57. m_vNormal.Init();
  58. m_vAngles.Init();
  59. m_fFlags = 0;
  60. #ifdef CLIENT_DLL
  61. m_hEntity = INVALID_EHANDLE;
  62. #else
  63. m_nEntIndex = 0;
  64. #endif
  65. m_flScale = 1.f;
  66. m_nAttachmentIndex = 0;
  67. m_nSurfaceProp = 0;
  68. m_flMagnitude = 0.0f;
  69. m_flRadius = 0.0f;
  70. m_nMaterial = 0;
  71. m_nDamageType = 0;
  72. m_nHitBox = 0;
  73. m_nColor = 0;
  74. m_nOtherEntIndex = 0;
  75. m_bPositionsAreRelativeToEntity = false;
  76. }
  77. int GetEffectNameIndex() { return m_iEffectName; }
  78. #ifdef CLIENT_DLL
  79. IClientRenderable *GetRenderable() const;
  80. C_BaseEntity *GetEntity() const;
  81. int entindex() const;
  82. #endif
  83. private:
  84. #ifdef CLIENT_DLL
  85. DECLARE_CLIENTCLASS_NOBASE()
  86. #else
  87. DECLARE_SERVERCLASS_NOBASE()
  88. #endif
  89. int m_iEffectName; // Entry in the EffectDispatch network string table. The is automatically handled by DispatchEffect().
  90. };
  91. #define MAX_EFFECT_DISPATCH_STRING_BITS 10
  92. #define MAX_EFFECT_DISPATCH_STRINGS ( 1 << MAX_EFFECT_DISPATCH_STRING_BITS )
  93. #ifdef CLIENT_DLL
  94. bool SuppressingParticleEffects();
  95. void SuppressParticleEffects( bool bSuppress );
  96. #endif
  97. #endif // EFFECT_DISPATCH_DATA_H