Skip to content

Commit

Permalink
pending: experimental changes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Mar 26, 2023
1 parent 21bd9ab commit be903bd
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 116 deletions.
1 change: 1 addition & 0 deletions src/engine/vgui_baseui_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ ConVar r_drawvgui( "r_drawvgui", "1", FCVAR_CHEAT, "Enable the rendering of vgui
#if defined( _X360 ) || defined( STAGING_ONLY )
ConVar gameui_xbox( "gameui_xbox", "0", 0 );
#endif
ConVar cl_hud_minmode( "cl_hud_minmode", "0", FCVAR_ARCHIVE);

void Con_CreateConsolePanel( vgui::Panel *parent );
void CL_CreateEntityReportPanel( vgui::Panel *parent );
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/tf/c_tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8517,7 +8517,7 @@ int C_TFPlayer::GetVisionFilterFlags( bool bWeaponsCheck /*= false */ )

// check for holidays and add them in to the mix
// Halloween / Fullmoon vision
if ( TFGameRules()->IsHolidayActive( kHoliday_HalloweenOrFullMoon ) || true )
if ( TFGameRules()->IsHolidayActive( kHoliday_HalloweenOrFullMoon ) )
{
nVisionOptInFlags |= TF_VISION_FILTER_HALLOWEEN;
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/tf/workshop/published_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ class CSteamWorkshopDialog : public vgui::EditablePanel
}
else if ( FStrEq( pCommand, "nextpage" ) )
{
uint32 unNumPages = ceil( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
uint32 unNumPages = Ceil2Int( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
if ( m_unCurrentPage < unNumPages )
{
++m_unCurrentPage;
Expand Down Expand Up @@ -1374,7 +1374,7 @@ class CSteamWorkshopDialog : public vgui::EditablePanel
}

// paging
uint32 unNumPages = ceil( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
uint32 unNumPages = Ceil2Int( (float)m_publishedFiles.m_FileDetails.Count() / (float)MAX_ITEMS_VIEWABLE );
bool bMultiplePages = ( unNumPages > 1 );
if ( bMultiplePages )
{
Expand Down
12 changes: 7 additions & 5 deletions src/game/shared/econ/econ_item_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class CEconItemView : public CMaterialOverrideContainer< IEconItemInterface >
inline int GetTeamNumber() const { return m_iTeamNumber; }
inline void SetTeamNumber( int iTeamNumber ) { m_iTeamNumber = iTeamNumber; }

void CacheSOCData() { if (!m_pSOCDataCache) m_pSOCDataCache = GetSOCData(); }
bool CacheSOCData() { if (!m_pSOCDataCache) { m_pSOCDataCache = GetSOCData(); return true; } return false; }
void UncacheSOCData() { m_pSOCDataCache = NULL; }

protected:
Expand Down Expand Up @@ -465,27 +465,29 @@ class CEconItemViewDataCacher
CEconItemViewDataCacher(CEconItemView* pItem) : m_pItem(pItem)
{
if (!m_pItem) return;
pItem->CacheSOCData();
bRecursive = !m_pItem->CacheSOCData();
}

~CEconItemViewDataCacher()
{
if (!m_pItem) return;
if (!m_pItem || bRecursive) return;
m_pItem->UncacheSOCData();
}

void SetItem(CEconItemView* pItem)
{
if (pItem == m_pItem) return;
if (!pItem) return;
if (m_pItem) m_pItem->UncacheSOCData();
if (m_pItem && !bRecursive) m_pItem->UncacheSOCData();
m_pItem = pItem;
m_pItem->CacheSOCData();
bRecursive = m_pItem->CacheSOCData();
}

private:

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

#endif // ECON_ITEM_CONSTANTS_H
2 changes: 1 addition & 1 deletion src/game/shared/tf/tf_gamemovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ bool CTFGameMovement::ChargeMove()
static ConVar tf_movement_stun_multiplier("tf_movement_stun_multiplier", "1", FCVAR_REPLICATED, "Multiplier for movement speed when stunned.");
static ConVar tf_movement_stun_clip("tf_movement_stun_clip", "0.41421356237", FCVAR_REPLICATED, "Clip off stun amount.");
#endif
static ConVar tf_movement_stun_legacy_threshold("tf_movement_stun_legacy_threshold", "1.5", FCVAR_REPLICATED, "Relative point for legacy stun amount handling.");
static ConVar tf_movement_stun_legacy_threshold("tf_movement_stun_legacy_threshold", "1.141", FCVAR_REPLICATED, "Relative point for legacy stun amount handling.");
static ConVar tf_movement_stun_legacy_on_charge("tf_movement_stun_legacy_on_charge", "1", FCVAR_REPLICATED, "Always apply full stun to charging players.");

//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/materialsystem/ctexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void ConVarChanged_mat_managedtextures( IConVar *var, const char *pOldVal
#endif

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" );
static ConVar mat_lodin_time( "mat_lodin_time", "5.0", FCVAR_DEVELOPMENTONLY );
static ConVar mat_lodin_time( "mat_lodin_time", "0.4", FCVAR_DEVELOPMENTONLY );
static ConVar mat_lodin_hidden_pop( "mat_lodin_hidden_pop", "1", FCVAR_DEVELOPMENTONLY );

#define TEXTURE_FNAME_EXTENSION ".vtf"
Expand Down
62 changes: 23 additions & 39 deletions src/particles/builtin_particle_render_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,10 @@ void C_OP_RenderSprites::RenderSpriteCard( CMeshBuilder &meshBuilder, C_OP_Rende
float yaw = SubFloat( info.m_pYaw[ nGroup * info.m_nYawStride ], nOffset );

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

if ( bCameraBias )
{
Expand All @@ -952,7 +952,7 @@ void C_OP_RenderSprites::RenderSpriteCard( CMeshBuilder &meshBuilder, C_OP_Rende
}

// Find the sample for this frame
const SheetSequenceSample_t *pSample = &s_DefaultSheetSequence;
const SheetSequenceSample_t *pSample;
if ( info.m_pSheet )
{
float flAgeScale = info.m_flAgeScale;
Expand All @@ -971,51 +971,35 @@ void C_OP_RenderSprites::RenderSpriteCard( CMeshBuilder &meshBuilder, C_OP_Rende
info.m_pParticles->m_flCurTime,
flAgeScale, nSequence );
}
else
{
pSample = &s_DefaultSheetSequence;
}

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

// Submit 1 (instanced) or 4 (non-instanced) verts (if we're instancing, we don't produce indices either)
meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
meshBuilder.Color4ub( rc, gc, bc, ac );
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
// FIXME: change the vertex decl (remove texcoord3/cornerid) if instancing - need to adjust elements beyond texcoord3 down, though
if ( !bUseInstancing )
meshBuilder.TexCoord2f( 3, 0, 0 );
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
meshBuilder.AdvanceVertex();

if ( !bUseInstancing )
{
meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
meshBuilder.Color4ub( rc, gc, bc, ac );
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
meshBuilder.TexCoord2f( 3, 1, 0 );
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
meshBuilder.AdvanceVertex();
static float s_flCornerIds[] = { 0,0, 1,0, 1,1, 0,1 };

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

meshBuilder.Position3f( vecWorldPos.x, vecWorldPos.y, vecWorldPos.z );
for( int i = 0; i < ( bUseInstancing ? 1 : 4 ); i++ )
{
meshBuilder.Position3f( x, y, z );
meshBuilder.Color4ub( rc, gc, bc, ac );
meshBuilder.TexCoord4f( 0, pSample0->m_fLeft_U0, pSample0->m_fTop_V0, pSample0->m_fRight_U0, pSample0->m_fBottom_V0 );
meshBuilder.TexCoord4f( 1, pSample0->m_fLeft_U1, pSample0->m_fTop_V1, pSample0->m_fRight_U1, pSample0->m_fBottom_V1 );
meshBuilder.TexCoord4f( 2, pSample->m_fBlendFactor, rot, rad, yaw );
meshBuilder.TexCoord2f( 3, 0, 1 );
if ( ! bUseInstancing )
{
meshBuilder.TexCoord2fv( 3, pIds );
pIds += 2;
}
meshBuilder.TexCoord4f( 4, pSecondTexture0->m_fLeft_U0, pSecondTexture0->m_fTop_V0, pSecondTexture0->m_fRight_U0, pSecondTexture0->m_fBottom_V0 );
meshBuilder.AdvanceVertex();

meshBuilder.AdvanceVertexF<VTX_HAVEPOS | VTX_HAVECOLOR, 5>();
}
if ( ! bUseInstancing )
{
meshBuilder.FastQuad( info.m_nVertexOffset );
info.m_nVertexOffset += 4;
}
Expand Down
Loading

0 comments on commit be903bd

Please sign in to comment.