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.

123 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PLAYERNET_VARS_H
  8. #define PLAYERNET_VARS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "shared_classnames.h"
  13. #define NUM_AUDIO_LOCAL_SOUNDS 8
  14. // These structs are contained in each player's local data and shared by the client & server
  15. struct fogparams_t
  16. {
  17. DECLARE_CLASS_NOBASE( fogparams_t );
  18. DECLARE_EMBEDDED_NETWORKVAR();
  19. #ifndef CLIENT_DLL
  20. DECLARE_SIMPLE_DATADESC();
  21. #endif
  22. bool operator !=( const fogparams_t& other ) const;
  23. CNetworkVector( dirPrimary );
  24. CNetworkColor32( colorPrimary );
  25. CNetworkColor32( colorSecondary );
  26. CNetworkColor32( colorPrimaryLerpTo );
  27. CNetworkColor32( colorSecondaryLerpTo );
  28. CNetworkVar( float, start );
  29. CNetworkVar( float, end );
  30. CNetworkVar( float, farz );
  31. CNetworkVar( float, maxdensity );
  32. CNetworkVar( float, startLerpTo );
  33. CNetworkVar( float, endLerpTo );
  34. CNetworkVar( float, lerptime );
  35. CNetworkVar( float, duration );
  36. CNetworkVar( bool, enable );
  37. CNetworkVar( bool, blend );
  38. };
  39. // Crappy. Needs to be here because it wants to use
  40. #ifdef CLIENT_DLL
  41. #define CFogController C_FogController
  42. #endif
  43. class CFogController;
  44. struct fogplayerparams_t
  45. {
  46. DECLARE_CLASS_NOBASE( fogplayerparams_t );
  47. DECLARE_EMBEDDED_NETWORKVAR();
  48. #ifndef CLIENT_DLL
  49. DECLARE_SIMPLE_DATADESC();
  50. #endif
  51. CNetworkHandle( CFogController, m_hCtrl );
  52. float m_flTransitionTime;
  53. color32 m_OldColor;
  54. float m_flOldStart;
  55. float m_flOldEnd;
  56. color32 m_NewColor;
  57. float m_flNewStart;
  58. float m_flNewEnd;
  59. fogplayerparams_t()
  60. {
  61. m_hCtrl.Set( NULL );
  62. m_flTransitionTime = -1.0f;
  63. m_OldColor.r = m_OldColor.g = m_OldColor.b = m_OldColor.a = 0;
  64. m_flOldStart = 0.0f;
  65. m_flOldEnd = 0.0f;
  66. m_NewColor.r = m_NewColor.g = m_NewColor.b = m_NewColor.a = 0;
  67. m_flNewStart = 0.0f;
  68. m_flNewEnd = 0.0f;
  69. }
  70. };
  71. struct sky3dparams_t
  72. {
  73. DECLARE_CLASS_NOBASE( sky3dparams_t );
  74. DECLARE_EMBEDDED_NETWORKVAR();
  75. #ifndef CLIENT_DLL
  76. DECLARE_SIMPLE_DATADESC();
  77. #endif
  78. // 3d skybox camera data
  79. CNetworkVar( int, scale );
  80. CNetworkVector( origin );
  81. CNetworkVar( int, area );
  82. // 3d skybox fog data
  83. CNetworkVarEmbedded( fogparams_t, fog );
  84. };
  85. struct audioparams_t
  86. {
  87. DECLARE_CLASS_NOBASE( audioparams_t );
  88. DECLARE_EMBEDDED_NETWORKVAR();
  89. #ifndef CLIENT_DLL
  90. DECLARE_SIMPLE_DATADESC();
  91. #endif
  92. CNetworkArray( Vector, localSound, NUM_AUDIO_LOCAL_SOUNDS )
  93. CNetworkVar( int, soundscapeIndex ); // index of the current soundscape from soundscape.txt
  94. CNetworkVar( int, localBits ); // if bits 0,1,2,3 are set then position 0,1,2,3 are valid/used
  95. CNetworkHandle( CBaseEntity, ent ); // the entity setting the soundscape
  96. };
  97. #endif // PLAYERNET_VARS_H