Skip to content
Open
4 changes: 2 additions & 2 deletions src/game/client/beamdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ void DrawSplineSegs( int noise_divisions, float *prgNoise,
}
else if ( flags & FBEAM_SHADEOUT )
{
float fadeFraction = fadeLength/length;
brightness = 1.0 - (fraction/fadeFraction);
float outFadeFraction = fadeLength/length;
brightness = 1.0 - (fraction/outFadeFraction);
if (brightness < 0)
{
brightness = 0;
Expand Down
10 changes: 5 additions & 5 deletions src/game/client/c_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2280,11 +2280,11 @@ void CSnowFallManager::FindSnowVolumes( Vector &vecCenter, float flRadius, Vecto
{
for ( iSnow = 0; iSnow < m_nActiveSnowCount; ++iSnow )
{
Vector vecCenter, vecMin, vecMax;
vecCenter = ( m_aSnow[iSnow].m_vecMin, m_aSnow[iSnow].m_vecMax ) * 0.5;
vecMin = m_aSnow[iSnow].m_vecMin - vecCenter;
vecMax = m_aSnow[iSnow].m_vecMax - vecCenter;
debugoverlay->AddBoxOverlay( vecCenter, vecMin, vecMax, QAngle( 0, 0, 0 ), 200, 0, 0, 25, r_SnowDebugBox.GetFloat() );
Vector vecCenterDbg, vecMin, vecMax;
vecCenterDbg = ( m_aSnow[iSnow].m_vecMin, m_aSnow[iSnow].m_vecMax ) * 0.5;
vecMin = m_aSnow[iSnow].m_vecMin - vecCenterDbg;
vecMax = m_aSnow[iSnow].m_vecMax - vecCenterDbg;
debugoverlay->AddBoxOverlay( vecCenterDbg, vecMin, vecMax, QAngle( 0, 0, 0 ), 200, 0, 0, 25, r_SnowDebugBox.GetFloat() );
}
}
#endif
Expand Down
12 changes: 6 additions & 6 deletions src/game/client/c_entitydissolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void C_EntityDissolve::BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4

// Make a couple of tries at it
int iTries = -1;
Vector vecForward;
Vector vecRandForward;
trace_t tr;
do
{
Expand All @@ -211,20 +211,20 @@ void C_EntityDissolve::BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4
{
QAngle vecTemp = vecAngles;
vecTemp[YAW] += flYawOffset;
AngleVectors( vecTemp, &vecForward );
AngleVectors( vecTemp, &vecRandForward );

// Randomly angle it up or down
vecForward.z = RandomFloat( -1, 1 );
vecRandForward.z = RandomFloat( -1, 1 );
}
else
{
vecForward = RandomVector( -1, 1 );
vecRandForward = RandomVector( -1, 1 );
}

UTIL_TraceLine( vecOrigin, vecOrigin + (vecForward * 192), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr );
UTIL_TraceLine( vecOrigin, vecOrigin + (vecRandForward * 192), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr );
} while ( tr.fraction >= 1.0 && iTries < 3 );

Vector vecEnd = tr.endpos - (vecForward * 8);
Vector vecRandEnd = tr.endpos - (vecRandForward * 8);

// Only spark & glow if we hit something
if ( tr.fraction < 1.0 )
Expand Down
3 changes: 2 additions & 1 deletion src/game/client/c_smokestack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ void C_SmokeStack::Update(float fTimeDelta)

// Setup the twist matrix.
float flTwist = (m_flTwist * (M_PI_F * 2.f) / 360.0f) * Helper_GetFrameTime();
if( m_bTwist = !!flTwist )
m_bTwist = !!flTwist;
if( m_bTwist )
{
m_TwistMat[0][0] = cos(flTwist);
m_TwistMat[0][1] = sin(flTwist);
Expand Down
1 change: 0 additions & 1 deletion src/game/client/clientshadowmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4695,7 +4695,6 @@ void CClientShadowMgr::UpdateProjectedTextureInternal( ClientShadowHandle_t hand
VPROF_BUDGET( "CClientShadowMgr::UpdateProjectedTextureInternal", VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING );

Assert( ( shadow.m_Flags & SHADOW_FLAGS_SHADOW ) == 0 );
ClientShadow_t& shadow = m_Shadows[handle];

shadowmgr->EnableShadow( shadow.m_ShadowHandle, true );

Expand Down
14 changes: 7 additions & 7 deletions src/game/client/fx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ void FX_Tesla( const CTeslaInfo &teslaInfo )
{
// Make a couple of tries at it
int iTries = -1;
Vector vecForward;
Vector vecRandForward;
trace_t tr;
do
{
Expand All @@ -1054,21 +1054,21 @@ void FX_Tesla( const CTeslaInfo &teslaInfo )
{
QAngle vecTemp = teslaInfo.m_vAngles;
vecTemp[YAW] += anglemod( flYawOffset + ((360 / iTotalBeams) * i) );
AngleVectors( vecTemp, &vecForward );
AngleVectors( vecTemp, &vecRandForward );

// Randomly angle it up or down
vecForward.z = RandomFloat( -1, 1 );
vecRandForward.z = RandomFloat( -1, 1 );
}
else
{
vecForward = RandomVector( -1, 1 );
vecRandForward = RandomVector( -1, 1 );
}
VectorNormalize( vecForward );
VectorNormalize( vecRandForward );

UTIL_TraceLine( teslaInfo.m_vPos, teslaInfo.m_vPos + (vecForward * teslaInfo.m_flRadius), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr );
UTIL_TraceLine( teslaInfo.m_vPos, teslaInfo.m_vPos + (vecRandForward * teslaInfo.m_flRadius), MASK_SHOT, pEntity, COLLISION_GROUP_NONE, &tr );
} while ( tr.fraction >= 1.0 && iTries < 3 );

Vector vecEnd = tr.endpos - (vecForward * 8);
Vector vecRandEnd = tr.endpos - (vecRandForward * 8);

// Only spark & glow if we hit something
if ( tr.fraction < 1.0 )
Expand Down
2 changes: 0 additions & 2 deletions src/game/client/game_controls/baseviewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,6 @@ void CBaseViewport::ReloadScheme(const char *fromFile)
GetHud().ResetHUD();
}

extern ConVar ss_verticalsplit;

void AddSubKeyNamed( KeyValues *pKeys, const char *pszName )
{
KeyValues *pNewKey = new KeyValues( pszName );
Expand Down
12 changes: 6 additions & 6 deletions src/game/client/hud_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ void CLCD::ShowItems_R( CLCDPage *page, unsigned int dwCurTime, CUtlVector< CLCD
{
CLCDItem *newItem = NULL;

CLCDItem *item = ag->m_Definition[ r ];
switch ( item->m_Type )
CLCDItem *definition = ag->m_Definition[ r ];
switch ( definition->m_Type )
{
default:
break;

case LCDITEM_TEXT:
{
CLCDItemText *text = static_cast< CLCDItemText * >( item );
CLCDItemText *text = static_cast< CLCDItemText * >( definition );
CUtlString s;
s = text->m_OriginalText;
Replace( s, prefix, s1 );
Expand All @@ -551,7 +551,7 @@ void CLCD::ShowItems_R( CLCDPage *page, unsigned int dwCurTime, CUtlVector< CLCD

// text->m_OriginalText = s;

CLCDItemText *copy = static_cast< CLCDItemText * >( page->Alloc( item->m_Type ) );
CLCDItemText *copy = static_cast< CLCDItemText * >( page->Alloc( definition->m_Type ) );
*copy = *text;
copy->m_bActive = true;
copy->m_OriginalText = s;
Expand All @@ -564,8 +564,8 @@ void CLCD::ShowItems_R( CLCDPage *page, unsigned int dwCurTime, CUtlVector< CLCD
break;
case LCDITEM_ICON:
{
CLCDItemIcon *icon = static_cast< CLCDItemIcon * >( item );
CLCDItemIcon *copy = static_cast< CLCDItemIcon * >( page->Alloc( item->m_Type ) );
CLCDItemIcon *icon = static_cast< CLCDItemIcon * >( definition );
CLCDItemIcon *copy = static_cast< CLCDItemIcon * >( page->Alloc( definition->m_Type ) );
*copy = *icon;
copy->m_bActive = true;
copy->Create( m_lcd );
Expand Down
8 changes: 4 additions & 4 deletions src/game/client/ragdoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,11 +794,11 @@ class C_ServerRagdollAttached : public C_ServerRagdoll
if ( !( hdr->boneFlags( i ) & boneMask ) )
continue;

Vector pos;
Vector col;
matrix3x4_t &matrix = GetBoneForWrite( i );
MatrixGetColumn( matrix, 3, pos );
pos += offset;
MatrixSetColumn( pos, 3, matrix );
MatrixGetColumn( matrix, 3, col );
col += offset;
MatrixSetColumn( col, 3, matrix );
}
}
void OnDataChanged( DataUpdateType_t updateType );
Expand Down
6 changes: 3 additions & 3 deletions src/game/client/swarm/gameui/optionssubvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,10 +1021,10 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
void COptionsSubVideo::PrepareResolutionList()
{
// get the currently selected resolution
char sz[256];
m_pMode->GetText(sz, 256);
char current[256];
m_pMode->GetText(current, 256);
int currentWidth = 0, currentHeight = 0;
sscanf( sz, "%i x %i", &currentWidth, &currentHeight );
sscanf( current, "%i x %i", &currentWidth, &currentHeight );

// Clean up before filling the info again.
m_pMode->DeleteAllItems();
Expand Down
1 change: 1 addition & 0 deletions src/game/client/swarm/gameui/swarm/vmainmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,7 @@ void MainMenu::OnHoIAFTop10ScoresDownloaded( LeaderboardScoresDownloaded_t *pPar
{
bool bOK = SteamUserStats()->GetDownloadedLeaderboardEntry( pParam->m_hSteamLeaderboardEntries, i, &s_HoIAFLeaderboardEntryCache[i], reinterpret_cast< int32 * >( &s_HoIAFLeaderboardDetailsCache[i] ), sizeof( s_HoIAFLeaderboardDetailsCache[i] ) / sizeof( int32 ) );
Assert( bOK );
( void )bOK; // suppress warning C4189: 'bOK': local variable is initialized but not referenced
Assert( s_HoIAFLeaderboardEntryCache[i].m_cDetails == sizeof( s_HoIAFLeaderboardDetailsCache[i] ) / sizeof( int32 ) );

m_pTopLeaderboardEntries[i]->SetFromEntry( s_HoIAFLeaderboardEntryCache[i], s_HoIAFLeaderboardDetailsCache[i] );
Expand Down
10 changes: 5 additions & 5 deletions src/game/client/swarm/rd_collections_crafting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ void CRD_Crafting_Item_Grid::PerformLayout()

m_Items[i]->SetPos( col * eachWide, row * eachTall + yOffset );

int up = col + ( row - 1 ) * perRow;
int down = col + ( row + 1 ) * perRow;
int left = col == 0 ? -1 : col - 1 + row * perRow;
int right = col == perRow - 1 ? -1 : col + 1 + row * perRow;

// int up = col + ( row - 1 ) * perRow;
// int down = col + ( row + 1 ) * perRow;
// int left = col == 0 ? -1 : col - 1 + row * perRow;
// int right = col == perRow - 1 ? -1 : col + 1 + row * perRow;
//
// TODO: set up navigation
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/game/client/swarm/vgui/asw_hud_minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ void CASWHudMinimap::Init()
for ( int i = 0; i < ASW_MAX_MAP_VERTICAL_SECTIONS; i++ )
{
m_nMapTextureID[i] = -1;
m_flMapMinZ[i] = HUGE_VAL;
m_flMapMinZ[i] = FLT_MAX;
}
m_bHasOverview = false;
m_szLastLevelName.Clear();
Expand Down Expand Up @@ -1805,11 +1805,11 @@ void CASWHudMinimap::SetMap( const char *levelname )
}

m_nMapTextureID[i] = -1;
m_flMapMinZ[i] = HUGE_VAL;
m_flMapMinZ[i] = FLT_MAX;
}

m_nMapTextureID[0] = surface()->CreateNewTextureID();
m_flMapMinZ[0] = -HUGE_VAL;
m_flMapMinZ[0] = -FLT_MAX;

const RD_Mission_t *pOverview = ReactiveDropMissions::GetMission( levelname );
if ( !pOverview )
Expand Down Expand Up @@ -1875,7 +1875,7 @@ void CASWHudMinimap::SetMap( const char *levelname )
m_nMapTextureID[j] = m_nMapTextureID[j - 1];
}

m_flMapMinZ[iMinIndex + 1] = MIN( iMinIndex + 2 < ASW_MAX_MAP_VERTICAL_SECTIONS ? m_flMapMinZ[iMinIndex + 2] : HUGE_VAL, flMax );
m_flMapMinZ[iMinIndex + 1] = MIN( iMinIndex + 2 < ASW_MAX_MAP_VERTICAL_SECTIONS ? m_flMapMinZ[iMinIndex + 2] : FLT_MAX, flMax );
}
else if ( iMinIndex > 0 && iBlankIndex != iMinIndex && iBlankIndex + 1 < ASW_MAX_MAP_VERTICAL_SECTIONS && m_flMapMinZ[iMinIndex + 1] > flMax )
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/swarm/vgui/asw_vgui_computer_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void CASW_VGUI_Computer_Frame::RecordComputerContents()
COMPILE_TIME_ASSERT( COMPUTER_LOCKED_MAIL_2 + 1 == COMPUTER_LOCKED_MAIL_3 );
COMPILE_TIME_ASSERT( COMPUTER_LOCKED_MAIL_3 + 1 == COMPUTER_LOCKED_MAIL_4 );

int iLockedEntries = ( pArea->m_iLockedScreens >> COMPUTER_LOCKED_MAIL_1 ) & ( 1 << 4 - 1 );
int iLockedEntries = ( pArea->m_iLockedScreens >> COMPUTER_LOCKED_MAIL_1 ) & ( ( 1 << 4 ) - 1 );

if ( pArea->IsPDA() )
SwarmopediaRecordSeenContent( "PDA", pArea->m_MailFile.Get(), pArea->GetAbsOrigin(), pMR->GetProfileIndex(), pArea->m_PDAName.Get(), iLockedEntries );
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/swarm/vgui/campaignpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void CampaignPanel::OnThink()
int x, y;
m_pCurrentLocationImage->GetPos( x, y ); // location of red arrows

C_ASW_Campaign_Save *pSave = pGameResource->GetCampaignSave();
// C_ASW_Campaign_Save *pSave = pGameResource->GetCampaignSave();
if ( pSave )
{
// check if there's a timer on
Expand Down Expand Up @@ -554,7 +554,7 @@ void CampaignPanel::OnThink()
if ( !pMission )
return;

CASW_Campaign_Save *pSave = ASWGameRules()->GetCampaignSave();
// CASW_Campaign_Save *pSave = ASWGameRules()->GetCampaignSave();
if ( !pSave )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/game/client/swarm/vgui/holdout_hud_wave_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ void Holdout_Hud_Wave_Panel::OnThink()
m_pCountdownTimeLabel->SetVisible( true );
m_pCountdownLabel->SetVisible( true );

wchar_t wzValue[15];
V_snwprintf( wzValue, ARRAYSIZE( wzValue ), L"%d", (int) flTimeLeft );
wchar_t wzTime[15];
V_snwprintf( wzTime, ARRAYSIZE( wzTime ), L"%d", (int) flTimeLeft );

m_pCountdownTimeLabel->SetText( wzValue );
m_pCountdownTimeLabel->SetText( wzTime );
}

UpdateWaveProgressBar();
Expand Down
7 changes: 4 additions & 3 deletions src/game/client/swarm/vgui/objectivetitlepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ void ObjectiveTitlePanel::UpdateElements()
pTitle = m_hObjective->GetObjectiveTitle();
else
{
char buffer[8];
Q_snprintf( buffer, sizeof( buffer ), "%d", m_Index );
// TODO: why is is unused?
char snumber[8];
Q_snprintf( snumber, sizeof( snumber ), "%d", m_Index );

wchar_t wnumber[8];
g_pVGuiLocalize->ConvertANSIToUnicode( buffer, wnumber, sizeof( wnumber ) );
g_pVGuiLocalize->ConvertANSIToUnicode( snumber, wnumber, sizeof( wnumber ) );

wchar_t *pLocal = g_pVGuiLocalize->Find( "#asw_objective_titlef" );
if ( !pLocal )
Expand Down
1 change: 0 additions & 1 deletion src/game/client/videoservices/video_material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ void CVideoMaterial::CreateVideoMaterial( const char *pMaterialName )
const int tex_flags = TEXTUREFLAGS_PROCEDURAL | TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT |
TEXTUREFLAGS_NOMIP | TEXTUREFLAGS_NOLOD | TEXTUREFLAGS_SINGLECOPY;

#define ALIGN_VALUE( val, alignment ) ( ( val + alignment - 1 ) & ~( alignment - 1 ) );
m_textureWidth = ALIGN_VALUE( m_videoWidth, 8 );
m_textureHeight = ALIGN_VALUE( m_videoHeight, 8 );

Expand Down
3 changes: 2 additions & 1 deletion src/game/client/view_beams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ bool Beam_t::ShouldDraw( void )
extern bool g_bRenderingScreenshot;
extern ConVar r_drawviewmodel;

int Beam_t::DrawModel( int flags, const RenderableInstance_t &instance )
// TODO: actually implement use of passed flags inside this method?
int Beam_t::DrawModel( int iFlags, const RenderableInstance_t &instance )
{


Expand Down
1 change: 0 additions & 1 deletion src/game/client/viewrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,6 @@ void CViewRender::DrawUnderwaterOverlay( void )
UpdateRefractTexture( x, y, w, h, true );

// Now draw the entire screen using the material...
CMatRenderContextPtr pRenderContext( materials );
ITexture *pTexture = GetPowerOfTwoFrameBufferTexture( );
int sw = pTexture->GetActualWidth();
int sh = pTexture->GetActualHeight();
Expand Down
14 changes: 7 additions & 7 deletions src/game/server/baseflex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2551,12 +2551,12 @@ void CFlexCycler::Think( void )
// only do this if they have more than eyelid movement
if (GetNumFlexControllers() > 2)
{
const char *pszExpression = flex_expression.GetString();
const char *pszFlexExpression = flex_expression.GetString();

if (pszExpression && pszExpression[0] == '+' && pszExpression[1] != '\0')
if (pszFlexExpression && pszFlexExpression[0] == '+' && pszFlexExpression[1] != '\0')
{
int i;
int j = atoi( &pszExpression[1] );
int j = atoi( &pszFlexExpression[1] );
for ( i = 0; i < GetNumFlexControllers(); i++)
{
m_flextarget[m_flexnum] = 0;
Expand All @@ -2569,7 +2569,7 @@ void CFlexCycler::Think( void )
// Msg( "%s %.3f\n", predef_flexcontroller_names[i], predef_flexcontroller_values[j][i] );
}
}
else if ( pszExpression && (pszExpression[0] == '1') && (pszExpression[1] == '\0') ) // 1 for maxed controller values
else if ( pszFlexExpression && (pszFlexExpression[0] == '1') && (pszFlexExpression[1] == '\0') ) // 1 for maxed controller values
{
for ( LocalFlexController_t i = LocalFlexController_t(0); i < GetNumFlexControllers(); i++ )
{
Expand All @@ -2578,7 +2578,7 @@ void CFlexCycler::Think( void )
SetFlexWeight( i, m_flextarget[i] );
}
}
else if ( pszExpression && (pszExpression[0] == '^') && (pszExpression[1] == '\0') ) // ^ for sine wave
else if ( pszFlexExpression && (pszFlexExpression[0] == '^') && (pszFlexExpression[1] == '\0') ) // ^ for sine wave
{
for ( LocalFlexController_t i = LocalFlexController_t(0); i < GetNumFlexControllers(); i++ )
{
Expand All @@ -2588,12 +2588,12 @@ void CFlexCycler::Think( void )
SetFlexWeight( i, m_flextarget[i] );
}
}
else if (pszExpression && pszExpression[0] != '\0' && strcmp(pszExpression, "+") != 0)
else if (pszFlexExpression && pszFlexExpression[0] != '\0' && strcmp(pszFlexExpression, "+") != 0)
{
char szExpression[128];
char szTemp[32];

Q_strncpy( szExpression, pszExpression ,sizeof(szExpression));
Q_strncpy( szExpression, pszFlexExpression ,sizeof(szExpression));
char *pszExpression = szExpression;

while (*pszExpression != '\0')
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/env_effectsscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum EffectType


bool g_bUnget = false;
unsigned char *buffer;
// unsigned char *buffer;
char name[ 256 ];
const char *currenttoken;
int tokencount;
Expand Down
Loading