From 39ed87570bdb2f86969d4be821c94b722dc71179 Mon Sep 17 00:00:00 2001 From: Joe Ludwig Date: Wed, 26 Jun 2013 15:22:04 -0700 Subject: First version of the SOurce SDK 2013 --- mp/src/game/client/c_env_tonemap_controller.cpp | 97 +++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 mp/src/game/client/c_env_tonemap_controller.cpp (limited to 'mp/src/game/client/c_env_tonemap_controller.cpp') diff --git a/mp/src/game/client/c_env_tonemap_controller.cpp b/mp/src/game/client/c_env_tonemap_controller.cpp new file mode 100644 index 00000000..03b03385 --- /dev/null +++ b/mp/src/game/client/c_env_tonemap_controller.cpp @@ -0,0 +1,97 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= +#include "cbase.h" + +extern bool g_bUseCustomAutoExposureMin; +extern bool g_bUseCustomAutoExposureMax; +extern bool g_bUseCustomBloomScale; +extern float g_flCustomAutoExposureMin; +extern float g_flCustomAutoExposureMax; +extern float g_flCustomBloomScale; +extern float g_flCustomBloomScaleMinimum; + +EHANDLE g_hTonemapControllerInUse = NULL; + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +class C_EnvTonemapController : public C_BaseEntity +{ + DECLARE_CLASS( C_EnvTonemapController, C_BaseEntity ); +public: + DECLARE_CLIENTCLASS(); + + C_EnvTonemapController(); + ~C_EnvTonemapController(); + virtual void OnDataChanged( DataUpdateType_t updateType ); + +private: + bool m_bUseCustomAutoExposureMin; + bool m_bUseCustomAutoExposureMax; + bool m_bUseCustomBloomScale; + float m_flCustomAutoExposureMin; + float m_flCustomAutoExposureMax; + float m_flCustomBloomScale; + float m_flCustomBloomScaleMinimum; +private: + C_EnvTonemapController( const C_EnvTonemapController & ); +}; + +IMPLEMENT_CLIENTCLASS_DT( C_EnvTonemapController, DT_EnvTonemapController, CEnvTonemapController ) + RecvPropInt( RECVINFO(m_bUseCustomAutoExposureMin) ), + RecvPropInt( RECVINFO(m_bUseCustomAutoExposureMax) ), + RecvPropInt( RECVINFO(m_bUseCustomBloomScale) ), + RecvPropFloat( RECVINFO(m_flCustomAutoExposureMin) ), + RecvPropFloat( RECVINFO(m_flCustomAutoExposureMax) ), + RecvPropFloat( RECVINFO(m_flCustomBloomScale) ), + RecvPropFloat( RECVINFO(m_flCustomBloomScaleMinimum) ), +END_RECV_TABLE() + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +C_EnvTonemapController::C_EnvTonemapController( void ) +{ + m_bUseCustomAutoExposureMin = false; + m_bUseCustomAutoExposureMax = false; + m_bUseCustomBloomScale = false; + m_flCustomAutoExposureMin = 0; + m_flCustomAutoExposureMax = 0; + m_flCustomBloomScale = 0.0f; + m_flCustomBloomScaleMinimum = 0.0f; +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +C_EnvTonemapController::~C_EnvTonemapController( void ) +{ + if ( g_hTonemapControllerInUse == this ) + { + g_bUseCustomAutoExposureMin = false; + g_bUseCustomAutoExposureMax = false; + g_bUseCustomBloomScale = false; + } +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void C_EnvTonemapController::OnDataChanged( DataUpdateType_t updateType ) +{ + BaseClass::OnDataChanged(updateType); + + g_bUseCustomAutoExposureMin = m_bUseCustomAutoExposureMin; + g_bUseCustomAutoExposureMax = m_bUseCustomAutoExposureMax; + g_bUseCustomBloomScale = m_bUseCustomBloomScale; + g_flCustomAutoExposureMin = m_flCustomAutoExposureMin; + g_flCustomAutoExposureMax = m_flCustomAutoExposureMax; + g_flCustomBloomScale = m_flCustomBloomScale; + g_flCustomBloomScaleMinimum = m_flCustomBloomScaleMinimum; + + g_hTonemapControllerInUse = this; +} + -- cgit v1.2.3