diff --git a/game/client/c_baseanimating.cpp b/game/client/c_baseanimating.cpp index c41ff46b..5727d7b0 100644 --- a/game/client/c_baseanimating.cpp +++ b/game/client/c_baseanimating.cpp @@ -677,6 +677,8 @@ C_BaseAnimating::C_BaseAnimating() : m_pRagdoll = NULL; m_builtRagdoll = false; m_hitboxBoneCacheHandle = 0; + m_nHitboxSet = 0; + int i; for ( i = 0; i < ARRAYSIZE( m_flEncodedController ); i++ ) { @@ -694,6 +696,8 @@ C_BaseAnimating::C_BaseAnimating() : m_bStoreRagdollInfo = false; m_pRagdollInfo = NULL; + m_pJiggleBones = NULL; + m_pBoneMergeCache = NULL; m_flPlaybackRate = 1.0f; diff --git a/game/client/c_baseentity.cpp b/game/client/c_baseentity.cpp index 8f40d7ef..ca8c8348 100644 --- a/game/client/c_baseentity.cpp +++ b/game/client/c_baseentity.cpp @@ -903,6 +903,7 @@ C_BaseEntity::C_BaseEntity() : m_DataChangeEventRef = -1; m_EntClientFlags = 0; + m_bEnableRenderingClipPlane = false; m_iParentAttachment = 0; m_nRenderFXBlend = 255; @@ -940,10 +941,12 @@ C_BaseEntity::C_BaseEntity() : #if !defined( NO_ENTITY_PREDICTION ) m_pPredictionContext = NULL; #endif - //NOTE: not virtual! we are in the constructor! C_BaseEntity::Clear(); - + + SetModelName( NULL_STRING ); + m_iClassname = NULL_STRING; + m_InterpolationListEntry = 0xFFFF; m_TeleportListEntry = 0xFFFF; @@ -984,7 +987,6 @@ C_BaseEntity::~C_BaseEntity() void C_BaseEntity::Clear( void ) { m_bDormant = true; - m_nCreationTick = -1; m_RefEHandle.Term(); m_ModelInstance = MODEL_INSTANCE_INVALID; @@ -998,6 +1000,7 @@ void C_BaseEntity::Clear( void ) SetLocalOrigin( vec3_origin ); SetLocalAngles( vec3_angle ); model = NULL; + m_pOriginalData = NULL; m_vecAbsOrigin.Init(); m_angAbsRotation.Init(); m_vecVelocity.Init(); @@ -3741,7 +3744,7 @@ void C_BaseEntity::AddColoredDecal( const Vector& rayStart, const Vector& rayEnd case mod_brush: { - color32 cColor32 = { cColor.r(), cColor.g(), cColor.b(), cColor.a() }; + color32 cColor32 = { (uint8)cColor.r(), (uint8)cColor.g(), (uint8)cColor.b(), (uint8)cColor.a() }; effects->DecalColorShoot( decalIndex, index, model, GetAbsOrigin(), GetAbsAngles(), decalCenter, 0, 0, cColor32 ); } break; diff --git a/game/client/c_baseflex.h b/game/client/c_baseflex.h index 71cee3d8..56c86cb3 100644 --- a/game/client/c_baseflex.h +++ b/game/client/c_baseflex.h @@ -91,7 +91,7 @@ struct FS_LocalToGlobal_t const flexsettinghdr_t *m_Key; int m_nCount; - int *m_Mapping; + int *m_Mapping = NULL; }; bool FlexSettingLessFunc( const FS_LocalToGlobal_t& lhs, const FS_LocalToGlobal_t& rhs ); diff --git a/game/client/c_func_occluder.cpp b/game/client/c_func_occluder.cpp index b9c2f56f..32d01687 100644 --- a/game/client/c_func_occluder.cpp +++ b/game/client/c_func_occluder.cpp @@ -24,7 +24,7 @@ public: private: int m_nOccluderIndex; - bool m_bActive; + bool m_bActive = false; }; IMPLEMENT_CLIENTCLASS_DT( C_FuncOccluder, DT_FuncOccluder, CFuncOccluder ) diff --git a/game/client/c_te_legacytempents.cpp b/game/client/c_te_legacytempents.cpp index 3c8adf68..831715a8 100644 --- a/game/client/c_te_legacytempents.cpp +++ b/game/client/c_te_legacytempents.cpp @@ -1539,7 +1539,7 @@ void CTempEnts::BloodSprite( const Vector &org, int r, int g, int b, int a, int { C_LocalTempEntity *pTemp; int frameCount = modelinfo->GetModelFrameCount( model ); - color32 impactcolor = { r, g, b, a }; + color32 impactcolor = { (uint8)r, (uint8)g, (uint8)b, (uint8)a }; //Large, single blood sprite is a high-priority tent if ( ( pTemp = TempEntAllocHigh( org, model ) ) != NULL ) diff --git a/game/client/hud_basechat.cpp b/game/client/hud_basechat.cpp index 69d67862..db9dc2fa 100644 --- a/game/client/hud_basechat.cpp +++ b/game/client/hud_basechat.cpp @@ -633,6 +633,7 @@ CBaseHudChat::CBaseHudChat( const char *pElementName ) } m_pChatHistory = new CHudChatHistory( this, "HudChatHistory" ); + m_pFilterPanel = NULL; CreateChatLines(); CreateChatInputLine(); @@ -1829,4 +1830,4 @@ void CBaseHudChat::FireGameEvent( IGameEvent *event ) ChatPrintf( player->entindex(), CHAT_FILTER_NONE, "(SourceTV) %s", event->GetString( "text" ) ); } #endif -} \ No newline at end of file +} diff --git a/game/client/view.cpp b/game/client/view.cpp index 333a2756..3c28d89a 100644 --- a/game/client/view.cpp +++ b/game/client/view.cpp @@ -931,7 +931,7 @@ void CViewRender::WriteSaveGameScreenshotOfSize( const char *pFilename, int widt { // Write TGA format to buffer int iMaxTGASize = 1024 + ( nSrcWidth * nSrcHeight * 4 ); - void *pTGA = malloc( iMaxTGASize ); + void *pTGA = new char[ iMaxTGASize ]; buffer.SetExternalBuffer( pTGA, iMaxTGASize, 0 ); bWriteResult = TGAWriter::WriteToBuffer( pSrcImage, buffer, nSrcWidth, nSrcHeight, IMAGE_FORMAT_RGB888, IMAGE_FORMAT_RGB888 ); diff --git a/game/client/viewrender.cpp b/game/client/viewrender.cpp index a629071b..0240c238 100644 --- a/game/client/viewrender.cpp +++ b/game/client/viewrender.cpp @@ -1435,8 +1435,8 @@ static void GetFogColorTransition( fogparams_t *pFogParams, float *pColorPrimary { float flPercent = 1.0f - (( pFogParams->lerptime - gpGlobals->curtime ) / pFogParams->duration ); - float flPrimaryColorLerp[3] = { pFogParams->colorPrimaryLerpTo.GetR(), pFogParams->colorPrimaryLerpTo.GetG(), pFogParams->colorPrimaryLerpTo.GetB() }; - float flSecondaryColorLerp[3] = { pFogParams->colorSecondaryLerpTo.GetR(), pFogParams->colorSecondaryLerpTo.GetG(), pFogParams->colorSecondaryLerpTo.GetB() }; + float flPrimaryColorLerp[3] = { (float)pFogParams->colorPrimaryLerpTo.GetR(), (float)pFogParams->colorPrimaryLerpTo.GetG(), (float)pFogParams->colorPrimaryLerpTo.GetB() }; + float flSecondaryColorLerp[3] = { (float)pFogParams->colorSecondaryLerpTo.GetR(), (float)pFogParams->colorSecondaryLerpTo.GetG(), (float)pFogParams->colorSecondaryLerpTo.GetB() }; CheckAndTransitionColor( flPercent, pColorPrimary, flPrimaryColorLerp ); CheckAndTransitionColor( flPercent, pColorSecondary, flSecondaryColorLerp ); @@ -1459,8 +1459,8 @@ static void GetFogColor( fogparams_t *pFogParams, float *pColor ) } else { - float flPrimaryColor[3] = { pFogParams->colorPrimary.GetR(), pFogParams->colorPrimary.GetG(), pFogParams->colorPrimary.GetB() }; - float flSecondaryColor[3] = { pFogParams->colorSecondary.GetR(), pFogParams->colorSecondary.GetG(), pFogParams->colorSecondary.GetB() }; + float flPrimaryColor[3] = { (float)pFogParams->colorPrimary.GetR(), (float)pFogParams->colorPrimary.GetG(), (float)pFogParams->colorPrimary.GetB() }; + float flSecondaryColor[3] = { (float)pFogParams->colorSecondary.GetR(), (float)pFogParams->colorSecondary.GetG(), (float)pFogParams->colorSecondary.GetB() }; GetFogColorTransition( pFogParams, flPrimaryColor, flSecondaryColor ); @@ -2689,6 +2689,7 @@ bool DoesViewPlaneIntersectWater( float waterZ, int leafWaterDataID ) // &view - the camera view to render from // nClearFlags - how to clear the buffer //----------------------------------------------------------------------------- + void CViewRender::ViewDrawScene_PortalStencil( const CViewSetup &viewIn, ViewCustomVisibility_t *pCustomVisibility ) { VPROF( "CViewRender::ViewDrawScene_PortalStencil" ); @@ -2700,28 +2701,6 @@ void CViewRender::ViewDrawScene_PortalStencil( const CViewSetup &viewIn, ViewCus QAngle vecOldAngles = CurrentViewAngles(); int iCurrentViewID = g_CurrentViewID; - int iRecursionLevel = g_pPortalRender->GetViewRecursionLevel(); - Assert( iRecursionLevel > 0 ); - - //get references to reflection textures - CTextureReference pPrimaryWaterReflectionTexture; - pPrimaryWaterReflectionTexture.Init( GetWaterReflectionTexture() ); - CTextureReference pReplacementWaterReflectionTexture; - pReplacementWaterReflectionTexture.Init( portalrendertargets->GetWaterReflectionTextureForStencilDepth( iRecursionLevel ) ); - - //get references to refraction textures - CTextureReference pPrimaryWaterRefractionTexture; - pPrimaryWaterRefractionTexture.Init( GetWaterRefractionTexture() ); - CTextureReference pReplacementWaterRefractionTexture; - pReplacementWaterRefractionTexture.Init( portalrendertargets->GetWaterRefractionTextureForStencilDepth( iRecursionLevel ) ); - - - //swap texture contents for the primary render targets with those we set aside for this recursion level - if( pReplacementWaterReflectionTexture != NULL ) - pPrimaryWaterReflectionTexture->SwapContents( pReplacementWaterReflectionTexture ); - - if( pReplacementWaterRefractionTexture != NULL ) - pPrimaryWaterRefractionTexture->SwapContents( pReplacementWaterRefractionTexture ); bool bDrew3dSkybox = false; SkyboxVisibility_t nSkyboxVisible = SKYBOX_NOT_VISIBLE; @@ -2738,7 +2717,7 @@ void CViewRender::ViewDrawScene_PortalStencil( const CViewSetup &viewIn, ViewCus //generate unique view ID's for each stencil view view_id_t iNewViewID = (view_id_t)g_pPortalRender->GetCurrentViewId(); SetupCurrentView( view.origin, view.angles, (view_id_t)iNewViewID ); - + // update vis data unsigned int visFlags; SetupVis( view, visFlags, pCustomVisibility ); @@ -2757,10 +2736,10 @@ void CViewRender::ViewDrawScene_PortalStencil( const CViewSetup &viewIn, ViewCus DetermineWaterRenderInfo( fogInfo, waterInfo ); if ( waterInfo.m_bCheapWater ) - { + { cplane_t glassReflectionPlane; if ( IsReflectiveGlassInView( viewIn, glassReflectionPlane ) ) - { + { CRefPtr pGlassReflectionView = new CReflectiveGlassView( this ); pGlassReflectionView->Setup( viewIn, VIEW_CLEAR_DEPTH | VIEW_CLEAR_COLOR | VIEW_CLEAR_OBEY_STENCIL, drawSkybox, fogInfo, waterInfo, glassReflectionPlane ); AddViewToScene( pGlassReflectionView ); @@ -2813,14 +2792,6 @@ void CViewRender::ViewDrawScene_PortalStencil( const CViewSetup &viewIn, ViewCus // Return to the previous view SetupCurrentView( vecOldOrigin, vecOldAngles, (view_id_t)iCurrentViewID ); g_CurrentViewID = iCurrentViewID; //just in case the cast to view_id_t screwed up the id # - - - //swap back the water render targets - if( pReplacementWaterReflectionTexture != NULL ) - pPrimaryWaterReflectionTexture->SwapContents( pReplacementWaterReflectionTexture ); - - if( pReplacementWaterRefractionTexture != NULL ) - pPrimaryWaterRefractionTexture->SwapContents( pReplacementWaterRefractionTexture ); } void CViewRender::Draw3dSkyboxworld_Portal( const CViewSetup &view, int &nClearFlags, bool &bDrew3dSkybox, SkyboxVisibility_t &nSkyboxVisible, ITexture *pRenderTarget ) diff --git a/game/server/ai_basenpc.cpp b/game/server/ai_basenpc.cpp index 1db9eab1..0acc458f 100644 --- a/game/server/ai_basenpc.cpp +++ b/game/server/ai_basenpc.cpp @@ -11331,6 +11331,7 @@ CAI_BaseNPC::CAI_BaseNPC(void) m_flHeadYaw = 0; m_flHeadPitch = 0; m_spawnEquipment = NULL_STRING; + m_SquadName = NULL_STRING; m_pEnemies = new CAI_Enemies; m_bIgnoreUnseenEnemies = false; m_flEyeIntegRate = 0.95; diff --git a/game/server/ai_behavior_lead.cpp b/game/server/ai_behavior_lead.cpp index 6a316c1e..a844f546 100644 --- a/game/server/ai_behavior_lead.cpp +++ b/game/server/ai_behavior_lead.cpp @@ -1543,7 +1543,7 @@ void CAI_LeadGoal::InputActivate( inputdata_t &inputdata ) AI_LeadArgs_t leadArgs = { GetGoalEntityName(), STRING(m_iszWaitPointName), - m_spawnflags, + (unsigned)m_spawnflags, m_flWaitDistance, m_flLeadDistance, m_flRetrieveDistance, diff --git a/game/server/ai_squad.cpp b/game/server/ai_squad.cpp index 17e0c18f..9ad4b6bb 100644 --- a/game/server/ai_squad.cpp +++ b/game/server/ai_squad.cpp @@ -153,7 +153,7 @@ END_DATADESC() //------------------------------------- -CAI_Squad::CAI_Squad(string_t newName) +CAI_Squad::CAI_Squad(string_t newName) #ifndef PER_ENEMY_SQUADSLOTS : m_squadSlotsUsed(MAX_SQUADSLOTS) #endif @@ -163,7 +163,7 @@ CAI_Squad::CAI_Squad(string_t newName) //------------------------------------- -CAI_Squad::CAI_Squad() +CAI_Squad::CAI_Squad() #ifndef PER_ENEMY_SQUADSLOTS : m_squadSlotsUsed(MAX_SQUADSLOTS) #endif @@ -175,7 +175,7 @@ CAI_Squad::CAI_Squad() void CAI_Squad::Init(string_t newName) { - m_Name = AllocPooledString( STRING(newName) ); + m_Name = newName; m_pNextSquad = NULL; m_flSquadSoundWaitTime = 0; m_SquadMembers.RemoveAll(); diff --git a/game/server/func_dust.cpp b/game/server/func_dust.cpp index 3e3fcb21..5bf15160 100644 --- a/game/server/func_dust.cpp +++ b/game/server/func_dust.cpp @@ -162,7 +162,7 @@ void CFunc_Dust::Spawn() //Since keyvalues can arrive in any order, and UTIL_StringToColor32 stomps alpha, //install the alpha value here. - color32 clr = { m_Color.m_Value.r, m_Color.m_Value.g, m_Color.m_Value.b, m_iAlpha }; + color32 clr = { m_Color.m_Value.r, m_Color.m_Value.g, m_Color.m_Value.b, (uint8)m_iAlpha }; m_Color.Set( clr ); BaseClass::Spawn(); diff --git a/game/server/hl1/hl1_ents.cpp b/game/server/hl1/hl1_ents.cpp index c5ab56ef..5aba5f29 100644 --- a/game/server/hl1/hl1_ents.cpp +++ b/game/server/hl1/hl1_ents.cpp @@ -289,7 +289,7 @@ bool CMultiManager::KeyValue( const char *szKeyName, const char *szValue ) { char tmp[128]; - UTIL_StripToken( szKeyName, tmp, Q_ARRAYSIZE( tmp ) ); + UTIL_StripToken( szKeyName, tmp ); m_iTargetName [ m_cTargets ] = AllocPooledString( tmp ); m_flTargetDelay [ m_cTargets ] = atof (szValue); m_cTargets++; diff --git a/game/server/hl2/npc_scanner.cpp b/game/server/hl2/npc_scanner.cpp index 031ce6d9..e0ed558a 100644 --- a/game/server/hl2/npc_scanner.cpp +++ b/game/server/hl2/npc_scanner.cpp @@ -1988,7 +1988,7 @@ void CNPC_CScanner::BlindFlashTarget( CBaseEntity *pTarget ) if ( tr.startsolid == false && tr.fraction == 1.0) { - color32 white = { 255, 255, 255, SCANNER_FLASH_MAX_VALUE * dotPr }; + color32 white = { 255, 255, 255, (uint8)(SCANNER_FLASH_MAX_VALUE * dotPr) }; if ( ( g_pMaterialSystemHardwareConfig != NULL ) && ( g_pMaterialSystemHardwareConfig->GetHDRType() != HDR_TYPE_NONE ) ) { diff --git a/game/server/nav_mesh.h b/game/server/nav_mesh.h index 24faed41..fe5c98d9 100644 --- a/game/server/nav_mesh.h +++ b/game/server/nav_mesh.h @@ -199,7 +199,7 @@ public: unsigned int operator()( const NavVisPair_t &item ) const { COMPILE_TIME_ASSERT( sizeof(CNavArea *) == 4 ); - int key[2] = { (int)item.pAreas[0] + item.pAreas[1]->GetID(), (int)item.pAreas[1] + item.pAreas[0]->GetID() }; + int key[2] = { (int)(item.pAreas[0] + item.pAreas[1]->GetID()), (int)(item.pAreas[1] + item.pAreas[0]->GetID()) }; return Hash8( key ); } }; diff --git a/game/shared/Sprite.cpp b/game/shared/Sprite.cpp index 2393f148..8eed62e4 100644 --- a/game/shared/Sprite.cpp +++ b/game/shared/Sprite.cpp @@ -174,7 +174,7 @@ BEGIN_NETWORK_TABLE( CSprite, DT_Sprite ) END_NETWORK_TABLE() -CSprite::CSprite() +CSprite::CSprite() : BaseClass() { m_flGlowProxySize = 2.0f; m_flHDRColorScale = 1.0f; diff --git a/game/shared/basecombatweapon_shared.cpp b/game/shared/basecombatweapon_shared.cpp index 754919d3..0b35d147 100644 --- a/game/shared/basecombatweapon_shared.cpp +++ b/game/shared/basecombatweapon_shared.cpp @@ -60,7 +60,7 @@ ConVar tf_weapon_criticals_bucket_bottom( "tf_weapon_criticals_bucket_bottom", " ConVar tf_weapon_criticals_bucket_default( "tf_weapon_criticals_bucket_default", "300.0", FCVAR_REPLICATED | FCVAR_CHEAT ); #endif // TF -CBaseCombatWeapon::CBaseCombatWeapon() +CBaseCombatWeapon::CBaseCombatWeapon() : BASECOMBATWEAPON_DERIVED_FROM() { // Constructor must call this // CONSTRUCT_PREDICTABLE( CBaseCombatWeapon ); @@ -77,6 +77,7 @@ CBaseCombatWeapon::CBaseCombatWeapon() m_nViewModelIndex = 0; m_bFlipViewModel = false; + m_iSubType = 0; #if defined( CLIENT_DLL ) m_iState = m_iOldState = WEAPON_NOT_CARRIED;