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.

86 lines
3.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef PARTICLE_PARSE_H
  7. #define PARTICLE_PARSE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "utlvector.h"
  12. #include "utlstring.h"
  13. #include "ifilelist.h"
  14. //-----------------------------------------------------------------------------
  15. // Particle attachment methods
  16. //-----------------------------------------------------------------------------
  17. enum ParticleAttachment_t
  18. {
  19. PATTACH_ABSORIGIN = 0, // Create at absorigin, but don't follow
  20. PATTACH_ABSORIGIN_FOLLOW, // Create at absorigin, and update to follow the entity
  21. PATTACH_CUSTOMORIGIN, // Create at a custom origin, but don't follow
  22. PATTACH_POINT, // Create on attachment point, but don't follow
  23. PATTACH_POINT_FOLLOW, // Create on attachment point, and update to follow the entity
  24. PATTACH_WORLDORIGIN, // Used for control points that don't attach to an entity
  25. PATTACH_ROOTBONE_FOLLOW, // Create at the root bone of the entity, and update to follow
  26. MAX_PATTACH_TYPES,
  27. };
  28. extern int GetAttachTypeFromString( const char *pszString );
  29. #define PARTICLE_DISPATCH_FROM_ENTITY (1<<0)
  30. #define PARTICLE_DISPATCH_RESET_PARTICLES (1<<1)
  31. struct te_tf_particle_effects_colors_t
  32. {
  33. Vector m_vecColor1;
  34. Vector m_vecColor2;
  35. };
  36. struct te_tf_particle_effects_control_point_t
  37. {
  38. ParticleAttachment_t m_eParticleAttachment;
  39. Vector m_vecOffset;
  40. };
  41. //-----------------------------------------------------------------------------
  42. // Particle parsing methods
  43. //-----------------------------------------------------------------------------
  44. // Parse the particle manifest file & register the effects within it
  45. // Only needs to be called once per game, unless tools change particle definitions
  46. void ParseParticleEffects( bool bLoadSheets, bool bPrecache );
  47. void ParseParticleEffectsMap( const char *pMapName, bool bLoadSheets, IFileList *pFilesToReload = NULL );
  48. // Get a list of the files inside the particle manifest file
  49. void GetParticleManifest( CUtlVector<CUtlString>& list );
  50. // Precaches standard particle systems (only necessary on server)
  51. // Should be called once per level
  52. void PrecacheStandardParticleSystems( );
  53. class IFileList;
  54. void ReloadParticleEffectsInList( IFileList *pFilesToReload );
  55. //-----------------------------------------------------------------------------
  56. // Particle spawning methods
  57. //-----------------------------------------------------------------------------
  58. void DispatchParticleEffect( const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity, const char *pszAttachmentName, bool bResetAllParticlesOnEntity = false );
  59. void DispatchParticleEffect( const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity = NULL, int iAttachmentPoint = -1, bool bResetAllParticlesOnEntity = false );
  60. void DispatchParticleEffect( const char *pszParticleName, Vector vecOrigin, QAngle vecAngles, CBaseEntity *pEntity = NULL );
  61. void DispatchParticleEffect( const char *pszParticleName, Vector vecOrigin, Vector vecStart, QAngle vecAngles, CBaseEntity *pEntity = NULL );
  62. void DispatchParticleEffect( int iEffectIndex, Vector vecOrigin, Vector vecStart, QAngle vecAngles, CBaseEntity *pEntity = NULL );
  63. void DispatchParticleEffect( const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity, const char *pszAttachmentName, Vector vecColor1, Vector vecColor2, bool bUseColors=true, bool bResetAllParticlesOnEntity = false );
  64. void DispatchParticleEffect( const char *pszParticleName, Vector vecOrigin, QAngle vecAngles, Vector vecColor1, Vector vecColor2, bool bUseColors=true, CBaseEntity *pEntity = NULL, int iAttachType = PATTACH_CUSTOMORIGIN );
  65. void StopParticleEffects( CBaseEntity *pEntity );
  66. #endif // PARTICLE_PARSE_H