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.

52 lines
2.0 KiB

  1. //========= Copyright � 1996-2007, Valve Corporation, All rights reserved. ====
  2. //
  3. // An entity that allows level designer control over the fog parameters.
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #include "c_env_fog_controller.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. IMPLEMENT_NETWORKCLASS_ALIASED( FogController, DT_FogController )
  11. //-----------------------------------------------------------------------------
  12. // Datatable
  13. //-----------------------------------------------------------------------------
  14. BEGIN_NETWORK_TABLE_NOBASE( CFogController, DT_FogController )
  15. // fog data
  16. RecvPropInt( RECVINFO( m_fog.enable ) ),
  17. RecvPropInt( RECVINFO( m_fog.blend ) ),
  18. RecvPropVector( RECVINFO( m_fog.dirPrimary ) ),
  19. RecvPropInt( RECVINFO( m_fog.colorPrimary ), 0, RecvProxy_Int32ToColor32 ),
  20. RecvPropInt( RECVINFO( m_fog.colorSecondary ), 0, RecvProxy_Int32ToColor32 ),
  21. RecvPropFloat( RECVINFO( m_fog.start ) ),
  22. RecvPropFloat( RECVINFO( m_fog.end ) ),
  23. RecvPropFloat( RECVINFO( m_fog.farz ) ),
  24. RecvPropFloat( RECVINFO( m_fog.maxdensity ) ),
  25. RecvPropInt( RECVINFO( m_fog.colorPrimaryLerpTo ), 0, RecvProxy_Int32ToColor32 ),
  26. RecvPropInt( RECVINFO( m_fog.colorSecondaryLerpTo ), 0, RecvProxy_Int32ToColor32 ),
  27. RecvPropFloat( RECVINFO( m_fog.startLerpTo ) ),
  28. RecvPropFloat( RECVINFO( m_fog.endLerpTo ) ),
  29. RecvPropFloat( RECVINFO( m_fog.maxdensityLerpTo ) ),
  30. RecvPropFloat( RECVINFO( m_fog.lerptime ) ),
  31. RecvPropFloat( RECVINFO( m_fog.duration ) ),
  32. RecvPropFloat( RECVINFO( m_fog.HDRColorScale ) ),
  33. RecvPropFloat( RECVINFO( m_fog.ZoomFogScale ) ),
  34. END_NETWORK_TABLE()
  35. //-----------------------------------------------------------------------------
  36. // Purpose:
  37. //-----------------------------------------------------------------------------
  38. C_FogController::C_FogController()
  39. {
  40. // Make sure that old maps without fog fields don't get wacked out fog values.
  41. m_fog.enable = false;
  42. m_fog.maxdensity = 1.0f;
  43. m_fog.HDRColorScale = 1.0f;
  44. }