Skip to content

Commit be903bd

Browse files
committed
pending: experimental changes 2
1 parent 21bd9ab commit be903bd

File tree

10 files changed

+120
-116
lines changed

10 files changed

+120
-116
lines changed

src/engine/vgui_baseui_interface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ ConVar r_drawvgui( "r_drawvgui", "1", FCVAR_CHEAT, "Enable the rendering of vgui
127127
#if defined( _X360 ) || defined( STAGING_ONLY )
128128
ConVar gameui_xbox( "gameui_xbox", "0", 0 );
129129
#endif
130+
ConVar cl_hud_minmode( "cl_hud_minmode", "0", FCVAR_ARCHIVE);
130131

131132
void Con_CreateConsolePanel( vgui::Panel *parent );
132133
void CL_CreateEntityReportPanel( vgui::Panel *parent );

src/game/client/tf/c_tf_player.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8517,7 +8517,7 @@ int C_TFPlayer::GetVisionFilterFlags( bool bWeaponsCheck /*= false */ )
85178517

85188518
// check for holidays and add them in to the mix
85198519
// Halloween / Fullmoon vision
8520-
if ( TFGameRules()->IsHolidayActive( kHoliday_HalloweenOrFullMoon ) || true )
8520+
if ( TFGameRules()->IsHolidayActive( kHoliday_HalloweenOrFullMoon ) )
85218521
{
85228522
nVisionOptInFlags |= TF_VISION_FILTER_HALLOWEEN;
85238523
}

src/game/client/tf/workshop/published_files.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ class CSteamWorkshopDialog : public vgui::EditablePanel
12221222
}
12231223
else if ( FStrEq( pCommand, "nextpage" ) )
12241224
{
1225-
uint32 unNumPages = ceil( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
1225+
uint32 unNumPages = Ceil2Int( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
12261226
if ( m_unCurrentPage < unNumPages )
12271227
{
12281228
++m_unCurrentPage;
@@ -1374,7 +1374,7 @@ class CSteamWorkshopDialog : public vgui::EditablePanel
13741374
}
13751375

13761376
// paging
1377-
uint32 unNumPages = ceil( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
1377+
uint32 unNumPages = Ceil2Int( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
13781378
bool bMultiplePages = ( unNumPages > 1 );
13791379
if ( bMultiplePages )
13801380
{

src/game/shared/econ/econ_item_view.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ class CEconItemView : public CMaterialOverrideContainer< IEconItemInterface >
358358
inline int GetTeamNumber() const { return m_iTeamNumber; }
359359
inline void SetTeamNumber( int iTeamNumber ) { m_iTeamNumber = iTeamNumber; }
360360

361-
void CacheSOCData() { if (!m_pSOCDataCache) m_pSOCDataCache = GetSOCData(); }
361+
bool CacheSOCData() { if (!m_pSOCDataCache) { m_pSOCDataCache = GetSOCData(); return true; } return false; }
362362
void UncacheSOCData() { m_pSOCDataCache = NULL; }
363363

364364
protected:
@@ -465,27 +465,29 @@ class CEconItemViewDataCacher
465465
CEconItemViewDataCacher(CEconItemView* pItem) : m_pItem(pItem)
466466
{
467467
if (!m_pItem) return;
468-
pItem->CacheSOCData();
468+
bRecursive = !m_pItem->CacheSOCData();
469469
}
470470

471471
~CEconItemViewDataCacher()
472472
{
473-
if (!m_pItem) return;
473+
if (!m_pItem || bRecursive) return;
474474
m_pItem->UncacheSOCData();
475475
}
476476

477477
void SetItem(CEconItemView* pItem)
478478
{
479479
if (pItem == m_pItem) return;
480480
if (!pItem) return;
481-
if (m_pItem) m_pItem->UncacheSOCData();
481+
if (m_pItem && !bRecursive) m_pItem->UncacheSOCData();
482482
m_pItem = pItem;
483-
m_pItem->CacheSOCData();
483+
bRecursive = m_pItem->CacheSOCData();
484484
}
485485

486486
private:
487487

488488
CEconItemView* m_pItem;
489+
/** Sometimes the item already has a cache, and we shouldn't mess with it. **/
490+
bool bRecursive;
489491
};
490492

491493
#endif // ECON_ITEM_CONSTANTS_H

src/game/shared/tf/tf_gamemovement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ bool CTFGameMovement::ChargeMove()
539539
static ConVar tf_movement_stun_multiplier("tf_movement_stun_multiplier", "1", FCVAR_REPLICATED, "Multiplier for movement speed when stunned.");
540540
static ConVar tf_movement_stun_clip("tf_movement_stun_clip", "0.41421356237", FCVAR_REPLICATED, "Clip off stun amount.");
541541
#endif
542-
static ConVar tf_movement_stun_legacy_threshold("tf_movement_stun_legacy_threshold", "1.5", FCVAR_REPLICATED, "Relative point for legacy stun amount handling.");
542+
static ConVar tf_movement_stun_legacy_threshold("tf_movement_stun_legacy_threshold", "1.141", FCVAR_REPLICATED, "Relative point for legacy stun amount handling.");
543543
static ConVar tf_movement_stun_legacy_on_charge("tf_movement_stun_legacy_on_charge", "1", FCVAR_REPLICATED, "Always apply full stun to charging players.");
544544

545545
//-----------------------------------------------------------------------------

src/materialsystem/ctexture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static void ConVarChanged_mat_managedtextures( IConVar *var, const char *pOldVal
7777
#endif
7878

7979
static ConVar mat_spew_on_texture_size( "mat_spew_on_texture_size", "0", 0, "Print warnings about vtf content that isn't of the expected size" );
80-
static ConVar mat_lodin_time( "mat_lodin_time", "5.0", FCVAR_DEVELOPMENTONLY );
80+
static ConVar mat_lodin_time( "mat_lodin_time", "0.4", FCVAR_DEVELOPMENTONLY );
8181
static ConVar mat_lodin_hidden_pop( "mat_lodin_hidden_pop", "1", FCVAR_DEVELOPMENTONLY );
8282

8383
#define TEXTURE_FNAME_EXTENSION ".vtf"

src/particles/builtin_particle_render_ops.cpp

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,10 @@ void C_OP_RenderSprites::RenderSpriteCard( CMeshBuilder &meshBuilder, C_OP_Rende
938938
float yaw = SubFloat( info.m_pYaw[ nGroup * info.m_nYawStride ], nOffset );
939939

940940
int nXYZIndex = nGroup * info.m_nXYZStride;
941-
Vector vecWorldPos;
942-
vecWorldPos.x = SubFloat( info.m_pXYZ[ nXYZIndex ], nOffset );
943-
vecWorldPos.y = SubFloat( info.m_pXYZ[ nXYZIndex+1 ], nOffset );
944-
vecWorldPos.z = SubFloat( info.m_pXYZ[ nXYZIndex+2 ], nOffset );
941+
float x = SubFloat( info.m_pXYZ[ nXYZIndex ], nOffset );
942+
float y = SubFloat( info.m_pXYZ[ nXYZIndex+1 ], nOffset );
943+
float z = SubFloat( info.m_pXYZ[ nXYZIndex+2 ], nOffset );
944+
Vector vecWorldPos{x, y, z};
945945

946946
if ( bCameraBias )
947947
{
@@ -952,7 +952,7 @@ void C_OP_RenderSprites::RenderSpriteCard( CMeshBuilder &meshBuilder, C_OP_Rende
952952
}
953953

954954
// Find the sample for this frame
955-
const SheetSequenceSample_t *pSample = &s_DefaultSheetSequence;
955+
const SheetSequenceSample_t *pSample;
956956
if ( info.m_pSheet )
957957
{
958958
float flAgeScale = info.m_flAgeScale;
@@ -971,51 +971,35 @@ void C_OP_RenderSprites::RenderSpriteCard( CMeshBuilder &meshBuilder, C_OP_Rende
971971
info.m_pParticles->m_flCurTime,
972972
flAgeScale, nSequence );
973973
}
974+
else
975+
{
976+
pSample = &s_DefaultSheetSequence;
977+
}
974978

975979
const SequenceSampleTextureCoords_t *pSample0 = &(pSample->m_TextureCoordData[0]);
976980
const SequenceSampleTextureCoords_t *pSecondTexture0 = &(pSample->m_TextureCoordData[1]);
977981

978-
// Submit 1 (instanced) or 4 (non-instanced) verts (if we're instancing, we don't produce indices either)
979-
meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
980-
meshBuilder.Color4ub( rc, gc, bc, ac );
981-
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
982-
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
983-
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
984-
// FIXME: change the vertex decl (remove texcoord3/cornerid) if instancing - need to adjust elements beyond texcoord3 down, though
985-
if ( !bUseInstancing )
986-
meshBuilder.TexCoord2f( 3, 0, 0 );
987-
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
988-
meshBuilder.AdvanceVertex();
989-
990-
if ( !bUseInstancing )
991-
{
992-
meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
993-
meshBuilder.Color4ub( rc, gc, bc, ac );
994-
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
995-
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
996-
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
997-
meshBuilder.TexCoord2f( 3, 1, 0 );
998-
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
999-
meshBuilder.AdvanceVertex();
982+
static float s_flCornerIds[] = { 0,0, 1,0, 1,1, 0,1 };
1000983

1001-
meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
1002-
meshBuilder.Color4ub( rc, gc, bc, ac );
1003-
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
1004-
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
1005-
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
1006-
meshBuilder.TexCoord2f( 3, 1, 1 );
1007-
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
1008-
meshBuilder.AdvanceVertex();
984+
float const *pIds = s_flCornerIds;
1009985

1010-
meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
986+
for( int i = 0; i < ( bUseInstancing ? 1 : 4 ); i++ )
987+
{
988+
meshBuilder.Position3f( x, y, z );
1011989
meshBuilder.Color4ub( rc, gc, bc, ac );
1012990
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
1013991
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
1014992
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
1015-
meshBuilder.TexCoord2f( 3, 0, 1 );
993+
if ( ! bUseInstancing )
994+
{
995+
meshBuilder.TexCoord2fv( 3, pIds );
996+
pIds += 2;
997+
}
1016998
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
1017-
meshBuilder.AdvanceVertex();
1018-
999+
meshBuilder.AdvanceVertexF<VTX_HAVEPOS | VTX_HAVECOLOR, 5>();
1000+
}
1001+
if ( ! bUseInstancing )
1002+
{
10191003
meshBuilder.FastQuad( info.m_nVertexOffset );
10201004
info.m_nVertexOffset += 4;
10211005
}

0 commit comments

Comments
 (0)