Skip to content

Commit 9204cdd

Browse files
committed
refactor(client): rename view -> g_view
1 parent bbb3e64 commit 9204cdd

22 files changed

Lines changed: 62 additions & 62 deletions

src/game/client/C_WaterLODControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ END_RECV_TABLE()
4646
//------------------------------------------------------------------------------
4747
void C_WaterLODControl::OnDataChanged(DataUpdateType_t updateType)
4848
{
49-
view->SetCheapWaterStartDistance( m_flCheapWaterStartDistance );
50-
view->SetCheapWaterEndDistance( m_flCheapWaterEndDistance );
49+
g_view->SetCheapWaterStartDistance( m_flCheapWaterStartDistance );
50+
g_view->SetCheapWaterEndDistance( m_flCheapWaterEndDistance );
5151
}
5252

5353
//------------------------------------------------------------------------------

src/game/client/WaterLODMaterialProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void CWaterLODMaterialProxy::OnBind( void *pC_BaseEntity )
6262
return;
6363
}
6464
float start, end;
65-
view->GetWaterLODParams( start, end );
65+
g_view->GetWaterLODParams( start, end );
6666
m_pCheapWaterStartDistanceVar->SetFloatValue( start );
6767
m_pCheapWaterEndDistanceVar->SetFloatValue( end );
6868
}

src/game/client/c_baseplayer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
826826
gameeventmanager->FireEventClientSide( pEvent );
827827
}
828828

829-
view->FreezeFrame(0);
829+
g_view->FreezeFrame(0);
830830

831831
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
832832
pVar->Revert();
@@ -1640,7 +1640,7 @@ void C_BasePlayer::CalcFreezeCamView( Vector& eyeOrigin, QAngle& eyeAngles, floa
16401640
}
16411641

16421642
m_bSentFreezeFrame = true;
1643-
view->FreezeFrame( spec_freeze_time.GetFloat() );
1643+
g_view->FreezeFrame( spec_freeze_time.GetFloat() );
16441644
}
16451645
}
16461646

@@ -2003,8 +2003,8 @@ void C_BasePlayer::GetToolRecordingState( KeyValues *msg )
20032003
static CameraRecordingState_t state;
20042004
state.m_flFOV = GetFOV();
20052005

2006-
float flZNear = view->GetZNear();
2007-
float flZFar = view->GetZFar();
2006+
float flZNear = g_view->GetZNear();
2007+
float flZFar = g_view->GetZFar();
20082008
CalcView( state.m_vecEyePosition, state.m_vecEyeAngles, flZNear, flZFar, state.m_flFOV );
20092009
state.m_bThirdPerson = !engine->IsPaused() && ::input->CAM_IsThirdPerson();
20102010

src/game/client/c_baseviewmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void FormatViewModelAttachment( C_BasePlayer *pPlayer, Vector &vOrigin, bool bIn
5454
Assert( nSlot != -1 );
5555

5656
// Presumably, SetUpView has been called so we know our FOV and render origin.
57-
const CViewSetup *pViewSetup = view->GetPlayerViewSetup( nSlot );
57+
const CViewSetup *pViewSetup = g_view->GetPlayerViewSetup( nSlot );
5858

5959
float worldx = tan( pViewSetup->fov * M_PI/360.0 );
6060
float viewx = tan( pViewSetup->fovViewmodel * M_PI/360.0 );
@@ -215,7 +215,7 @@ void C_BaseViewModel::ApplyBoneMatrixTransform( matrix3x4_t& transform )
215215

216216
// We could get MATERIAL_VIEW here, but this is called sometimes before the renderer
217217
// has set that matrix. Luckily, this is called AFTER the CViewSetup has been initialized.
218-
const CViewSetup *pSetup = view->GetPlayerViewSetup();
218+
const CViewSetup *pSetup = g_view->GetPlayerViewSetup();
219219
AngleMatrix( pSetup->angles, pSetup->origin, viewMatrixInverse );
220220
MatrixInvert( viewMatrixInverse, viewMatrix );
221221

src/game/client/c_effects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void CClient_Precipitation::Render()
517517
if ( CurrentViewID() == VIEW_MONITOR )
518518
return;
519519

520-
if ( view->GetDrawFlags() & (DF_RENDER_REFLECTION | DF_RENDER_REFRACTION) )
520+
if ( g_view->GetDrawFlags() & (DF_RENDER_REFLECTION | DF_RENDER_REFRACTION) )
521521
return;
522522

523523
if ( m_nPrecipType == PRECIPITATION_TYPE_ASH )

src/game/client/c_env_screenoverlay.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void C_EnvScreenOverlay::PostDataUpdate( DataUpdateType_t updateType )
8787
BaseClass::PostDataUpdate( updateType );
8888

8989
// If we have a start time now, start the overlays going
90-
if ( m_bIsActive && m_flStartTime > 0 && view->GetScreenOverlayMaterial() == NULL )
90+
if ( m_bIsActive && m_flStartTime > 0 && g_view->GetScreenOverlayMaterial() == NULL )
9191
{
9292
StartOverlays();
9393
}
@@ -121,7 +121,7 @@ void C_EnvScreenOverlay::StopOverlays( void )
121121

122122
if ( m_bWasActive && !m_bIsActive )
123123
{
124-
view->SetScreenOverlayMaterial( NULL );
124+
g_view->SetScreenOverlayMaterial( NULL );
125125
}
126126
}
127127

@@ -173,7 +173,7 @@ void C_EnvScreenOverlay::StartCurrentOverlay( void )
173173
IMaterial *pMaterial = materials->FindMaterial( m_iszOverlayNames[m_iCurrentOverlay], TEXTURE_GROUP_CLIENT_EFFECTS, false );
174174
if ( !IsErrorMaterial( pMaterial ) )
175175
{
176-
view->SetScreenOverlayMaterial( pMaterial );
176+
g_view->SetScreenOverlayMaterial( pMaterial );
177177
}
178178
else
179179
{

src/game/client/cdll_client_int.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,13 +1022,13 @@ bool InitGameSystems( CreateInterfaceFn appSystemFactory )
10221022
}
10231023

10241024
// Each mod is required to implement this
1025-
view = GetViewRenderInstance();
1026-
if ( !view )
1025+
g_view = GetViewRenderInstance();
1026+
if ( !g_view )
10271027
{
10281028
Error( "GetViewRenderInstance() must be implemented by game." );
10291029
}
10301030

1031-
view->Init();
1031+
g_view->Init();
10321032
for ( int hh = 0; hh < MAX_SPLITSCREEN_PLAYERS; ++hh )
10331033
{
10341034
ACTIVE_SPLITSCREEN_PLAYER_GUARD_VGUI( hh );
@@ -1313,7 +1313,7 @@ void CHLClient::Shutdown( void )
13131313
input->Shutdown_All();
13141314
C_BaseTempEntity::ClearDynamicTempEnts();
13151315
TermSmokeFogOverlay();
1316-
view->Shutdown();
1316+
g_view->Shutdown();
13171317
g_pParticleSystemMgr->UncacheAllParticleSystems();
13181318
UncacheAllMaterials();
13191319

@@ -1602,7 +1602,7 @@ void CHLClient::View_Render( vrect_t *rect )
16021602
if ( rect->width == 0 || rect->height == 0 )
16031603
return;
16041604

1605-
view->Render( rect );
1605+
g_view->Render( rect );
16061606
UpdatePerfStats();
16071607
}
16081608

@@ -1612,7 +1612,7 @@ void CHLClient::View_Render( vrect_t *rect )
16121612
//-----------------------------------------------------------------------------
16131613
bool CHLClient::GetPlayerView( CViewSetup &playerView )
16141614
{
1615-
playerView = *view->GetPlayerViewSetup();
1615+
playerView = *g_view->GetPlayerViewSetup();
16161616
return true;
16171617
}
16181618

@@ -1782,9 +1782,9 @@ void ConfigureCurrentSystemLevel()
17821782
}
17831783

17841784
C_BaseEntity::UpdateVisibilityAllEntities();
1785-
if ( view )
1785+
if ( g_view )
17861786
{
1787-
view->InitFadeData();
1787+
g_view->InitFadeData();
17881788
}
17891789
}
17901790

@@ -1823,7 +1823,7 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
18231823

18241824
C_BaseTempEntity::ClearDynamicTempEnts();
18251825
clienteffects->Flush();
1826-
view->LevelInit();
1826+
g_view->LevelInit();
18271827
tempents->LevelInit();
18281828
for ( int hh = 0; hh < MAX_SPLITSCREEN_PLAYERS; ++hh )
18291829
{
@@ -1948,7 +1948,7 @@ void CHLClient::LevelShutdown( void )
19481948
// Now do the post-entity shutdown of all systems
19491949
IGameSystem::LevelShutdownPostEntityAllSystems();
19501950

1951-
view->LevelShutdown();
1951+
g_view->LevelShutdown();
19521952
beams->ClearBeams();
19531953
ParticleMgr()->RemoveAllEffects();
19541954

@@ -2431,7 +2431,7 @@ void OnRenderStart()
24312431
// This will place the player + the view models + all parent
24322432
// entities at the correct abs position so that their attachment points
24332433
// are at the correct location
2434-
view->OnRenderStart();
2434+
g_view->OnRenderStart();
24352435
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
24362436

24372437
// Process OnDataChanged events.
@@ -2681,7 +2681,7 @@ void CHLClient::WriteSaveGameScreenshot( const char *pFilename )
26812681
{
26822682
// Single player doesn't support split screen yet!!!
26832683
ACTIVE_SPLITSCREEN_PLAYER_GUARD( 0 );
2684-
view->WriteSaveGameScreenshot( pFilename );
2684+
g_view->WriteSaveGameScreenshot( pFilename );
26852685
}
26862686

26872687
// Given a list of "S(wavname) S(wavname2)" tokens, look up the localized text and emit
@@ -2817,14 +2817,14 @@ bool CHLClient::CacheReplayRagdolls( const char* pFilename, int nStartTick )
28172817
// save game screenshot writing
28182818
void CHLClient::WriteSaveGameScreenshotOfSize( const char *pFilename, int width, int height )
28192819
{
2820-
view->WriteSaveGameScreenshotOfSize( pFilename, width, height );
2820+
g_view->WriteSaveGameScreenshotOfSize( pFilename, width, height );
28212821
}
28222822

28232823
// See RenderViewInfo_t
28242824
void CHLClient::RenderView( const CViewSetup &setup, int nClearFlags, int whatToDraw )
28252825
{
28262826
VPROF("RenderView");
2827-
view->RenderView( setup, setup, nClearFlags, whatToDraw );
2827+
g_view->RenderView( setup, setup, nClearFlags, whatToDraw );
28282828
}
28292829

28302830
bool CHLClient::ShouldHideLoadingPlaque( void )
@@ -3042,7 +3042,7 @@ bool CHLClient::SupportsRandomMaps()
30423042
#endif
30433043
}
30443044

3045-
extern IViewRender *view;
3045+
extern IViewRender *g_view;
30463046

30473047
//-----------------------------------------------------------------------------
30483048
// Purpose: interface from materialsystem to client, currently just for recording into tools
@@ -3057,7 +3057,7 @@ class CClientMaterialSystem : public IClientMaterialSystem
30573057
if ( !clienttools->IsInRecordingMode() )
30583058
return HTOOLHANDLE_INVALID;
30593059

3060-
C_BaseEntity *pEnt = view->GetCurrentlyDrawingEntity();
3060+
C_BaseEntity *pEnt = g_view->GetCurrentlyDrawingEntity();
30613061
if ( !pEnt || !pEnt->IsToolRecording() )
30623062
return HTOOLHANDLE_INVALID;
30633063

src/game/client/clientleafsystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,7 @@ int CClientLeafSystem::ComputeTranslucency( int nFrameNumber, int nViewID, int n
22232223
ComputeScreenFade( info, flMinLevelFadeArea, flMaxLevelFadeArea, nCount, pAlphaInfo );
22242224

22252225
float flMinViewFadeArea, flMaxViewFadeArea;
2226-
view->GetScreenFadeDistances( &flMinViewFadeArea, &flMaxViewFadeArea );
2226+
g_view->GetScreenFadeDistances( &flMinViewFadeArea, &flMaxViewFadeArea );
22272227
ComputeScreenFade( info, flMinViewFadeArea, flMaxViewFadeArea, nCount, pAlphaInfo );
22282228
}
22292229

src/game/client/clientshadowmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5768,7 +5768,7 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
57685768
shadowView.m_bRenderFlashlightDepthTranslucents = flashlightState.m_bGlobalLight;
57695769

57705770
// Render to the shadow depth texture with appropriate view
5771-
view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView );
5771+
g_view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView );
57725772

57735773
// Associate the shadow depth texture and stencil bit with the flashlight for use during scene rendering
57745774
shadowmgr->SetFlashlightDepthTexture( shadow.m_ShadowHandle, shadowDepthTexture, 0 );

src/game/client/glow_overlay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void CGlowOverlay::UpdateGlowObstruction( const Vector &vToGlow, bool bCacheFull
201201
{
202202
if ( m_bInSky )
203203
{
204-
const CViewSetup *pViewSetup = view->GetViewSetup();
204+
const CViewSetup *pViewSetup = g_view->GetViewSetup();
205205
Vector pos = CurrentViewOrigin() + m_vDirection * (pViewSetup->zFar * 0.999f);
206206
pixelvis_queryparams_t params;
207207
params.Init( pos, m_flProxyRadius, CalcGlowAspect() );
@@ -383,7 +383,7 @@ void CGlowOverlay::Draw( bool bCacheFullSceneState )
383383

384384
//Get our diagonal radius
385385
float radius = (vRight+vUp).Length();
386-
if ( R_CullSphere( view->GetFrustum(), 5, &vBasePt, radius ) )
386+
if ( R_CullSphere( g_view->GetFrustum(), 5, &vBasePt, radius ) )
387387
continue;
388388

389389
// Get our material (deferred default load)

0 commit comments

Comments
 (0)