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.

85 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #include "cbase.h"
  10. #include "c_basetempentity.h"
  11. #include "c_te_legacytempents.h"
  12. #include "tier0/vprof.h"
  13. // memdbgon must be the last include file in a .cpp file!!!
  14. #include "tier0/memdbgon.h"
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Bubbles TE
  17. //-----------------------------------------------------------------------------
  18. class C_TEBubbles : public C_BaseTempEntity
  19. {
  20. public:
  21. DECLARE_CLASS( C_TEBubbles, C_BaseTempEntity );
  22. DECLARE_CLIENTCLASS();
  23. C_TEBubbles( void );
  24. virtual ~C_TEBubbles( void );
  25. virtual void PostDataUpdate( DataUpdateType_t updateType );
  26. public:
  27. Vector m_vecMins;
  28. Vector m_vecMaxs;
  29. float m_fHeight;
  30. int m_nModelIndex;
  31. int m_nCount;
  32. float m_fSpeed;
  33. };
  34. //-----------------------------------------------------------------------------
  35. // Purpose:
  36. //-----------------------------------------------------------------------------
  37. C_TEBubbles::C_TEBubbles( void )
  38. {
  39. m_vecMins.Init();
  40. m_vecMaxs.Init();
  41. m_fHeight = 0.0;
  42. m_nModelIndex = 0;
  43. m_nCount = 0;
  44. m_fSpeed = 0;
  45. }
  46. //-----------------------------------------------------------------------------
  47. // Purpose:
  48. //-----------------------------------------------------------------------------
  49. C_TEBubbles::~C_TEBubbles( void )
  50. {
  51. }
  52. void TE_Bubbles( IRecipientFilter& filter, float delay,
  53. const Vector* mins, const Vector* maxs, float height, int modelindex, int count, float speed )
  54. {
  55. tempents->Bubbles( *mins, *maxs, height, modelindex, count, speed );
  56. }
  57. //-----------------------------------------------------------------------------
  58. // Purpose:
  59. // Input : bool -
  60. //-----------------------------------------------------------------------------
  61. void C_TEBubbles::PostDataUpdate( DataUpdateType_t updateType )
  62. {
  63. VPROF( "C_TEBubbles::PostDataUpdate" );
  64. tempents->Bubbles( m_vecMins, m_vecMaxs, m_fHeight, m_nModelIndex, m_nCount, m_fSpeed );
  65. }
  66. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEBubbles, DT_TEBubbles, CTEBubbles)
  67. RecvPropVector( RECVINFO(m_vecMins)),
  68. RecvPropVector( RECVINFO(m_vecMaxs)),
  69. RecvPropInt( RECVINFO(m_nModelIndex)),
  70. RecvPropFloat( RECVINFO(m_fHeight )),
  71. RecvPropInt( RECVINFO(m_nCount)),
  72. RecvPropFloat( RECVINFO(m_fSpeed )),
  73. END_RECV_TABLE()