diff options
| author | Joe Ludwig <[email protected]> | 2014-05-15 13:59:18 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2014-05-15 13:59:18 -0700 |
| commit | 53e78c503e6e9c7d15e2eefc480755fe37dd7077 (patch) | |
| tree | c8cc106eb4c0a2b2b5d79f534f2facb0514f5f55 /mp/src/game/client | |
| parent | Added many shader source files (diff) | |
| download | source-sdk-2013-53e78c503e6e9c7d15e2eefc480755fe37dd7077.tar.xz source-sdk-2013-53e78c503e6e9c7d15e2eefc480755fe37dd7077.zip | |
General:
* Upgraded Steamworks SDK to v1.29
* Fixed mod compatibility problem with Multiplayer Base that was introduced in September.
* In Hammer, while using the Vertex Tool, pressing CTRL+B will snap selected vertices to the grid.
Virtual Reality:
* Mods that support virtual reality now need to have a line in gameinfo.txt that says “supportsvr 1”. This indicates to gameui and engine that certain UI should be enabled.
* VR-enabled mods will now start up in VR mode when launched from Steam’s VR mode.
Windows:
* Upgraded to Visual Studio 2013. If you need to build projects for VS 2010, add /2010 to your VPC command line.
OSX:
* Upgraded to XCode 5.
Diffstat (limited to 'mp/src/game/client')
27 files changed, 98 insertions, 71 deletions
diff --git a/mp/src/game/client/beamdraw.cpp b/mp/src/game/client/beamdraw.cpp index 2bba8efe..8fc7d499 100644 --- a/mp/src/game/client/beamdraw.cpp +++ b/mp/src/game/client/beamdraw.cpp @@ -589,7 +589,7 @@ void DrawTeslaSegs( int noise_divisions, float *prgNoise, const model_t* spritem curSeg.m_flWidth = ((fraction*(endWidth-startWidth))+startWidth) * 2; // Reduce the width by the current number of branches we've had - for ( int j = 0; i < iBranches; j++ ) + for ( int j = 0; j < iBranches; j++ ) { curSeg.m_flWidth *= 0.5; } @@ -619,7 +619,7 @@ void DrawTeslaSegs( int noise_divisions, float *prgNoise, const model_t* spritem // Reduce the end width by the current number of branches we've had flEndWidth = endWidth; - for ( int j = 0; i < iBranches; j++ ) + for ( int j = 0; j < iBranches; j++ ) { flEndWidth *= 0.5; } diff --git a/mp/src/game/client/c_baseanimating.cpp b/mp/src/game/client/c_baseanimating.cpp index c7cc08b4..c41ff46b 100644 --- a/mp/src/game/client/c_baseanimating.cpp +++ b/mp/src/game/client/c_baseanimating.cpp @@ -3687,6 +3687,8 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int if ( token ) { const char* mtoken = ModifyEventParticles( token ); + if ( !mtoken || mtoken[0] == '\0' ) + return; Q_strncpy( szParticleEffect, mtoken, sizeof(szParticleEffect) ); } @@ -5298,8 +5300,8 @@ void C_BaseAnimating::ResetSequenceInfo( void ) m_bSequenceFinished = false; m_flLastEventCheck = 0; - m_nNewSequenceParity = ( ++m_nNewSequenceParity ) & EF_PARITY_MASK; - m_nResetEventsParity = ( ++m_nResetEventsParity ) & EF_PARITY_MASK; + m_nNewSequenceParity = ( m_nNewSequenceParity + 1 ) & EF_PARITY_MASK; + m_nResetEventsParity = ( m_nResetEventsParity + 1 ) & EF_PARITY_MASK; // FIXME: why is this called here? Nothing should have changed to make this nessesary SetEventIndexForSequence( pStudioHdr->pSeqdesc( GetSequence() ) ); diff --git a/mp/src/game/client/c_colorcorrection.cpp b/mp/src/game/client/c_colorcorrection.cpp index 56f1a65e..6960031d 100644 --- a/mp/src/game/client/c_colorcorrection.cpp +++ b/mp/src/game/client/c_colorcorrection.cpp @@ -122,7 +122,7 @@ void C_ColorCorrection::ClientThink() return; } - CBaseEntity *pPlayer = UTIL_PlayerByIndex(1); + C_BaseEntity *pPlayer = C_BasePlayer::GetLocalPlayer(); if( !pPlayer ) return; diff --git a/mp/src/game/client/c_func_breakablesurf.cpp b/mp/src/game/client/c_func_breakablesurf.cpp index 03176315..3118cd5e 100644 --- a/mp/src/game/client/c_func_breakablesurf.cpp +++ b/mp/src/game/client/c_func_breakablesurf.cpp @@ -154,7 +154,7 @@ private: Assert( type < NUM_EDGE_STYLES ); Assert( type >= 0 ); // Clear old value - m_nPanelBits[ w ][ h ] &= ( ~0x03 << 2 ); + m_nPanelBits[ w ][ h ] &= 0xF0; // ( ~0x03 << 2 ); Left shifting a negative value has undefined behavior. Use the constant 0xF0 instead. // Insert new value m_nPanelBits[ w ][ h ] |= ( type << 2 ); } diff --git a/mp/src/game/client/c_te_bloodstream.cpp b/mp/src/game/client/c_te_bloodstream.cpp index 2c16e3a1..d543d111 100644 --- a/mp/src/game/client/c_te_bloodstream.cpp +++ b/mp/src/game/client/c_te_bloodstream.cpp @@ -114,7 +114,7 @@ void TE_BloodStream( IRecipientFilter& filter, float delay, float arc = 0.05; int count, count2; float num; - int speedCopy = amount; + float speedCopy = amount; Vector dir; VectorCopy( *direction, dir ); diff --git a/mp/src/game/client/c_te_decal.cpp b/mp/src/game/client/c_te_decal.cpp index 4ea42e5e..f0212ee1 100644 --- a/mp/src/game/client/c_te_decal.cpp +++ b/mp/src/game/client/c_te_decal.cpp @@ -139,7 +139,7 @@ void TE_Decal( IRecipientFilter& filter, float delay, // Only decal the world + brush models // Here we deal with decals on entities. C_BaseEntity* ent; - if ( ( ent = cl_entitylist->GetEnt( entity ) ) == false ) + if ( ( ent = cl_entitylist->GetEnt( entity ) ) == NULL ) return; ent->AddDecal( *start, *pos, *pos, hitbox, diff --git a/mp/src/game/client/cdll_client_int.cpp b/mp/src/game/client/cdll_client_int.cpp index b5a53e72..10cce078 100644 --- a/mp/src/game/client/cdll_client_int.cpp +++ b/mp/src/game/client/cdll_client_int.cpp @@ -1717,7 +1717,11 @@ void CHLClient::LevelShutdown( void ) messagechars->Clear(); +#ifndef TF_CLIENT_DLL + // don't want to do this for TF2 because we have particle systems in our + // character loadout screen that can be viewed when we're not connected to a server g_pParticleSystemMgr->UncacheAllParticleSystems(); +#endif UncacheAllMaterials(); #ifdef _XBOX diff --git a/mp/src/game/client/client_virtualreality.cpp b/mp/src/game/client/client_virtualreality.cpp index d729210e..fb6e4417 100644 --- a/mp/src/game/client/client_virtualreality.cpp +++ b/mp/src/game/client/client_virtualreality.cpp @@ -21,6 +21,7 @@ #include "vgui_controls/Controls.h" #include "tier0/vprof_telemetry.h" #include <time.h> +#include "steam/steam_api.h" const char *COM_GetModDirectory(); // return the mod dir (rather than the complete -game param, which can be a path) @@ -260,6 +261,8 @@ CClientVirtualReality::CClientVirtualReality() m_rtLastMotionSample = 0; m_bMotionUpdated = false; + m_bForceVRMode = false; + #if defined( USE_SDL ) m_nNonVRSDLDisplayIndex = 0; #endif @@ -1363,28 +1366,32 @@ void CClientVirtualReality::Activate() if( !g_pSourceVR ) return; - // see if VR mode is even enabled - if( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter == -1 ) + // These checks don't apply if we're in VR mode because Steam said so. + if ( !m_bForceVRMode ) { - Warning( "Enable VR mode in the video options before trying to use it.\n" ); - return; - } + // see if VR mode is even enabled + if ( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter == -1 ) + { + Warning( "Enable VR mode in the video options before trying to use it.\n" ); + return; + } - // See if we have an actual adapter - int32 nVRModeAdapter = g_pSourceVR->GetVRModeAdapter(); - if( nVRModeAdapter == -1 ) - { - Warning( "Unable to get VRMode adapter from OpenVR. VR mode cannot be enabled. Try restarting and then enabling VR again.\n" ); - return; - } + // See if we have an actual adapter + int32 nVRModeAdapter = g_pSourceVR->GetVRModeAdapter(); + if ( nVRModeAdapter == -1 ) + { + Warning( "Unable to get VRMode adapter from OpenVR. VR mode cannot be enabled. Try restarting and then enabling VR again.\n" ); + return; + } - // we can only activate if we've got a VR device - if( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter != nVRModeAdapter ) - { - Warning( "VR Mode expects adapter %d which is different from %d which we are currently using. Try restarting and enabling VR mode again.\n", - nVRModeAdapter, materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter ); - engine->ExecuteClientCmd( "mat_enable_vrmode 0\n" ); - return; + // we can only activate if we've got a VR device + if ( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter != nVRModeAdapter ) + { + Warning( "VR Mode expects adapter %d which is different from %d which we are currently using. Try restarting and enabling VR mode again.\n", + nVRModeAdapter, materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter ); + engine->ExecuteClientCmd( "mat_enable_vrmode 0\n" ); + return; + } } @@ -1429,18 +1436,22 @@ void CClientVirtualReality::Activate() int nViewportWidth, nViewportHeight; g_pSourceVR->GetViewportBounds( ISourceVirtualReality::VREye_Left, NULL, NULL, &nViewportWidth, &nViewportHeight ); - vgui::surface()->SetFullscreenViewportAndRenderTarget( 0, 0, nViewportWidth, nViewportHeight, g_pSourceVR->GetRenderTarget( ISourceVirtualReality::VREye_Left, ISourceVirtualReality::RT_Color ) ); + g_pMatSystemSurface->SetFullscreenViewportAndRenderTarget( 0, 0, nViewportWidth, nViewportHeight, g_pSourceVR->GetRenderTarget( ISourceVirtualReality::VREye_Left, ISourceVirtualReality::RT_Color ) ); vgui::ivgui()->SetVRMode( true ); - VRRect_t rect; - if( g_pSourceVR->GetDisplayBounds( &rect ) ) + // we can skip this extra mode change if we've always been in VR mode + if ( !m_bForceVRMode ) { + VRRect_t rect; + if ( g_pSourceVR->GetDisplayBounds( &rect ) ) + { - // set mode - char szCmd[ 256 ]; - Q_snprintf( szCmd, sizeof( szCmd ), "mat_setvideomode %i %i %i\n", rect.nWidth, rect.nHeight, vr_force_windowed.GetBool()? 1 : 0 ); - engine->ClientCmd_Unrestricted( szCmd ); + // set mode + char szCmd[256]; + Q_snprintf( szCmd, sizeof(szCmd), "mat_setvideomode %i %i %i\n", rect.nWidth, rect.nHeight, vr_force_windowed.GetBool() ? 1 : 0 ); + engine->ClientCmd_Unrestricted( szCmd ); + } } } @@ -1455,7 +1466,7 @@ void CClientVirtualReality::Deactivate() g_pMatSystemSurface->ForceScreenSizeOverride(false, 0, 0 ); g_pMaterialSystem->GetRenderContext()->Viewport( 0, 0, m_nNonVRWidth, m_nNonVRHeight ); - vgui::surface()->SetFullscreenViewportAndRenderTarget( 0, 0, m_nNonVRWidth, m_nNonVRHeight, NULL ); + g_pMatSystemSurface->SetFullscreenViewportAndRenderTarget( 0, 0, m_nNonVRWidth, m_nNonVRHeight, NULL ); static ConVarRef cl_software_cursor( "cl_software_cursor" ); vgui::surface()->SetSoftwareCursor( cl_software_cursor.GetBool() ); @@ -1499,7 +1510,10 @@ void CClientVirtualReality::Deactivate() // Called when startup is complete void CClientVirtualReality::StartupComplete() { - if( vr_activate_default.GetBool() ) + if ( g_pSourceVR ) + m_bForceVRMode = g_pSourceVR->ShouldForceVRMode(); + + if ( vr_activate_default.GetBool( ) || m_bForceVRMode ) Activate(); } diff --git a/mp/src/game/client/client_virtualreality.h b/mp/src/game/client/client_virtualreality.h index 9aadfeb3..3a8c9469 100644 --- a/mp/src/game/client/client_virtualreality.h +++ b/mp/src/game/client/client_virtualreality.h @@ -147,6 +147,7 @@ private: int m_iAlignTorsoAndViewToWeaponCountdown; bool m_bMotionUpdated; + bool m_bForceVRMode; RTime32 m_rtLastMotionSample; diff --git a/mp/src/game/client/clientmode_shared.cpp b/mp/src/game/client/clientmode_shared.cpp index b6dee29c..5d10db6c 100644 --- a/mp/src/game/client/clientmode_shared.cpp +++ b/mp/src/game/client/clientmode_shared.cpp @@ -228,9 +228,9 @@ static void __MsgFunc_VGUIMenu( bf_read &msg ) && keys->GetInt( "type", 0 ) == 2 // URL message type ) { const char *pszURL = keys->GetString( "msg", "" ); - if ( Q_strncmp( pszURL, "http://", 7 ) != 0 && Q_strncmp( pszURL, "https://", 8 ) != 0 ) + if ( Q_strncmp( pszURL, "http://", 7 ) != 0 && Q_strncmp( pszURL, "https://", 8 ) != 0 && Q_stricmp( pszURL, "about:blank" ) != 0 ) { - Warning( "Blocking MOTD URL '%s'; must begin with 'http://' or 'https://'\n", pszURL ); + Warning( "Blocking MOTD URL '%s'; must begin with 'http://' or 'https://' or be about:blank\n", pszURL ); keys->deleteThis(); return; } diff --git a/mp/src/game/client/detailobjectsystem.cpp b/mp/src/game/client/detailobjectsystem.cpp index 7aa871ea..3e211bb0 100644 --- a/mp/src/game/client/detailobjectsystem.cpp +++ b/mp/src/game/client/detailobjectsystem.cpp @@ -1477,7 +1477,7 @@ void CDetailObjectSystem::LevelInitPreEntity() PrecacheMaterial( DETAIL_SPRITE_MATERIAL ); IMaterial *pMat = m_DetailSpriteMaterial; // adjust for non-square textures (cropped) - float flRatio = pMat->GetMappingWidth() / pMat->GetMappingHeight(); + float flRatio = (float)( pMat->GetMappingWidth() ) / pMat->GetMappingHeight(); if ( flRatio > 1.0 ) { for( int i = 0; i<m_DetailSpriteDict.Count(); i++ ) diff --git a/mp/src/game/client/flashlighteffect.h b/mp/src/game/client/flashlighteffect.h index 6d5282ba..d291c382 100644 --- a/mp/src/game/client/flashlighteffect.h +++ b/mp/src/game/client/flashlighteffect.h @@ -18,7 +18,7 @@ class CFlashlightEffect public: CFlashlightEffect(int nEntIndex = 0); - ~CFlashlightEffect(); + virtual ~CFlashlightEffect(); virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance); void TurnOn(); diff --git a/mp/src/game/client/game_controls/buymenu.cpp b/mp/src/game/client/game_controls/buymenu.cpp index 40cbeab7..4ae693ae 100644 --- a/mp/src/game/client/game_controls/buymenu.cpp +++ b/mp/src/game/client/game_controls/buymenu.cpp @@ -86,7 +86,6 @@ void CBuyMenu::ShowPanel(bool bShow) void CBuyMenu::Update() { //Don't need to do anything, but do need to implement this function as base is pure virtual - NULL; } void CBuyMenu::OnClose() { diff --git a/mp/src/game/client/hl2/hud_weaponselection.cpp b/mp/src/game/client/hl2/hud_weaponselection.cpp index 9d223169..f5600705 100644 --- a/mp/src/game/client/hl2/hud_weaponselection.cpp +++ b/mp/src/game/client/hl2/hud_weaponselection.cpp @@ -598,13 +598,13 @@ void CHudWeaponSelection::Paint() // bucket style int screenCenterX = (int) fCenterX; - int screenCenterY = (int) fCenterY - 15; // Height isn't quite screen height, so adjust for center alignement + int screenCenterY = (int) fCenterY - 15; // Height isn't quite screen height, so adjust for center alignment // Modifiers for the four directions. Used to change the x and y offsets // of each box based on which bucket we're drawing. Bucket directions are // 0 = UP, 1 = RIGHT, 2 = DOWN, 3 = LEFT - int xModifiers[] = { 0, 1, 0, -1 }; - int yModifiers[] = { -1, 0, 1, 0 }; + int xModifiers[] = { 0, 1, 0, -1, -1, 1 }; + int yModifiers[] = { -1, 0, 1, 0, 1, 1 }; // Draw the four buckets for ( int i = 0; i < MAX_WEAPON_SLOTS; ++i ) @@ -1453,7 +1453,7 @@ void CHudWeaponSelection::SelectWeaponSlot( int iSlot ) return; // Don't try and read past our possible number of slots - if ( iSlot > MAX_WEAPON_SLOTS ) + if ( iSlot >= MAX_WEAPON_SLOTS ) return; // Make sure the player's allowed to switch weapons diff --git a/mp/src/game/client/hud.cpp b/mp/src/game/client/hud.cpp index 1baad2e1..af50b187 100644 --- a/mp/src/game/client/hud.cpp +++ b/mp/src/game/client/hud.cpp @@ -512,7 +512,7 @@ void CHud::Shutdown( void ) //----------------------------------------------------------------------------- -// Purpose: LevelInit's called whenever a new level's starting +// Purpose: LevelInit's called whenever a new level is starting //----------------------------------------------------------------------------- void CHud::LevelInit( void ) { @@ -533,11 +533,11 @@ void CHud::LevelInit( void ) } //----------------------------------------------------------------------------- -// Purpose: LevelShutdown's called whenever a level's finishing +// Purpose: LevelShutdown's called whenever a level is finishing //----------------------------------------------------------------------------- void CHud::LevelShutdown( void ) { - // Tell all the registered hud elements to LevelInit + // Tell all the registered hud elements to LevelShutdown for ( int i = 0; i < m_HudList.Size(); i++ ) { m_HudList[i]->LevelShutdown(); diff --git a/mp/src/game/client/hud.h b/mp/src/game/client/hud.h index 7b637c64..b623a3eb 100644 --- a/mp/src/game/client/hud.h +++ b/mp/src/game/client/hud.h @@ -107,9 +107,9 @@ public: void VidInit( void ); // Shutdown's called when the engine's shutting down void Shutdown( void ); - // LevelInit's called whenever a new level's starting + // LevelInit's called whenever a new level is starting void LevelInit( void ); - // LevelShutdown's called whenever a level's finishing + // LevelShutdown's called whenever a level is finishing void LevelShutdown( void ); void ResetHUD( void ); diff --git a/mp/src/game/client/hud_vote.cpp b/mp/src/game/client/hud_vote.cpp index 55b8f389..659669a0 100644 --- a/mp/src/game/client/hud_vote.cpp +++ b/mp/src/game/client/hud_vote.cpp @@ -662,7 +662,8 @@ void CVoteSetupDialog::OnItemSelected( vgui::Panel *panel ) for ( int index = 0; index < m_VoteIssuesPopFiles.Count(); index++ ) { // Don't show the current pop file - if ( TFObjectiveResource()->GetMvMPopFileName() == '\0' ) + const char *pszPopFileName = TFObjectiveResource()->GetMvMPopFileName(); + if ( !pszPopFileName || !pszPopFileName[0] ) { // Use the map name char szShortMapName[ MAX_MAP_NAME ]; diff --git a/mp/src/game/client/hudelement.h b/mp/src/game/client/hudelement.h index e6de48b9..b903de5d 100644 --- a/mp/src/game/client/hudelement.h +++ b/mp/src/game/client/hudelement.h @@ -36,9 +36,9 @@ public: // called whenever the video mode changes, and whenever Init() would be called, so the hud can vid init itself virtual void VidInit( void ) { return; } - // LevelInit's called whenever a new level's starting + // LevelInit's called whenever a new level is starting virtual void LevelInit( void ) { return; }; - // LevelShutdown's called whenever a level's finishing + // LevelShutdown's called whenever a level is finishing virtual void LevelShutdown( void ) { return; }; // called whenever the hud receives "reset" message, which is (usually) every time the client respawns after getting killed diff --git a/mp/src/game/client/in_joystick.cpp b/mp/src/game/client/in_joystick.cpp index 2f0e3dad..71d03a08 100644 --- a/mp/src/game/client/in_joystick.cpp +++ b/mp/src/game/client/in_joystick.cpp @@ -846,6 +846,8 @@ void CInput::JoyStickMove( float frametime, CUserCmd *cmd ) { angle = m_flPreviousJoystickYaw * joy_yawsensitivity.GetFloat() * aspeed * 180.0; } + + angle = JoyStickAdjustYaw( angle ); viewangles[YAW] += angle; cmd->mousedx = angle; diff --git a/mp/src/game/client/input.h b/mp/src/game/client/input.h index 356c7532..e34b82db 100644 --- a/mp/src/game/client/input.h +++ b/mp/src/game/client/input.h @@ -141,6 +141,7 @@ private: void ControllerMove ( float frametime, CUserCmd *cmd ); void JoyStickMove ( float frametime, CUserCmd *cmd ); float ScaleAxisValue( const float axisValue, const float axisThreshold ); + virtual float JoyStickAdjustYaw( float flSpeed ) { return flSpeed; } // Call this to get the cursor position. The call will be logged in the VCR file if there is one. void GetMousePos(int &x, int &y); diff --git a/mp/src/game/client/prediction.cpp b/mp/src/game/client/prediction.cpp index 7e00732c..6646f8f9 100644 --- a/mp/src/game/client/prediction.cpp +++ b/mp/src/game/client/prediction.cpp @@ -931,7 +931,8 @@ void CPrediction::SetIdealPitch ( C_BasePlayer *player, const Vector& origin, co Vector top, bottom; float floor_height[MAX_FORWARD]; int i, j; - int step, dir, steps; + float step, dir; + int steps; trace_t tr; if ( player->GetGroundEntity() == NULL ) diff --git a/mp/src/game/client/replay/replayyoutubeapi.cpp b/mp/src/game/client/replay/replayyoutubeapi.cpp index 399d12ca..faab2e95 100644 --- a/mp/src/game/client/replay/replayyoutubeapi.cpp +++ b/mp/src/game/client/replay/replayyoutubeapi.cpp @@ -24,7 +24,7 @@ #include "confirm_dialog.h" #include "replay/vgui/replaybrowserdetailspanel.h" -#include "base_gcmessages.h" +#include "base_gcmessages.pb.h" #include "youtubeapi.h" #include "steamworks_gamestats.h" diff --git a/mp/src/game/client/sixense/in_sixense_gesture_bindings.cpp b/mp/src/game/client/sixense/in_sixense_gesture_bindings.cpp index 7ede9ba5..0f0f7105 100644 --- a/mp/src/game/client/sixense/in_sixense_gesture_bindings.cpp +++ b/mp/src/game/client/sixense/in_sixense_gesture_bindings.cpp @@ -879,10 +879,6 @@ bool SixenseGestureBindings::ActionTokenToStr( sixenseUtils::IButtonStates::Acti { Q_snprintf( buf, buflen, "tilt_gesture" ); } - else if( action == sixenseUtils::IButtonStates::ACTION_BUTTON_PRESS ) - { - Q_snprintf( buf, buflen, "button_press" ); - } else if( action == sixenseUtils::IButtonStates::ACTION_TRIGGER_PRESS ) { Q_snprintf( buf, buflen, "trigger_press" ); diff --git a/mp/src/game/client/vgui_fpspanel.cpp b/mp/src/game/client/vgui_fpspanel.cpp index a44dde34..aec28add 100644 --- a/mp/src/game/client/vgui_fpspanel.cpp +++ b/mp/src/game/client/vgui_fpspanel.cpp @@ -189,12 +189,12 @@ void GetFPSColor( int nFps, unsigned char ucColor[3] ) if ( IsPC() && g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 95 ) { nFPSThreshold1 = 60; - nFPSThreshold1 = 50; + nFPSThreshold2 = 50; } else if ( IsX360() || g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 90 ) { nFPSThreshold1 = 30; - nFPSThreshold1 = 25; + nFPSThreshold2 = 25; } if ( nFps >= nFPSThreshold1 ) diff --git a/mp/src/game/client/vgui_messagechars.cpp b/mp/src/game/client/vgui_messagechars.cpp index 547164f6..1d1410f1 100644 --- a/mp/src/game/client/vgui_messagechars.cpp +++ b/mp/src/game/client/vgui_messagechars.cpp @@ -235,9 +235,10 @@ int CMessageCharsPanel::AddText( Assert( !msg->text ); - msg->text = new char[ Q_strlen( data ) + 1 ]; + int textLength = Q_strlen( data ) + 1; + msg->text = new char[ textLength ]; Assert( msg->text ); - Q_strncpy( msg->text, data, sizeof( msg->text ) ); + Q_strncpy( msg->text, data, textLength ); if ( flTime ) msg->fTTL = gpGlobals->curtime + flTime; diff --git a/mp/src/game/client/viewpostprocess.cpp b/mp/src/game/client/viewpostprocess.cpp index 3f74acdc..39c2237e 100644 --- a/mp/src/game/client/viewpostprocess.cpp +++ b/mp/src/game/client/viewpostprocess.cpp @@ -1885,7 +1885,8 @@ static void DrawPyroVignette( int nDestX, int nDestY, int nWidth, int nHeight, / if ( pyro_vignette.GetInt() > 1 ) { - Vector2D vMaxSize( ( float )nScreenWidth / ( float )nScreenWidth / NUM_PYRO_SEGMENTS * 2.0f, ( float )nScreenHeight / ( float )nScreenHeight / NUM_PYRO_SEGMENTS * 2.0f ); + float flPyroSegments = 2.0f / NUM_PYRO_SEGMENTS; + Vector2D vMaxSize( flPyroSegments, flPyroSegments ); if ( !bInit ) { diff --git a/mp/src/game/client/viewrender.cpp b/mp/src/game/client/viewrender.cpp index a9ef4eb8..a629071b 100644 --- a/mp/src/game/client/viewrender.cpp +++ b/mp/src/game/client/viewrender.cpp @@ -2248,7 +2248,7 @@ void CViewRender::RenderView( const CViewSetup &view, int nClearFlags, int whatT // let vgui know where to render stuff for the forced-to-framebuffer panels if( UseVR() ) { - vgui::surface()->SetFullscreenViewportAndRenderTarget( viewFramebufferX, viewFramebufferY, viewFramebufferWidth, viewFramebufferHeight, saveRenderTarget ); + g_pMatSystemSurface->SetFullscreenViewportAndRenderTarget( viewFramebufferX, viewFramebufferY, viewFramebufferWidth, viewFramebufferHeight, saveRenderTarget ); } // clear the render target if we need to @@ -3885,7 +3885,7 @@ static void DrawOpaqueRenderables_DrawStaticProps( CClientRenderablesList::CEntr for( CClientRenderablesList::CEntry *itEntity = pEntitiesBegin; itEntity < pEntitiesEnd; ++ itEntity ) { if ( itEntity->m_pRenderable ) - NULL; + /**/; else continue; @@ -3935,7 +3935,7 @@ void CRendering3dView::DrawOpaqueRenderables( ERenderDepthMode DepthMode ) RopeManager()->ResetRenderCache(); g_pParticleSystemMgr->ResetRenderCache(); - bool const bDrawopaquestaticpropslast = r_drawopaquestaticpropslast.GetBool(); + //bool const bDrawopaquestaticpropslast = r_drawopaquestaticpropslast.GetBool(); // @@ -4101,16 +4101,20 @@ void CRendering3dView::DrawOpaqueRenderables( ERenderDepthMode DepthMode ) for ( int bucket = 0; bucket < RENDER_GROUP_CFG_NUM_OPAQUE_ENT_BUCKETS; ++ bucket ) { - if ( bDrawopaquestaticpropslast ) + // PVS-Studio pointed out that the two sides of the if/else were identical. Fixing + // this long-broken behavior would change rendering, so I fixed the code but + // commented out the new behavior. Uncomment the if statement and else block + // when needed. + //if ( bDrawopaquestaticpropslast ) { DrawOpaqueRenderables_Range( pEnts[bucket][0], pEnts[bucket][1], DepthMode ); DrawOpaqueRenderables_DrawStaticProps( pProps[bucket][0], pProps[bucket][1], DepthMode ); } - else + /*else { - DrawOpaqueRenderables_Range( pEnts[bucket][0], pEnts[bucket][1], DepthMode ); DrawOpaqueRenderables_DrawStaticProps( pProps[bucket][0], pProps[bucket][1], DepthMode ); - } + DrawOpaqueRenderables_Range( pEnts[bucket][0], pEnts[bucket][1], DepthMode ); + }*/ } |