cl_dll/view.cpp
404142434445464748
#include
#include "ScreenSpaceEffects.h"
#if defined( HL2_CLIENT_DLL ) || defined( CSTRIKE_DLL )
#define USE_MONITORS
#endif
#ifdef USE_MONITORS
#include "materialsystem/IMaterialSystem.h"
4041424344454647484950
#include
#include "ScreenSpaceEffects.h"
// Bug #0000385: point_camera & func_monitor in-titties
// Allways USE_MONITORS
//#if defined( HL2_CLIENT_DLL ) || defined( CSTRIKE_DLL )
#define USE_MONITORS
//#endif
#ifdef USE_MONITORS
#include "materialsystem/IMaterialSystem.h"
979899100101102103
// 54 degrees approximates a 35mm camera - we determined that this makes the viewmodels
// and motions look the most natural.
ConVar v_viewmodel_fov( "viewmodel_fov", "54", FCVAR_CHEAT );
ConVar mat_viewportscale( "mat_viewportscale", "1.0", FCVAR_CHEAT );
ConVar cl_leveloverview( "cl_leveloverview", "0", FCVAR_CHEAT );
99100101102103104105
// 54 degrees approximates a 35mm camera - we determined that this makes the viewmodels
// and motions look the most natural.
ConVar v_viewmodel_fov( "viewmodel_fov", "74", FCVAR_ARCHIVE );
ConVar mat_viewportscale( "mat_viewportscale", "1.0", FCVAR_CHEAT );
ConVar cl_leveloverview( "cl_leveloverview", "0", FCVAR_CHEAT );
699700701702703704
//Adjust the viewmodel's FOV to move with any FOV offsets on the viewer's end
m_View.fovViewmodel = g_pClientMode->GetViewModelFOV() - flFOVOffset;
// Disable spatical partition access
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, true );
// Enable access to all model bones
701702703704705706707708709710711712713
//Adjust the viewmodel's FOV to move with any FOV offsets on the viewer's end
m_View.fovViewmodel = g_pClientMode->GetViewModelFOV() - flFOVOffset;
// --> Mirv: Make sure this doesn't go negative
if (m_View.fovViewmodel < 10.0f)
{
m_View.fovViewmodel = 10.0f;
}
// <-- Mirv
// Disable spatical partition access
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, true );
// Enable access to all model bones
918919920921922923924925926927928
g_bRenderingCameraView = true;
#endif
// FIXME: this should check for the ability to do a render target maybe instead.
// FIXME: shouldn't have to truck through all of the visible entities for this!!!!
ITexture *pCameraTarget = GetCameraTexture();
int width = pCameraTarget->GetActualWidth();
int height = pCameraTarget->GetActualHeight();
C_BasePlayer *player = C_BasePlayer::GetLocalPlayer();
927928929930931932933934935936937938939940
g_bRenderingCameraView = true;
#endif
// Bug #0000390: multiple render targets for cameras
/*
// FIXME: this should check for the ability to do a render target maybe instead.
// FIXME: shouldn't have to truck through all of the visible entities for this!!!!
ITexture *pCameraTarget = GetCameraTexture();
int width = pCameraTarget->GetActualWidth();
int height = pCameraTarget->GetActualHeight();
*/
C_BasePlayer *player = C_BasePlayer::GetLocalPlayer();
931932933934935936
if ( !pCameraEnt->IsActive() || pCameraEnt->IsDormant() )
continue;
if ( !DrawOneMonitor( pCameraTarget, cameraNum, pCameraEnt, cameraView, player, 0, 0, width, height ) )
continue;
943944945946947948949950951952953954955956957958959960961962
if ( !pCameraEnt->IsActive() || pCameraEnt->IsDormant() )
continue;
// Bug #0000390: multiple render targets for cameras
// -->
ITexture *pCameraTarget = materials->FindTexture( pCameraEnt->GetRenderTarget(), TEXTURE_GROUP_RENDER_TARGET );
if( IsErrorTexture( pCameraTarget ) )
{
Msg( "Error: render target texture not found - defaulting to _rt_Camera!\n" );
pCameraTarget = GetCameraTexture();
}
int width = pCameraTarget->GetActualWidth();
int height = pCameraTarget->GetActualHeight();
// <--
if ( !DrawOneMonitor( pCameraTarget, cameraNum, pCameraEnt, cameraView, player, 0, 0, width, height ) )
continue;
1069107010711072107310741075
if ( pPlayer )
{
// Override view model if necessary
if ( !pPlayer->m_Local.m_bDrawViewmodel )
{
drawViewModel = false;
}
10951096109710981099110011011102
if ( pPlayer )
{
// Override view model if necessary
// Added a conditional for SourceTV as this was turning off viewmodels for SourceTV demos -squeek
if ( !pPlayer->m_Local.m_bDrawViewmodel && !pPlayer->IsHLTV() )
{
drawViewModel = false;
}