Skip to content

Commit 0f36ee8

Browse files
committed
add some quality cvars to menus
1 parent 66754e1 commit 0f36ee8

File tree

8 files changed

+56
-12
lines changed

8 files changed

+56
-12
lines changed

engine/audio/private/snd_dsp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5922,7 +5922,7 @@ int idsp_speaker;
59225922
int idsp_spatial;
59235923
int idsp_automatic;
59245924

5925-
ConVar dsp_off ("dsp_off", "0", FCVAR_ALLOWED_IN_COMPETITIVE ); // set to 1 to disable all dsp processing
5925+
ConVar dsp_off ("dsp_off", "0", FCVAR_ARCHIVE ); // set to 1 to disable all dsp processing
59265926
ConVar dsp_slow_cpu ("dsp_slow_cpu", "0", FCVAR_ARCHIVE|FCVAR_DEMO ); // set to 1 if cpu bound - ie: does not process dsp_room fx
59275927
ConVar snd_profile ("snd_profile", "0", FCVAR_DEMO ); // 1 - profile dsp, 2 - mix, 3 - load sound, 4 - all sound
59285928
ConVar dsp_volume ("dsp_volume", "1.0", FCVAR_ARCHIVE|FCVAR_DEMO ); // 0.0 - 2.0; master dsp volume control

game/client/particlemgr.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ bool CParticleMgr::RetireParticleCollections( CParticleSystemDefinition* pDef,
16931693
}
16941694

16951695
// Next, see if there are new particle systems that need early retirement
1696-
static ConVar cl_particle_retire_cost( "cl_particle_retire_cost", "0", FCVAR_ALLOWED_IN_COMPETITIVE );
1696+
static ConVar cl_particle_retire_cost( "cl_particle_retire_cost", "-10", FCVAR_ALLOWED_IN_COMPETITIVE );
16971697

16981698
bool CParticleMgr::EarlyRetireParticleSystems( int nCount, ParticleSimListEntry_t *ppEffects )
16991699
{
@@ -1749,7 +1749,18 @@ bool CParticleMgr::EarlyRetireParticleSystems( int nCount, ParticleSimListEntry_
17491749
{
17501750
CParticleSystemDefinition* pDef = ppDefs[i];
17511751
int nActualCount = ComputeParticleDefScreenArea( nCount, pInfo, &flScreenArea, pDef, *pViewSetup, worldToScreen, flFocalDist );
1752-
if ( flScreenArea > flMaxScreenArea )
1752+
bool bShouldRetire;
1753+
// If negative, then max screen area acts as a cap rather than a floor
1754+
// This is to accomodate particle "LOD" instead of the old way of retiring high fill particles
1755+
if ( flMaxScreenArea >= 0 )
1756+
{
1757+
bShouldRetire = flScreenArea > flMaxScreenArea;
1758+
}
1759+
else
1760+
{
1761+
bShouldRetire = flScreenArea < -flMaxScreenArea;
1762+
}
1763+
if ( bShouldRetire )
17531764
{
17541765
if ( RetireParticleCollections( pDef, nActualCount, pInfo, flScreenArea, flMaxScreenArea ) )
17551766
{

gameui/OptionsSubAudio.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum SoundQuality_e
3232
SOUNDQUALITY_LOW,
3333
SOUNDQUALITY_MEDIUM,
3434
SOUNDQUALITY_HIGH,
35+
SOUNDQUALITY_ULTRA
3536
};
3637

3738
//-----------------------------------------------------------------------------
@@ -48,6 +49,7 @@ COptionsSubAudio::COptionsSubAudio(vgui::Panel *parent) : PropertyPage(parent, N
4849
m_pCloseCaptionCombo->AddItem( "#GameUI_Subtitles", NULL );
4950

5051
m_pSoundQualityCombo = new ComboBox( this, "SoundQuality", 6, false );
52+
m_pSoundQualityCombo->AddItem( "#GameUI_Ultra", new KeyValues("SoundQuality", "quality", SOUNDQUALITY_ULTRA) );
5153
m_pSoundQualityCombo->AddItem( "#GameUI_High", new KeyValues("SoundQuality", "quality", SOUNDQUALITY_HIGH) );
5254
m_pSoundQualityCombo->AddItem( "#GameUI_Medium", new KeyValues("SoundQuality", "quality", SOUNDQUALITY_MEDIUM) );
5355
m_pSoundQualityCombo->AddItem( "#GameUI_Low", new KeyValues("SoundQuality", "quality", SOUNDQUALITY_LOW) );
@@ -134,14 +136,19 @@ void COptionsSubAudio::OnResetData()
134136
// sound quality is made up from several cvars
135137
ConVarRef Snd_PitchQuality("Snd_PitchQuality");
136138
ConVarRef dsp_slow_cpu("dsp_slow_cpu");
139+
ConVarRef dsp_off("dsp_off");
137140
int quality = SOUNDQUALITY_LOW;
141+
if (dsp_off.GetBool() == false)
142+
{
143+
quality = SOUNDQUALITY_MEDIUM;
144+
}
138145
if (dsp_slow_cpu.GetBool() == false)
139146
{
140-
quality = SOUNDQUALITY_MEDIUM;
147+
quality = SOUNDQUALITY_HIGH;
141148
}
142149
if (Snd_PitchQuality.GetBool())
143150
{
144-
quality = SOUNDQUALITY_HIGH;
151+
quality = SOUNDQUALITY_ULTRA;
145152
}
146153
// find the item in the list and activate it
147154
{for (int itemID = 0; itemID < m_pSoundQualityCombo->GetItemCount(); itemID++)
@@ -259,20 +266,24 @@ void COptionsSubAudio::OnApplyChanges()
259266
// quality
260267
ConVarRef Snd_PitchQuality( "Snd_PitchQuality" );
261268
ConVarRef dsp_slow_cpu( "dsp_slow_cpu" );
269+
ConVarRef dsp_off("dsp_off");
262270
int quality = m_pSoundQualityCombo->GetActiveItemUserData()->GetInt( "quality" );
263271
switch ( quality )
264272
{
265273
case SOUNDQUALITY_LOW:
274+
dsp_off.SetValue(true);
266275
dsp_slow_cpu.SetValue(true);
267276
Snd_PitchQuality.SetValue(false);
268277
break;
269278
case SOUNDQUALITY_MEDIUM:
279+
dsp_off.SetValue(false);
270280
dsp_slow_cpu.SetValue(false);
271281
Snd_PitchQuality.SetValue(false);
272282
break;
273283
default:
274284
Assert("Undefined sound quality setting.");
275285
case SOUNDQUALITY_HIGH:
286+
dsp_off.SetValue(false);
276287
dsp_slow_cpu.SetValue(false);
277288
Snd_PitchQuality.SetValue(true);
278289
break;

gameui/OptionsSubVideo.cpp

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ class COptionsSubVideoAdvancedDlg : public vgui::Frame
417417

418418
m_pShaderDetail = new ComboBox( this, "ShaderDetail", 6, false );
419419
m_pShaderDetail->AddItem("#gameui_low", NULL);
420+
m_pShaderDetail->AddItem("#gameui_medium", NULL);
420421
m_pShaderDetail->AddItem("#gameui_high", NULL);
421422

422423
m_pColorCorrection = new ComboBox( this, "ColorCorrection", 2, false );
@@ -637,7 +638,7 @@ class COptionsSubVideoAdvancedDlg : public vgui::Frame
637638
else
638639
SetComboItemAsRecommended( m_pShadowDetail, 0 ); // Blobbies
639640

640-
SetComboItemAsRecommended( m_pShaderDetail, nReduceFillRate ? 0 : 1 );
641+
SetComboItemAsRecommended( m_pShaderDetail, nReduceFillRate ? 1 : 2 );
641642

642643
#ifndef _X360
643644
if ( nWaterUseRealtimeReflection )
@@ -750,7 +751,10 @@ class COptionsSubVideoAdvancedDlg : public vgui::Frame
750751
ApplyChangesToConVar( "r_flashlightdepthtexture", 1 ); // Turn on shadow depth textures
751752
}
752753

753-
ApplyChangesToConVar( "mat_reducefillrate", ( m_pShaderDetail->GetActiveItem() > 0 ) ? 0 : 1 );
754+
ApplyChangesToConVar( "mat_reducefillrate", ( m_pShaderDetail->GetActiveItem() > 1 ) ? 0 : 1 );
755+
ApplyChangesToConVar( "mat_phong", ( m_pShaderDetail->GetActiveItem() < 1 ) ? 0 : 1 );
756+
ApplyChangesToConVar( "r_force_fastpath", ( m_pShaderDetail->GetActiveItem() > 0 ) ? 0 : 1 );
757+
ApplyChangesToConVar( "r_skybox_lowend", ( m_pShaderDetail->GetActiveItem() > 0 ) ? 0 : 1 );
754758

755759
switch ( m_pWaterDetail->GetActiveItem() )
756760
{
@@ -808,6 +812,9 @@ class COptionsSubVideoAdvancedDlg : public vgui::Frame
808812
#endif
809813
ConVarRef r_waterforcereflectentities( "r_waterforcereflectentities" );
810814
ConVarRef mat_reducefillrate("mat_reducefillrate" );
815+
ConVarRef mat_phong("mat_phong");
816+
ConVarRef r_force_fastpath("r_force_fastpath");
817+
ConVarRef r_skybox_lowend("r_skybox_lowend");
811818
ConVarRef mat_hdr_level( "mat_hdr_level" );
812819
ConVarRef mat_colorcorrection( "mat_colorcorrection" );
813820
ConVarRef mat_motion_blur_enabled( "mat_motion_blur_enabled" );
@@ -832,7 +839,22 @@ class COptionsSubVideoAdvancedDlg : public vgui::Frame
832839
m_pShadowDetail->ActivateItem( 0 );
833840
}
834841

835-
m_pShaderDetail->ActivateItem( mat_reducefillrate.GetBool() ? 0 : 1 );
842+
843+
if (mat_reducefillrate.GetBool())
844+
{
845+
if (mat_phong.GetBool() && r_force_fastpath.GetBool() && r_skybox_lowend.GetBool())
846+
{
847+
m_pShaderDetail->ActivateItem( 0 );
848+
}
849+
else
850+
{
851+
m_pShaderDetail->ActivateItem( 1 );
852+
}
853+
}
854+
else
855+
{
856+
m_pShaderDetail->ActivateItem( 2 );
857+
}
836858
m_pHDR->ActivateItem(clamp(mat_hdr_level.GetInt(), 0, 2));
837859

838860
switch (mat_forceaniso.GetInt())

materialsystem/cmaterialsystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ static ConVar mat_showmiplevels( "mat_showmiplevels", "0", FCVAR_CHEAT, "color-c
17561756

17571757
static ConVar mat_specular( "mat_specular", "1", FCVAR_ALLOWED_IN_COMPETITIVE, "Enable/Disable specularity for perf testing. Will cause a material reload upon change." );
17581758
static ConVar mat_bumpmap( "mat_bumpmap", "1", FCVAR_ALLOWED_IN_COMPETITIVE );
1759-
static ConVar mat_phong( "mat_phong", "1" );
1759+
static ConVar mat_phong( "mat_phong", "1", FCVAR_ARCHIVE, "", false, 0, false, 0, true, 1, true, 1, NULL);
17601760
static ConVar mat_parallaxmap( "mat_parallaxmap", "0", FCVAR_HIDDEN | FCVAR_ALLOWED_IN_COMPETITIVE );
17611761
static ConVar mat_reducefillrate( "mat_reducefillrate", "0", FCVAR_ALLOWED_IN_COMPETITIVE );
17621762

materialsystem/stdshaders/lightmappedgeneric_dx9_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ConVar mat_disable_fancy_blending( "mat_disable_fancy_blending", "0" );
2121
ConVar mat_fullbright( "mat_fullbright","0", FCVAR_CHEAT );
2222
ConVar my_mat_fullbright( "mat_fullbright","0", FCVAR_CHEAT );
2323
extern ConVar r_flashlight_version2;
24-
static ConVar r_force_fastpath("r_force_fastpath", "0", FCVAR_NONE);
24+
static ConVar r_force_fastpath("r_force_fastpath", "0", FCVAR_ARCHIVE, "", false, 0, false, 0, true, 0, true, 0, NULL);
2525

2626
class CLightmappedGeneric_DX9_Context : public CBasePerMaterialContextData
2727
{

materialsystem/stdshaders/skin_dx9_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
static ConVar mat_fullbright( "mat_fullbright", "0", FCVAR_CHEAT );
2525
static ConVar r_lightwarpidentity( "r_lightwarpidentity", "0", FCVAR_CHEAT );
2626
static ConVar r_rimlight( "r_rimlight", "1", FCVAR_NONE );
27-
static ConVar r_force_fastpath("r_force_fastpath", "0", FCVAR_NONE);
27+
static ConVar r_force_fastpath("r_force_fastpath", "0", FCVAR_ARCHIVE, "", false, 0, false, 0, true, 0, true, 0, NULL);
2828

2929
// Textures may be bound to the following samplers:
3030
// SHADER_SAMPLER0 Base (Albedo) / Gloss in alpha

materialsystem/stdshaders/worldtwotextureblend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "tier0/memdbgon.h"
1919

2020
extern ConVar r_flashlight_version2;
21-
static ConVar r_force_fastpath("r_force_fastpath", "0", FCVAR_NONE);
21+
static ConVar r_force_fastpath("r_force_fastpath", "0", FCVAR_ARCHIVE, "", false, 0, false, 0, true, 0, true, 0, NULL);
2222

2323
// FIXME: Need to make a dx9 version so that "CENTROID" works.
2424
BEGIN_VS_SHADER( WorldTwoTextureBlend,

0 commit comments

Comments
 (0)