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.

46 lines
1.7 KiB

  1. //========= Copyright 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 ) ),
  20. RecvPropInt( RECVINFO( m_fog.colorSecondary ) ),
  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 ) ),
  26. RecvPropInt( RECVINFO( m_fog.colorSecondaryLerpTo ) ),
  27. RecvPropFloat( RECVINFO( m_fog.startLerpTo ) ),
  28. RecvPropFloat( RECVINFO( m_fog.endLerpTo ) ),
  29. RecvPropFloat( RECVINFO( m_fog.lerptime ) ),
  30. RecvPropFloat( RECVINFO( m_fog.duration ) ),
  31. END_NETWORK_TABLE()
  32. //-----------------------------------------------------------------------------
  33. // Purpose:
  34. //-----------------------------------------------------------------------------
  35. C_FogController::C_FogController()
  36. {
  37. // Make sure that old maps without fog fields don't get wacked out fog values.
  38. m_fog.enable = false;
  39. m_fog.maxdensity = 1.0f;
  40. }