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.

107 lines
5.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //===========================================================================//
  9. #if !defined( FX_H )
  10. #define FX_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "mathlib/vector.h"
  15. #include "particles_simple.h"
  16. #include "c_pixel_visibility.h"
  17. class Vector;
  18. class CGameTrace;
  19. typedef CGameTrace trace_t;
  20. //struct trace_t;
  21. enum
  22. {
  23. FX_ENERGYSPLASH_EXPLOSIVE = 0x1,
  24. FX_ENERGYSPLASH_SMOKE = 0x2,
  25. FX_ENERGYSPLASH_LITTLESPARKS = 0x4,
  26. FX_ENERGYSPLASH_BIGSPARKS = 0x8,
  27. FX_ENERGYSPLASH_BIGSPARKSCOLLIDE = 0x10,
  28. FX_ENERGYSPLASH_ENERGYBALLS = 0x20,
  29. FX_ENERGYSPLASH_DLIGHT = 0x40,
  30. FX_ENERGYSPLASH_DEFAULT = ~FX_ENERGYSPLASH_EXPLOSIVE,
  31. FX_ENERGYSPLASH_DEFAULT_EXPLOSIVE = ~0,
  32. };
  33. bool FX_GetAttachmentTransform( ClientEntityHandle_t hEntity, int attachmentIndex, matrix3x4_t &transform );
  34. bool FX_GetAttachmentTransform( ClientEntityHandle_t hEntity, int attachmentIndex, Vector *origin, QAngle *angles );
  35. void FX_RicochetSound( const Vector& pos );
  36. void FX_AntlionImpact( const Vector &pos, trace_t *tr );
  37. void FX_DebrisFlecks( const Vector& origin, trace_t *trace, char materialType, int iScale, bool bNoFlecks = false );
  38. void FX_Tracer( Vector& start, Vector& end, int velocity, bool makeWhiz = true );
  39. void FX_GunshipTracer( Vector& start, Vector& end, int velocity, bool makeWhiz = true );
  40. void FX_StriderTracer( Vector& start, Vector& end, int velocity, bool makeWhiz = true );
  41. void FX_HunterTracer( Vector& start, Vector& end, int velocity, bool makeWhiz = true );
  42. void FX_PlayerTracer( Vector& start, Vector& end );
  43. void FX_BulletPass( Vector& start, Vector& end );
  44. void FX_MetalSpark( const Vector &position, const Vector &direction, const Vector &surfaceNormal, int iScale = 1 );
  45. void FX_MetalScrape( Vector &position, Vector &normal );
  46. void FX_Sparks( const Vector &pos, int nMagnitude, int nTrailLength, const Vector &vecDir, float flWidth, float flMinSpeed, float flMaxSpeed, char *pSparkMaterial = NULL );
  47. void FX_ElectricSpark( const Vector &pos, int nMagnitude, int nTrailLength, const Vector *vecDir );
  48. void FX_BugBlood( Vector &pos, Vector &dir, Vector &vWorldMins, Vector &vWorldMaxs );
  49. void FX_Blood( Vector &pos, Vector &dir, float r, float g, float b, float a );
  50. void FX_CreateImpactDust( Vector &origin, Vector &normal );
  51. void FX_EnergySplash( const Vector &pos, const Vector &normal, int nFlags = FX_ENERGYSPLASH_DEFAULT );
  52. void FX_MicroExplosion( Vector &position, Vector &normal );
  53. void FX_Explosion( Vector& origin, Vector& normal, char materialType );
  54. void FX_ConcussiveExplosion( Vector& origin, Vector& normal );
  55. void FX_DustImpact( const Vector &origin, trace_t *tr, int iScale );
  56. void FX_DustImpact( const Vector &origin, trace_t *tr, float flScale );
  57. void FX_MuzzleEffect( const Vector &origin, const QAngle &angles, float scale, ClientEntityHandle_t hEntity, unsigned char *pFlashColor = NULL, bool bOneFrame = false );
  58. void FX_MuzzleEffectAttached( float scale, ClientEntityHandle_t hEntity, int attachmentIndex, unsigned char *pFlashColor = NULL, bool bOneFrame = false );
  59. void FX_StriderMuzzleEffect( const Vector &origin, const QAngle &angles, float scale, ClientEntityHandle_t hEntity, unsigned char *pFlashColor = NULL );
  60. void FX_GunshipMuzzleEffect( const Vector &origin, const QAngle &angles, float scale, ClientEntityHandle_t hEntity, unsigned char *pFlashColor = NULL );
  61. CSmartPtr<CSimpleEmitter> FX_Smoke( const Vector &origin, const Vector &velocity, float scale, int numParticles, float flDietime, unsigned char *pColor, int iAlpha, const char *pMaterial, float flRoll, float flRollDelta );
  62. void FX_Smoke( const Vector &origin, const QAngle &angles, float scale, int numParticles, unsigned char *pColor = NULL, int iAlpha = -1 );
  63. void FX_Dust( const Vector &vecOrigin, const Vector &vecDirection, float flSize, float flSpeed );
  64. void FX_CreateGaussExplosion( const Vector &pos, const Vector &dir, int type );
  65. void FX_GaussTracer( Vector& start, Vector& end, int velocity, bool makeWhiz = true );
  66. void FX_TracerSound( const Vector &start, const Vector &end, int iTracerType );
  67. // Lighting information utility
  68. void UTIL_GetNormalizedColorTintAndLuminosity( const Vector &color, Vector *tint = NULL, float *luminosity = NULL );
  69. // Useful function for testing whether to draw noZ effects
  70. bool EffectOccluded( const Vector &pos, pixelvis_handle_t *queryHandle = 0 );
  71. class CTeslaInfo
  72. {
  73. public:
  74. Vector m_vPos;
  75. QAngle m_vAngles;
  76. int m_nEntIndex;
  77. char *m_pszSpriteName;
  78. float m_flBeamWidth;
  79. int m_nBeams;
  80. Vector m_vColor;
  81. float m_flTimeVisible;
  82. float m_flRadius;
  83. };
  84. void FX_Tesla( const CTeslaInfo &teslaInfo );
  85. extern ConVar r_decals;
  86. extern PMaterialHandle g_Mat_Fleck_Wood[2];
  87. extern PMaterialHandle g_Mat_Fleck_Cement[2];
  88. extern PMaterialHandle g_Mat_Fleck_Antlion[2];
  89. extern PMaterialHandle g_Mat_Fleck_Tile[2];
  90. extern PMaterialHandle g_Mat_DustPuff[2];
  91. extern PMaterialHandle g_Mat_BloodPuff[2];
  92. extern PMaterialHandle g_Mat_Fleck_Glass[2];
  93. extern PMaterialHandle g_Mat_SMG_Muzzleflash[4];
  94. extern PMaterialHandle g_Mat_Combine_Muzzleflash[3];
  95. #endif // FX_H