Skip to content

Commit 05bf222

Browse files
committed
pending: experimental changes
1 parent 6e05696 commit 05bf222

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+335
-169
lines changed

src/engine/enginetool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void CEngineTool::SetGamePaused( bool paused )
444444

445445
float CEngineTool::GetTimescale()
446446
{
447-
return host_timescale.GetFloat();
447+
return host_timescale.GetFloat() ? host_timescale.GetFloat() : 1.0f;
448448
}
449449

450450
void CEngineTool::SetTimescale( float scale )

src/engine/host.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ static ConVar host_profile( "host_profile","0" );
585585

586586
ConVar host_limitlocal( "host_limitlocal", "0", 0, "Apply cl_cmdrate and cl_updaterate to loopback connection" );
587587
ConVar host_framerate( "host_framerate","0", 0, "Set to lock per-frame time elapse." );
588-
ConVar host_timescale( "host_timescale","1.0", FCVAR_REPLICATED, "Prescale the clock by this amount." );
588+
ConVar host_timescale( "host_timescale","0.0", FCVAR_REPLICATED, "Prescale the clock by this amount." );
589589
ConVar host_speeds( "host_speeds","0", 0, "Show general system running times." ); // set for running times
590590

591591
ConVar host_flush_threshold( "host_flush_threshold", "20", 0, "Memory threshold below which the host should flush caches between server instances" );
@@ -1758,7 +1758,10 @@ void Host_ReadPreStartupConfiguration()
17581758
{
17591759
"sv_unlockedchapters", // needed to display the startup graphic while loading
17601760
"snd_legacy_surround", // needed to init the sound system
1761+
#if defined( _X360 ) || defined( STAGING_ONLY )
17611762
"gameui_xbox", // needed to initialize the correct UI
1763+
#endif
1764+
"cl_hud_minmode", // needed to initialize the correct UI
17621765
"save_in_memory" // needed to preread data from the correct location in UI
17631766
};
17641767

src/engine/host.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ extern int host_currentframetick;
149149

150150
// PERFORMANCE INFO
151151
#define MIN_FPS 0.1 // Host minimum fps value for maxfps.
152-
#define MAX_FPS 1000.0 // Upper limit for maxfps.
152+
#define MAX_FPS 10000.0 // Upper limit for maxfps.
153153

154154
#define MAX_FRAMETIME 0.1
155-
#define MIN_FRAMETIME 0.001
155+
#define MIN_FRAMETIME 0.0001
156156

157157
#define TIME_TO_TICKS( dt ) ( (int)( 0.5f + (float)(dt) / host_state.interval_per_tick ) )
158158
#define TICKS_TO_TIME( dt ) ( host_state.interval_per_tick * (float)(dt) )

src/engine/l_studio.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,11 +2785,11 @@ struct rbatch_t
27852785
// ----------------------------------------
27862786
*/
27872787

2788-
inline int FindModel( const CUtlVector<rmodel_t> &list, const model_t *pModel )
2788+
inline int FindModel( const rmodel_t* pList, int listCount, const model_t* pModel )
27892789
{
2790-
for ( int j = list.Count(); --j >= 0 ; )
2790+
for ( int j = listCount; --j >= 0 ; )
27912791
{
2792-
if ( list[j].pModel == pModel )
2792+
if ( pList[j].pModel == pModel )
27932793
return j;
27942794
}
27952795
return -1;
@@ -2806,13 +2806,13 @@ int CModelRender::DrawStaticPropArrayFast( StaticPropRenderInfo_t *pProps, int c
28062806
#ifndef SWDS
28072807
MDLCACHE_CRITICAL_SECTION_( g_pMDLCache );
28082808
CMatRenderContextPtr pRenderContext( materials );
2809-
const int MAX_OBJECTS = 1024;
2809+
const int MAX_OBJECTS = 2048;
28102810
CUtlSortVector<robject_t, CRobjectLess> objectList(0, MAX_OBJECTS);
2811-
CUtlVector<rmodel_t> modelList(0,256);
2812-
CUtlVector<short> lightObjects(0,256);
2813-
CUtlVector<short> shadowObjects(0,64);
2814-
CUtlVector<rdecalmodel_t> decalObjects(0,64);
2815-
CUtlVector<LightingState_t> lightStates(0,256);
2811+
CUtlVectorFixedGrowable<rmodel_t, 256> modelList;
2812+
CUtlVectorFixedGrowable<short, 256> lightObjects;
2813+
CUtlVectorFixedGrowable<short, 64> shadowObjects;
2814+
CUtlVectorFixedGrowable<rdecalmodel_t, 64> decalObjects;
2815+
CUtlVectorFixedGrowable<LightingState_t, 256> lightStates;
28162816
bool bForceCubemap = r_showenvcubemap.GetBool();
28172817
int drawnCount = 0;
28182818
int forcedLodSetting = r_lod.GetInt();
@@ -2826,7 +2826,7 @@ int CModelRender::DrawStaticPropArrayFast( StaticPropRenderInfo_t *pProps, int c
28262826
{
28272827
drawnCount++;
28282828
// UNDONE: This is a perf hit in some scenes! Use a hash?
2829-
int modelIndex = FindModel( modelList, pProps[i].pModel );
2829+
int modelIndex = FindModel( modelList.Base(), modelList.Count(), pProps[i].pModel );
28302830
if ( modelIndex < 0 )
28312831
{
28322832
modelIndex = modelList.AddToTail();

src/engine/modelloader.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@
6262

6363
ConVar mat_loadtextures( "mat_loadtextures", "1", FCVAR_CHEAT );
6464

65-
// OS X and Linux are blowing up right now due to this. Benefits vs possible regressions on DX less clear.
66-
#if defined( DX_TO_GL_ABSTRACTION ) || defined( STAGING_ONLY )
67-
#define CONVAR_DEFAULT_MOD_OFFLINE_HDR_SWITCH "1"
68-
#else
69-
#define CONVAR_DEFAULT_MOD_OFFLINE_HDR_SWITCH "0"
70-
#endif
71-
static ConVar mod_offline_hdr_switch( "mod_offline_hdr_switch", CONVAR_DEFAULT_MOD_OFFLINE_HDR_SWITCH, FCVAR_INTERNAL_USE,
65+
static ConVar mod_offline_hdr_switch( "mod_offline_hdr_switch", "1", FCVAR_INTERNAL_USE,
7266
"Re-order the HDR/LDR mode switch to do most of the material system "
7367
"reloading with the device offline. This reduces unnecessary device "
7468
"resource uploads and may drastically reduce load time and memory pressure "

src/engine/net_ws.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2960,7 +2960,15 @@ void NET_SetTime( double flRealtime )
29602960
}
29612961

29622962
// adjust network time so fakelag works with host_timescale
2963-
net_time += frametime * host_timescale.GetFloat();
2963+
const float timescale = host_timescale.GetFloat();
2964+
if (timescale > 0)
2965+
{
2966+
net_time += frametime * timescale;
2967+
}
2968+
else
2969+
{
2970+
net_time += frametime;
2971+
}
29642972
}
29652973

29662974
/*

src/engine/vgui_baseui_interface.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ IGameConsole *staticGameConsole = NULL;
124124
bool s_bWindowsInputEnabled = true;
125125

126126
ConVar r_drawvgui( "r_drawvgui", "1", FCVAR_CHEAT, "Enable the rendering of vgui panels" );
127+
#if defined( _X360 ) || defined( STAGING_ONLY )
127128
ConVar gameui_xbox( "gameui_xbox", "0", 0 );
129+
#endif
128130

129131
void Con_CreateConsolePanel( vgui::Panel *parent );
130132
void CL_CreateEntityReportPanel( vgui::Panel *parent );
@@ -2142,11 +2144,11 @@ void VGui_FindNamedPanels( CUtlVector< vgui::VPANEL >& panelList, char const *pa
21422144
VGui_RecursiveFindPanels( panelList, embedded, panelname );
21432145
}
21442146

2145-
CON_COMMAND( vgui_togglepanel, "show/hide vgui panel by name." )
2147+
CON_COMMAND_F( vgui_togglepanel, "show/hide vgui panel by name.", FCVAR_CHEAT )
21462148
{
21472149
if ( args.ArgC() < 2 )
21482150
{
2149-
ConMsg( "Usage: vgui_showpanel panelname\n" );
2151+
ConMsg( "Usage: vgui_togglepanel panelname\n" );
21502152
return;
21512153
}
21522154

src/game/client/c_vguiscreen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ C_BaseEntity *FindNearbyVguiScreen( const Vector &viewPosition, const QAngle &vi
650650
// X360TBD: Turn this on if feature actually used
651651
return NULL;
652652
}
653+
// Feature not used, causes crashes if entity exists anyway...
654+
return NULL;
653655

654656
C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
655657

src/game/client/game_controls/MapOverview.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ void CMapOverview::SetMode(int mode)
10191019
{
10201020
ShowPanel( false );
10211021

1022-
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "MapOff" );
1022+
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "MapOff", true, true );
10231023
}
10241024
else if ( mode == MAP_MODE_INSET )
10251025
{
@@ -1041,7 +1041,7 @@ void CMapOverview::SetMode(int mode)
10411041

10421042
if ( mode != m_nMode && RunHudAnimations() )
10431043
{
1044-
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "MapZoomToSmall" );
1044+
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "MapZoomToSmall", true, true );
10451045
}
10461046
}
10471047
else if ( mode == MAP_MODE_FULL )
@@ -1061,7 +1061,7 @@ void CMapOverview::SetMode(int mode)
10611061

10621062
if ( mode != m_nMode && RunHudAnimations() )
10631063
{
1064-
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "MapZoomToLarge" );
1064+
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( this, "MapZoomToLarge", true, true );
10651065
}
10661066
}
10671067

src/game/client/game_controls/baseviewport.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void hud_autoreloadscript_callback( IConVar *var, const char *pOldValue, float f
7979

8080
static ConVar cl_leveloverviewmarker( "cl_leveloverviewmarker", "0", FCVAR_CHEAT );
8181

82-
CON_COMMAND( showpanel, "Shows a viewport panel <name>" )
82+
CON_COMMAND_F( showpanel, "Shows a viewport panel <name>", FCVAR_CHEAT )
8383
{
8484
if ( !gViewPortInterface )
8585
return;
@@ -90,7 +90,7 @@ CON_COMMAND( showpanel, "Shows a viewport panel <name>" )
9090
gViewPortInterface->ShowPanel( args[ 1 ], true );
9191
}
9292

93-
CON_COMMAND( hidepanel, "Hides a viewport panel <name>" )
93+
CON_COMMAND_F( hidepanel, "Hides a viewport panel <name>", FCVAR_CHEAT )
9494
{
9595
if ( !gViewPortInterface )
9696
return;

0 commit comments

Comments
 (0)