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.

99 lines
2.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Create a muzzle flash temp ent
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "basetempentity.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // Purpose: Dispatches user tracer stream tempentity
  13. //-----------------------------------------------------------------------------
  14. class CTEMuzzleFlash : public CBaseTempEntity
  15. {
  16. public:
  17. DECLARE_CLASS( CTEMuzzleFlash, CBaseTempEntity );
  18. DECLARE_SERVERCLASS();
  19. CTEMuzzleFlash( const char *name );
  20. virtual ~CTEMuzzleFlash( void );
  21. virtual void Test( const Vector& current_origin, const QAngle& current_angles );
  22. public:
  23. CNetworkVector( m_vecOrigin );
  24. CNetworkQAngle( m_vecAngles );
  25. CNetworkVar( float, m_flScale );
  26. CNetworkVar( int, m_nType );
  27. };
  28. //-----------------------------------------------------------------------------
  29. // Purpose:
  30. // Input : *name -
  31. //-----------------------------------------------------------------------------
  32. CTEMuzzleFlash::CTEMuzzleFlash( const char *name ) :
  33. CBaseTempEntity( name )
  34. {
  35. m_vecOrigin.Init();
  36. m_vecAngles.Init();
  37. m_flScale = 1.0f;
  38. m_nType = 0;
  39. }
  40. //-----------------------------------------------------------------------------
  41. // Purpose:
  42. //-----------------------------------------------------------------------------
  43. CTEMuzzleFlash::~CTEMuzzleFlash( void )
  44. {
  45. }
  46. //-----------------------------------------------------------------------------
  47. // Purpose:
  48. // Input : *current_origin -
  49. // *current_angles -
  50. //-----------------------------------------------------------------------------
  51. void CTEMuzzleFlash::Test( const Vector& current_origin, const QAngle& current_angles )
  52. {
  53. }
  54. IMPLEMENT_SERVERCLASS_ST( CTEMuzzleFlash, DT_TEMuzzleFlash )
  55. SendPropVector( SENDINFO(m_vecOrigin), -1, SPROP_COORD ),
  56. SendPropVector( SENDINFO(m_vecAngles), -1, SPROP_COORD ),
  57. SendPropFloat( SENDINFO(m_flScale), -1, SPROP_NOSCALE ),
  58. SendPropInt( SENDINFO(m_nType), 32, SPROP_UNSIGNED ),
  59. END_SEND_TABLE()
  60. // Singleton to fire TEMuzzleFlash objects
  61. static CTEMuzzleFlash g_TEMuzzleFlash( "MuzzleFlash" );
  62. //-----------------------------------------------------------------------------
  63. // Purpose:
  64. // Input : msg_dest -
  65. // delay -
  66. // origin -
  67. // *recipient -
  68. // *origin -
  69. // *dir -
  70. // scale -
  71. // type -
  72. //-----------------------------------------------------------------------------
  73. void TE_MuzzleFlash( IRecipientFilter& filter, float delay,
  74. const Vector &start, const QAngle &angles, float scale, int type )
  75. {
  76. g_TEMuzzleFlash.m_vecOrigin = start;
  77. g_TEMuzzleFlash.m_vecAngles = angles;
  78. g_TEMuzzleFlash.m_flScale = scale;
  79. g_TEMuzzleFlash.m_nType = type;
  80. // Send it over the wire
  81. g_TEMuzzleFlash.Create( filter, delay );
  82. }