source-sdk-2013-mapbase/sp/src/game/server/env_tonemap_controller.cpp

376 lines
14 KiB
C++
Raw Normal View History

2013-12-02 19:31:46 -08:00
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include "baseentity.h"
#include "entityoutput.h"
#include "convar.h"
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
#include "player.h" //Tony; need player.h so we can trigger inputs on the player, from our inputs!
2013-12-02 19:31:46 -08:00
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
ConVar mat_hdr_tonemapscale( "mat_hdr_tonemapscale", "1.0", FCVAR_CHEAT, "The HDR tonemap scale. 1 = Use autoexposure, 0 = eyes fully closed, 16 = eyes wide open." );
// 0 - eyes fully closed / fully black
// 1 - nominal
// 16 - eyes wide open / fully white
//-----------------------------------------------------------------------------
// Purpose: Entity that controls player's tonemap
//-----------------------------------------------------------------------------
class CEnvTonemapController : public CPointEntity
{
DECLARE_CLASS( CEnvTonemapController, CPointEntity );
public:
DECLARE_DATADESC();
DECLARE_SERVERCLASS();
void Spawn( void );
int UpdateTransmitState( void );
void UpdateTonemapScaleBlend( void );
// Inputs
void InputSetTonemapScale( inputdata_t &inputdata );
void InputBlendTonemapScale( inputdata_t &inputdata );
void InputSetTonemapRate( inputdata_t &inputdata );
void InputSetAutoExposureMin( inputdata_t &inputdata );
void InputSetAutoExposureMax( inputdata_t &inputdata );
void InputUseDefaultAutoExposure( inputdata_t &inputdata );
void InputSetBloomScale( inputdata_t &inputdata );
void InputUseDefaultBloomScale( inputdata_t &inputdata );
void InputSetBloomScaleRange( inputdata_t &inputdata );
private:
float m_flBlendTonemapStart; // HDR Tonemap at the start of the blend
float m_flBlendTonemapEnd; // Target HDR Tonemap at the end of the blend
float m_flBlendEndTime; // Time at which the blend ends
float m_flBlendStartTime; // Time at which the blend started
CNetworkVar( bool, m_bUseCustomAutoExposureMin );
CNetworkVar( bool, m_bUseCustomAutoExposureMax );
CNetworkVar( bool, m_bUseCustomBloomScale );
CNetworkVar( float, m_flCustomAutoExposureMin );
CNetworkVar( float, m_flCustomAutoExposureMax );
CNetworkVar( float, m_flCustomBloomScale);
CNetworkVar( float, m_flCustomBloomScaleMinimum);
};
LINK_ENTITY_TO_CLASS( env_tonemap_controller, CEnvTonemapController );
BEGIN_DATADESC( CEnvTonemapController )
DEFINE_FIELD( m_flBlendTonemapStart, FIELD_FLOAT ),
DEFINE_FIELD( m_flBlendTonemapEnd, FIELD_FLOAT ),
DEFINE_FIELD( m_flBlendEndTime, FIELD_TIME ),
DEFINE_FIELD( m_flBlendStartTime, FIELD_TIME ),
DEFINE_FIELD( m_bUseCustomAutoExposureMin, FIELD_BOOLEAN ),
DEFINE_FIELD( m_bUseCustomAutoExposureMax, FIELD_BOOLEAN ),
DEFINE_FIELD( m_flCustomAutoExposureMin, FIELD_FLOAT ),
DEFINE_FIELD( m_flCustomAutoExposureMax, FIELD_FLOAT ),
DEFINE_FIELD( m_flCustomBloomScale, FIELD_FLOAT ),
DEFINE_FIELD( m_flCustomBloomScaleMinimum, FIELD_FLOAT ),
DEFINE_FIELD( m_bUseCustomBloomScale, FIELD_BOOLEAN ),
DEFINE_THINKFUNC( UpdateTonemapScaleBlend ),
// Inputs
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetTonemapScale", InputSetTonemapScale ),
DEFINE_INPUTFUNC( FIELD_STRING, "BlendTonemapScale", InputBlendTonemapScale ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetTonemapRate", InputSetTonemapRate ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetAutoExposureMin", InputSetAutoExposureMin ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetAutoExposureMax", InputSetAutoExposureMax ),
DEFINE_INPUTFUNC( FIELD_VOID, "UseDefaultAutoExposure", InputUseDefaultAutoExposure ),
DEFINE_INPUTFUNC( FIELD_VOID, "UseDefaultBloomScale", InputUseDefaultBloomScale ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetBloomScale", InputSetBloomScale ),
#ifdef MAPBASE
DEFINE_INPUTFUNC( FIELD_STRING, "SetBloomScaleRange", InputSetBloomScaleRange ),
#else
2013-12-02 19:31:46 -08:00
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetBloomScaleRange", InputSetBloomScaleRange ),
#endif
2013-12-02 19:31:46 -08:00
END_DATADESC()
IMPLEMENT_SERVERCLASS_ST( CEnvTonemapController, DT_EnvTonemapController )
SendPropInt( SENDINFO(m_bUseCustomAutoExposureMin), 1, SPROP_UNSIGNED ),
SendPropInt( SENDINFO(m_bUseCustomAutoExposureMax), 1, SPROP_UNSIGNED ),
SendPropInt( SENDINFO(m_bUseCustomBloomScale), 1, SPROP_UNSIGNED ),
SendPropFloat( SENDINFO(m_flCustomAutoExposureMin), 0, SPROP_NOSCALE),
SendPropFloat( SENDINFO(m_flCustomAutoExposureMax), 0, SPROP_NOSCALE),
SendPropFloat( SENDINFO(m_flCustomBloomScale), 0, SPROP_NOSCALE),
SendPropFloat( SENDINFO(m_flCustomBloomScaleMinimum), 0, SPROP_NOSCALE),
END_SEND_TABLE()
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnvTonemapController::Spawn( void )
{
SetSolid( SOLID_NONE );
SetMoveType( MOVETYPE_NONE );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int CEnvTonemapController::UpdateTransmitState()
{
return SetTransmitState( FL_EDICT_ALWAYS );
}
//-----------------------------------------------------------------------------
// Purpose: Set the tonemap scale to the specified value
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputSetTonemapScale( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputSetTonemapScale\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputSetTonemapScale( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
float flRemapped = inputdata.value.Float();
mat_hdr_tonemapscale.SetValue( flRemapped );
}
//-----------------------------------------------------------------------------
// Purpose: Blend the tonemap scale to the specified value
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputBlendTonemapScale( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; TODO!!! -- tonemap scale blending does _not_ work properly in multiplayer..
if ( ( gpGlobals->maxClients > 1 ) )
return;
2013-12-02 19:31:46 -08:00
char parseString[255];
Q_strncpy(parseString, inputdata.value.String(), sizeof(parseString));
// Get the target tonemap scale
char *pszParam = strtok(parseString," ");
if ( !pszParam || !pszParam[0] )
{
Warning("%s (%s) received BlendTonemapScale input without a target tonemap scale. Syntax: <target tonemap scale> <blend time>\n", GetClassname(), GetDebugName() );
return;
}
m_flBlendTonemapEnd = atof( pszParam );
// Get the blend time
pszParam = strtok(NULL," ");
if ( !pszParam || !pszParam[0] )
{
Warning("%s (%s) received BlendTonemapScale input without a blend time. Syntax: <target tonemap scale> <blend time>\n", GetClassname(), GetDebugName() );
return;
}
m_flBlendEndTime = gpGlobals->curtime + atof( pszParam );
m_flBlendStartTime = gpGlobals->curtime;
m_flBlendTonemapStart = mat_hdr_tonemapscale.GetFloat();
// Start thinking
SetNextThink( gpGlobals->curtime + 0.1 );
SetThink( &CEnvTonemapController::UpdateTonemapScaleBlend );
}
//-----------------------------------------------------------------------------
// Purpose: set a base and minimum bloom scale
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputSetBloomScaleRange( inputdata_t &inputdata )
{
float bloom_max=1, bloom_min=1;
int nargs=sscanf( inputdata.value.String(), "%f %f", &bloom_max, &bloom_min );
2013-12-02 19:31:46 -08:00
if (nargs != 2)
{
Warning("%s (%s) received SetBloomScaleRange input without 2 arguments. Syntax: <max bloom> <min bloom>\n", GetClassname(), GetDebugName() );
return;
}
m_flCustomBloomScale=bloom_max;
m_flCustomBloomScaleMinimum=bloom_min;
#ifdef MAPBASE
m_bUseCustomBloomScale = true;
#endif
2013-12-02 19:31:46 -08:00
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputSetTonemapRate( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputSetTonemapRate\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputSetTonemapRate( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
// TODO: There should be a better way to do this.
ConVarRef mat_hdr_manual_tonemap_rate( "mat_hdr_manual_tonemap_rate" );
if ( mat_hdr_manual_tonemap_rate.IsValid() )
{
float flTonemapRate = inputdata.value.Float();
mat_hdr_manual_tonemap_rate.SetValue( flTonemapRate );
}
}
//-----------------------------------------------------------------------------
// Purpose: Blend the tonemap scale to the specified value
//-----------------------------------------------------------------------------
void CEnvTonemapController::UpdateTonemapScaleBlend( void )
{
float flRemapped = RemapValClamped( gpGlobals->curtime, m_flBlendStartTime, m_flBlendEndTime, m_flBlendTonemapStart, m_flBlendTonemapEnd );
mat_hdr_tonemapscale.SetValue( flRemapped );
//Msg("Setting tonemap scale to %f (curtime %f, %f -> %f)\n", flRemapped, gpGlobals->curtime, m_flBlendStartTime, m_flBlendEndTime );
// Stop when we're out of the blend range
if ( gpGlobals->curtime >= m_flBlendEndTime )
return;
SetNextThink( gpGlobals->curtime + 0.1 );
}
//-----------------------------------------------------------------------------
// Purpose: Set the auto exposure min to the specified value
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputSetAutoExposureMin( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputSetAutoExposureMin\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputSetAutoExposureMin( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
m_flCustomAutoExposureMin = inputdata.value.Float();
m_bUseCustomAutoExposureMin = true;
}
//-----------------------------------------------------------------------------
// Purpose: Set the auto exposure max to the specified value
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputSetAutoExposureMax( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputSetAutoExposureMax\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputSetAutoExposureMax( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
m_flCustomAutoExposureMax = inputdata.value.Float();
m_bUseCustomAutoExposureMax = true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputUseDefaultAutoExposure( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputUseDefaultAutoExposure\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputUseDefaultAutoExposure( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
m_bUseCustomAutoExposureMin = false;
m_bUseCustomAutoExposureMax = false;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputSetBloomScale( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputSetBloomScale\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputSetBloomScale( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
m_flCustomBloomScale = inputdata.value.Float();
m_flCustomBloomScaleMinimum = m_flCustomBloomScale;
m_bUseCustomBloomScale = true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEnvTonemapController::InputUseDefaultBloomScale( inputdata_t &inputdata )
{
Mapbase v4.3 - Fixed a crash with multiple trigger_look targets - Fixed an issue where some zombie submodel server ragdolls are not solid to the world - Fixed a crash with certain instance classes being loaded in a savegame before the class is registered - Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris) - Added "ClientCommand" hook for VScript to allow handling of unknown console commands - Added "PlayerRunCommand" hook for VScript to control player movement - Added new button-related script functions for players (GetButtons, DisableButtons, etc.) - Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook - Added "GetWaterLevel" function for VScript - Exposed "Ignite" to VScript for controlling how a fire starts - Fixed NPCs being unable to unholster weapons - Fixed Mapbase crashing when Steam isn't running - Fixed issues with angled/updating sky_camera save/restore - Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution - Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript) - Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time - Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc. - Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo - Added a few L4D2 script functions missing from the ASW SDK - Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings - Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps) - Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation) - Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities - Added keyvalue to set LOS mask on combine_mine - Added +USE bounding box limiter to prop_interactable
2020-07-16 15:43:30 +00:00
//Tony; in multiplayer, we check to see if the activator is a player, if they are, we trigger an input on them, and then get out.
//if there is no activator, or the activator is not a player; ie: LogicAuto, we set the 'global' values.
if ( ( gpGlobals->maxClients > 1 ) )
{
if ( inputdata.pActivator != NULL && inputdata.pActivator->IsPlayer() )
{
// DevMsg("activator is a player: InputUseDefaultBloomScale\n");
CBasePlayer *pPlayer = ToBasePlayer(inputdata.pActivator);
if (pPlayer)
{
pPlayer->InputUseDefaultBloomScale( inputdata );
return;
}
}
}
2013-12-02 19:31:46 -08:00
m_bUseCustomBloomScale = false;
}