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.

73 lines
3.1 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Declares the PaintPowerInfo structure for storing information about
  4. // the paint powers used.
  5. //
  6. //=============================================================================//
  7. #ifndef PAINT_POWER_INFO_H
  8. #define PAINT_POWER_INFO_H
  9. #include "paint_color_manager.h"
  10. enum PaintPowerState
  11. {
  12. ACTIVATING_PAINT_POWER,
  13. ACTIVE_PAINT_POWER,
  14. DEACTIVATING_PAINT_POWER,
  15. INACTIVE_PAINT_POWER
  16. };
  17. //=============================================================================
  18. // struct PaintPowerInfo
  19. // Purpose: Holds the necessary information for using a paint power.
  20. // Note: This will change quite a bit once the paint tech is implemented.
  21. //=============================================================================
  22. struct PaintPowerInfo_t
  23. {
  24. DECLARE_SIMPLE_DATADESC();
  25. DECLARE_PREDICTABLE();
  26. DECLARE_CLASS_NOBASE( PaintPowerInfo_t );
  27. DECLARE_EMBEDDED_NETWORKVAR();
  28. Vector m_SurfaceNormal; // Normal to the surface the paint is on
  29. Vector m_ContactPoint; // Contact point on the surface
  30. PaintPowerType m_PaintPowerType; // Paint power at this point on the surface
  31. CBaseHandle m_HandleToOther; // Handle to the other entity
  32. PaintPowerState m_State; // Current state of the power
  33. bool m_IsOnThinSurface; // The power is on a thin surface
  34. PaintPowerInfo_t();
  35. PaintPowerInfo_t( const Vector& normal,
  36. const Vector& contactPt,
  37. CBaseEntity* pOther,
  38. PaintPowerType power = NO_POWER,
  39. bool isOnThinSurface = false );
  40. };
  41. //=============================================================================
  42. // Helper Functions and Functors
  43. //=============================================================================
  44. extern bool AreSamePower( const PaintPowerInfo_t& powerA, const PaintPowerInfo_t& powerB );
  45. extern bool AreDifferentPowers( const PaintPowerInfo_t& powerA, const PaintPowerInfo_t& powerB );
  46. extern bool IsSpeedPower( const PaintPowerInfo_t& power );
  47. extern bool IsBouncePower( const PaintPowerInfo_t& power );
  48. extern bool IsStickPower( const PaintPowerInfo_t& power );
  49. extern bool IsNoPower( const PaintPowerInfo_t& power );
  50. extern bool IsActivatingPower( const PaintPowerInfo_t& power );
  51. extern bool IsActivePower( const PaintPowerInfo_t& power );
  52. extern bool IsDeactivatingPower( const PaintPowerInfo_t& power );
  53. extern bool IsInactivePower( const PaintPowerInfo_t& power );
  54. char const *const PowerTypeToString( const PaintPowerInfo_t& powerInfo );
  55. char const *const PowerTypeToString( PaintPowerType type );
  56. char const *const PowerStateToString( const PaintPowerInfo_t& powerInfo );
  57. char const *const PowerStateToString( PaintPowerState state );
  58. void PrintPowerInfoDebugMsg( const PaintPowerInfo_t& powerInfo );
  59. void DrawPaintPowerContactInfo( const PaintPowerInfo_t& powerInfo, const Color& color, float duration, bool noDepthTest );
  60. int DescendingPaintPriorityCompare( const PaintPowerInfo_t* a, const PaintPowerInfo_t* b );
  61. int AscendingPaintPriorityCompare( const PaintPowerInfo_t* a, const PaintPowerInfo_t* b );
  62. #endif // ifndef PAINT_POWER_INFO_H