Team Fortress 2 Source Code as on 22/4/2020
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.

139 lines
2.8 KiB

  1. //========= Copyright 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. #include "particle_parse.h"
  13. #ifdef CLIENT_DLL
  14. #include "dt_recv.h"
  15. #include "client_class.h"
  16. EXTERN_RECV_TABLE( DT_EffectData );
  17. #else
  18. #include "dt_send.h"
  19. #include "server_class.h"
  20. EXTERN_SEND_TABLE( DT_EffectData );
  21. #endif
  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. #define CUSTOM_COLOR_CP1 9
  26. #define CUSTOM_COLOR_CP2 10
  27. // This is the class that holds whatever data we're sending down to the client to make the effect.
  28. class CEffectData
  29. {
  30. public:
  31. Vector m_vOrigin;
  32. Vector m_vStart;
  33. Vector m_vNormal;
  34. QAngle m_vAngles;
  35. int m_fFlags;
  36. #ifdef CLIENT_DLL
  37. ClientEntityHandle_t m_hEntity;
  38. #else
  39. int m_nEntIndex;
  40. #endif
  41. float m_flScale;
  42. float m_flMagnitude;
  43. float m_flRadius;
  44. int m_nAttachmentIndex;
  45. short m_nSurfaceProp;
  46. // Some TF2 specific things
  47. int m_nMaterial;
  48. int m_nDamageType;
  49. int m_nHitBox;
  50. unsigned char m_nColor;
  51. // Color customizability
  52. bool m_bCustomColors;
  53. te_tf_particle_effects_colors_t m_CustomColors;
  54. bool m_bControlPoint1;
  55. te_tf_particle_effects_control_point_t m_ControlPoint1;
  56. // Don't mess with stuff below here. DispatchEffect handles all of this.
  57. public:
  58. CEffectData()
  59. {
  60. m_vOrigin.Init();
  61. m_vStart.Init();
  62. m_vNormal.Init();
  63. m_vAngles.Init();
  64. m_fFlags = 0;
  65. #ifdef CLIENT_DLL
  66. m_hEntity = INVALID_EHANDLE_INDEX;
  67. #else
  68. m_nEntIndex = 0;
  69. #endif
  70. m_flScale = 1.f;
  71. m_nAttachmentIndex = 0;
  72. m_nSurfaceProp = 0;
  73. m_flMagnitude = 0.0f;
  74. m_flRadius = 0.0f;
  75. m_nMaterial = 0;
  76. m_nDamageType = 0;
  77. m_nHitBox = 0;
  78. m_nColor = 0;
  79. m_bCustomColors = false;
  80. m_CustomColors.m_vecColor1.Init();
  81. m_CustomColors.m_vecColor2.Init();
  82. m_bControlPoint1 = false;
  83. m_ControlPoint1.m_eParticleAttachment = PATTACH_ABSORIGIN;
  84. m_ControlPoint1.m_vecOffset.Init();
  85. }
  86. int GetEffectNameIndex() { return m_iEffectName; }
  87. #ifdef CLIENT_DLL
  88. IClientRenderable *GetRenderable() const;
  89. C_BaseEntity *GetEntity() const;
  90. int entindex() const;
  91. #endif
  92. private:
  93. #ifdef CLIENT_DLL
  94. DECLARE_CLIENTCLASS_NOBASE()
  95. #else
  96. DECLARE_SERVERCLASS_NOBASE()
  97. #endif
  98. int m_iEffectName; // Entry in the EffectDispatch network string table. The is automatically handled by DispatchEffect().
  99. };
  100. #define MAX_EFFECT_DISPATCH_STRING_BITS 10
  101. #define MAX_EFFECT_DISPATCH_STRINGS ( 1 << MAX_EFFECT_DISPATCH_STRING_BITS )
  102. #ifdef CLIENT_DLL
  103. bool SuppressingParticleEffects();
  104. void SuppressParticleEffects( bool bSuppress );
  105. #endif
  106. #endif // EFFECT_DISPATCH_DATA_H