Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add link script for powershell #628

Open
wants to merge 42 commits into
base: changes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9312111
perf: fix duplicate trace logic for COLLISION_MODE_PER_FRAME_PLANESET
mastercoms Mar 3, 2023
ad892e0
perf: enable SSE2 in build
mastercoms Mar 4, 2023
f8dc5b8
perf: add DirectXMath third party dep
mastercoms Mar 4, 2023
f76d081
perf: fix code bugs with SSE2 compiler
mastercoms Mar 4, 2023
0bd3752
perf: implement SSE2 math using DXMath and CSGO backports
mastercoms Mar 5, 2023
b5a943f
perf: backport CalcBones optimizations from CS:GO
mastercoms Mar 5, 2023
712ff51
perf: add animation attachment deferral
mastercoms Mar 5, 2023
db8ac86
perf: fix duplicate GetSOCData for GetQualityParticleType
mastercoms Mar 5, 2023
474947e
pending: sound updates
mastercoms Mar 6, 2023
5bd9fcf
perf: backport animation ActivityList optimization
mastercoms Mar 6, 2023
ae4f858
perf: RenderSpriteCard backport from CSGO
mastercoms Mar 6, 2023
41671be
perf(vgui): font optimizations
mastercoms Mar 10, 2023
07ea2e1
perf(vgui): backport CMatSystemSurface::DrawQuadArray from CSGO
mastercoms Mar 10, 2023
a81ea13
perf(init): move to CUtlSymbolLarge for dmxloader (CSGO backport)
mastercoms Mar 10, 2023
4f63036
perf(init): stop using a mutex during search paths
mastercoms Mar 10, 2023
d27e190
perf(init): lazily load parsed data for game DLL when on a listen server
mastercoms Mar 10, 2023
153c113
perf: stricmp optimizations
mastercoms Mar 10, 2023
b379961
perf: make various SharedObjects final to avoid virtual calls
mastercoms Mar 10, 2023
499a50b
perf: disable CWin32ReadOnlyFile to prevent duplicate stat calls
mastercoms Mar 10, 2023
60f2315
perf: remove unused r_norefresh functionality
mastercoms Mar 10, 2023
706f5f5
perf: fps_max adjustments
mastercoms Mar 11, 2023
f193968
perf: DX9Ex frame latency improvements
mastercoms Mar 11, 2023
f95dbe4
fix: MvM bomb carrier voice line playing during normal CTF with bots
mastercoms Mar 6, 2023
c3a0685
fix: tips being changed multiple times during map load
mastercoms Jul 25, 2022
79f025a
fix: update networking setting defaults
mastercoms Mar 11, 2023
4d29cb2
gameplay: fix class limit bypass from selecting class to spawn after …
mastercoms Mar 5, 2023
cc96cc9
gameplay: fix switch from bonuses not considering deploy time bonuses
mastercoms Jul 25, 2022
3403817
gameplay: movement speed modifiers were incorrect
mastercoms Jul 25, 2022
efe9744
perf(load): enable async MDL loading, speeds up map loads and reduces…
mastercoms Mar 13, 2023
bba6420
perf: disable affinity
mastercoms Mar 13, 2023
481f5eb
perf: backport GetPointContents_WorldOnly from CSGO
mastercoms Mar 13, 2023
92f8de0
perf: backport IdealPitch optimization from CSGO
mastercoms Mar 13, 2023
e0a134e
perf: don't force material system config update on exec
mastercoms Mar 13, 2023
8d95a33
perf: backport int networking optimization from CSGO
mastercoms Mar 13, 2023
f188581
perf: shared object find optimizations
mastercoms Mar 13, 2023
0ac3736
perf: skip costly per-frame RTTI for players and weapons
mastercoms Mar 13, 2023
1f38e57
perf: disable COM_TimestampedLog
mastercoms Mar 13, 2023
ed58eae
perf: do not declare convars inline with runtime code
mastercoms Mar 13, 2023
94fdfd4
perf: enable rate limiting water bullet impact effects
mastercoms Mar 13, 2023
75f4224
pending: experimental changes
mastercoms Mar 19, 2023
3887ac5
perf: use static ConVarRefs during relatively hot functions
mastercoms Mar 22, 2023
a8f842c
add link script for powershell
getchoo Mar 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions game_clean/link.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<#
.SYNOPSIS
symlink files from a retail Team Fortress 2 build to a patched build
#>

param (
[Parameter(Mandatory=$true)]
[string]$TF2Dir
)

$VerbosePreference = "Continue"
$OutPath = "$PSScriptRoot\..\game"
$GameClean = "$PSScriptRoot\."


function Make-Symlink {
param (
[String]$Path
)

$linkpath = "$OutPath/$Path"
$targetpath = "$TF2Dir/$Path"

Write-Verbose -Message "Linking $linkpath to $targetpath"
New-Item -ItemType SymbolicLink -Path $linkpath -Target $targetpath
}

function Glob-Symlink {
param (
[String]$Path,
[String]$Glob
)

Get-ChildItem -Path "$TF2Dir\$Path\*" -Include $Glob | % { $_.Name } | % { Make-Symlink -Path $Path/$_ }
}

New-Item -ItemType Directory -Path $OutPath

Write-Verbose -Message "Copying $GameClean/copy/ to $OutPath"
Copy-Item -Recurse -Force $GameClean/clean/* $OutPath

Write-Verbose -Message "Creating $OutPath/tf/materials"
New-Item -Type Directory -Path $OutPath/tf/materials

$targets = "hl2","platform"
$targets += ,"maps","media","resource","scripts" | % { "tf/$_" }
$targets += ,"models","vgui" | % { "tf/materials/$_" }
ForEach ($t in $targets) {
Make-Symlink -Path $t
}

Glob-Symlink -Glob '' -Path 'bin'
ForEach ($g in '*.vpk','*.cache') { Glob-Symlink -Glob $g -Path 'tf' }
2 changes: 1 addition & 1 deletion src/common/ServerBrowser/blacklisted_server_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool CBlacklistedServerManager::IsServerBlacklisted( uint32 serverIP, int server
{
netadr_t netAdr( serverIP, serverPort );

ConVarRef sb_showblacklists( "sb_showblacklists" );
static ConVarRef sb_showblacklists( "sb_showblacklists" );

for ( int i = 0; i < m_Blacklist.Count(); i++ )
{
Expand Down
6 changes: 2 additions & 4 deletions src/common/vgui_surfacelib/Win32Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class CWin32Font
char c;
};

enum { ABCWIDTHS_CACHE_SIZE = 256 };
abc_t* m_ABCWidthsCache[ABCWIDTHS_CACHE_SIZE];
#if !defined( _X360 )
// On PC we cache char widths on demand when actually requested to minimize our use of the kernels
// paged pool (GDI may cache information about glyphs we have requested and take up lots of paged pool)
Expand All @@ -138,10 +140,6 @@ class CWin32Font
};
CUtlRBTree<abc_cache_t, unsigned short> m_ExtendedABCWidthsCache;
static bool ExtendedABCWidthsCacheLessFunc(const abc_cache_t &lhs, const abc_cache_t &rhs);
#else
// 360 requires all possible characters during font init
enum { ABCWIDTHS_CACHE_SIZE = 256 };
abc_t m_ABCWidthsCache[ABCWIDTHS_CACHE_SIZE];
#endif
};

Expand Down
8 changes: 1 addition & 7 deletions src/datacache/mdlcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ namespace {
#define MdlCacheMsg if ( !LogMdlCache() ) ; else Msg
#define MdlCacheWarning if ( !LogMdlCache() ) ; else Warning

#if defined( _X360 )
#define AsyncMdlCache() 0 // Explicitly OFF for 360 (incompatible)
#else
#define AsyncMdlCache() 0
#endif

#define ERROR_MODEL "models/error.mdl"
#define IDSTUDIOHEADER (('T'<<24)+('S'<<16)+('D'<<8)+'I')

Expand Down Expand Up @@ -184,7 +178,7 @@ class CTempAllocHelper
// ConVars
//-----------------------------------------------------------------------------
static ConVar r_rootlod( "r_rootlod", "0", FCVAR_ARCHIVE );
static ConVar mod_forcedata( "mod_forcedata", ( AsyncMdlCache() ) ? "0" : "1", 0, "Forces all model file data into cache on model load." );
static ConVar mod_forcedata( "mod_forcedata", ( AsyncMdlCache() && IsX360() ) ? "0" : "1", 0, "Forces all model file data into cache on model load." );
static ConVar mod_test_not_available( "mod_test_not_available", "0", FCVAR_CHEAT );
static ConVar mod_test_mesh_not_available( "mod_test_mesh_not_available", "0", FCVAR_CHEAT );
static ConVar mod_test_verts_not_available( "mod_test_verts_not_available", "0", FCVAR_CHEAT );
Expand Down
6 changes: 3 additions & 3 deletions src/dmxloader/dmxattribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//-----------------------------------------------------------------------------
// globals
//-----------------------------------------------------------------------------
CUtlSymbolTableMT CDmxAttribute::s_AttributeNameSymbols;
CUtlSymbolTableLargeMT CDmxAttribute::s_AttributeNameSymbols;


//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -128,7 +128,7 @@ CDmxAttribute::CDmxAttribute( const char *pAttributeName )
m_pData = NULL;
}

CDmxAttribute::CDmxAttribute( CUtlSymbol attributeName )
CDmxAttribute::CDmxAttribute( CUtlSymbolLarge attributeName )
{
m_Name = attributeName;
m_Type = AT_UNKNOWN;
Expand Down Expand Up @@ -221,7 +221,7 @@ inline const char* CDmxAttribute::GetTypeString() const
//-----------------------------------------------------------------------------
const char *CDmxAttribute::GetName() const
{
return s_AttributeNameSymbols.String( m_Name );
return m_Name.String();
}


Expand Down
9 changes: 5 additions & 4 deletions src/dmxloader/dmxelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "dmxloader/dmxattribute.h"
#include "tier1/utlbuffer.h"
#include "mathlib/ssemath.h"
#include "tier1/utlsymbollarge.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
Expand All @@ -16,7 +17,7 @@
//-----------------------------------------------------------------------------
// globals
//-----------------------------------------------------------------------------
CUtlSymbolTableMT CDmxElement::s_TypeSymbols;
CUtlSymbolTableLargeMT CDmxElement::s_TypeSymbols;


//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -50,14 +51,14 @@ CDmxElement::~CDmxElement()
//-----------------------------------------------------------------------------
// Utility method for getting at the type
//-----------------------------------------------------------------------------
CUtlSymbol CDmxElement::GetType() const
CUtlSymbolLarge CDmxElement::GetType() const
{
return m_Type;
}

const char* CDmxElement::GetTypeString() const
{
return s_TypeSymbols.String( m_Type );
return m_Type.String();
}

const char* CDmxElement::GetName() const
Expand Down Expand Up @@ -225,7 +226,7 @@ int CDmxElement::FindAttribute( const char *pAttributeName ) const
//-----------------------------------------------------------------------------
// Find an attribute by name-based lookup
//-----------------------------------------------------------------------------
int CDmxElement::FindAttribute( CUtlSymbol attributeName ) const
int CDmxElement::FindAttribute( CUtlSymbolLarge attributeName ) const
{
Resort();
CDmxAttribute search( attributeName );
Expand Down
6 changes: 3 additions & 3 deletions src/dmxloader/dmxloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ bool CDmxSerializer::Unserialize( CUtlBuffer &buf, int nEncodingVersion, CDmxEle
}

// Read in the element count.
int nElementCount = buf.GetInt();
const int nElementCount = buf.GetInt();
if ( !nElementCount )
{
// Empty (but valid) file
Expand Down Expand Up @@ -474,10 +474,10 @@ bool CDmxSerializer::Unserialize( CUtlBuffer &buf, int nEncodingVersion, CDmxEle
}
else
{
buf.GetString( pTypeBuf );
buf.GetString<256>( pTypeBuf );
pType = pTypeBuf;
}
buf.GetString( pName );
buf.GetString<2048>( pName );
buf.Get( &id, sizeof(DmObjectId_t) );

CDmxElement *pElement = new CDmxElement( pType );
Expand Down
4 changes: 2 additions & 2 deletions src/engine/audio/private/snd_channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ struct channel_t
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

#define MAX_CHANNELS 128
#define MAX_DYNAMIC_CHANNELS 64
#define MAX_CHANNELS 256
#define MAX_DYNAMIC_CHANNELS 32

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
Expand Down
27 changes: 15 additions & 12 deletions src/engine/audio/private/snd_dev_direct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int CAudioDirectSound::PaintBegin( float mixAheadTime, int soundtime, int lpaint
DWORD dwStatus;

// If using surround, there are 4 or 5 different buffers being used and the pDSBuf is NULL.
if ( IsUsingBufferPerSpeaker() )
if ( IsUsingBufferPerSpeaker() )
{
if (pDSBufFL->GetStatus(&dwStatus) != DS_OK)
Msg ("Couldn't get SURROUND FL sound buffer status\n");
Expand Down Expand Up @@ -674,6 +674,7 @@ bool CAudioDirectSound::SNDDMA_InitInterleaved( LPDIRECTSOUND lpDS, WAVEFORMATEX
dsbdesc.dwFlags = 0;
break;
}
dsbdesc.dwFlags |= DSBCAPS_TRUEPLAYPOSITION;
if ( !snd_mute_losefocus.GetBool() )
{
dsbdesc.dwFlags |= DSBCAPS_GLOBALFOCUS;
Expand All @@ -688,7 +689,7 @@ bool CAudioDirectSound::SNDDMA_InitInterleaved( LPDIRECTSOUND lpDS, WAVEFORMATEX
if ( !bSuccess )
return false;

DWORD dwSize = 0, dwWrite;
DWORD dwSize = 0;
DWORD *pBuffer = 0;
if ( !LockDSBuffer( pDSBuf, &pBuffer, &dwSize, "DS_INTERLEAVED", DSBLOCK_ENTIREBUFFER ) )
return false;
Expand All @@ -707,7 +708,7 @@ bool CAudioDirectSound::SNDDMA_InitInterleaved( LPDIRECTSOUND lpDS, WAVEFORMATEX
pDSBuf->Play(0, 0, DSBPLAY_LOOPING);

pDSBuf->Stop();
pDSBuf->GetCurrentPosition(&m_outputBufferStartOffset, &dwWrite);
pDSBuf->GetCurrentPosition(&m_outputBufferStartOffset, NULL);

pDSBuf->Play(0, 0, DSBPLAY_LOOPING);

Expand All @@ -725,7 +726,7 @@ sndinitstat CAudioDirectSound::SNDDMA_InitDirect( void )
{
DSBUFFERDESC dsbuf;
DSBCAPS dsbcaps;
DWORD dwSize, dwWrite;
DWORD dwSize;
WAVEFORMATEX format;
WAVEFORMATEX pformat;
HRESULT hresult;
Expand Down Expand Up @@ -830,7 +831,7 @@ sndinitstat CAudioDirectSound::SNDDMA_InitDirect( void )
// sound hardware format
Q_memset( &dsbuf, 0, sizeof(dsbuf) );
dsbuf.dwSize = sizeof(DSBUFFERDESC);
dsbuf.dwFlags = DSBCAPS_PRIMARYBUFFER;
dsbuf.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_TRUEPLAYPOSITION;
if ( snd_legacy_surround.GetBool() || m_bSurround )
{
dsbuf.dwFlags |= DSBCAPS_CTRL3D;
Expand Down Expand Up @@ -900,7 +901,8 @@ sndinitstat CAudioDirectSound::SNDDMA_InitDirect( void )
// create the secondary buffer we'll actually work with
Q_memset( &dsbuf, 0, sizeof(dsbuf) );
dsbuf.dwSize = sizeof(DSBUFFERDESC);
dsbuf.dwFlags = DSBCAPS_LOCSOFTWARE; // NOTE: don't use CTRLFREQUENCY (slow)
// NOTE: don't use CTRLFREQUENCY (slow)
dsbuf.dwFlags = DSBCAPS_LOCSOFTWARE | DSBCAPS_TRUEPLAYPOSITION;
dsbuf.dwBufferBytes = SECONDARY_BUFFER_SIZE;
dsbuf.lpwfxFormat = &format;
if ( !snd_mute_losefocus.GetBool() )
Expand Down Expand Up @@ -992,7 +994,7 @@ sndinitstat CAudioDirectSound::SNDDMA_InitDirect( void )

pDSBuf->Stop();

pDSBuf->GetCurrentPosition(&m_outputBufferStartOffset, &dwWrite);
pDSBuf->GetCurrentPosition(&m_outputBufferStartOffset, NULL);

pDSBuf->Play(0, 0, DSBPLAY_LOOPING);
}
Expand Down Expand Up @@ -1288,7 +1290,7 @@ void DS3D_SetBufferParams( LPDIRECTSOUND3DBUFFER pDSBuf3D, D3DVECTOR *pbpos, D3D
bparm.vConeOrientation = bdir;
bparm.lConeOutsideVolume = DSBVOLUME_MIN;
bparm.flMinDistance = 100.0; // no rolloff (until > 2.0 meter distance)
bparm.flMaxDistance = DS3D_DEFAULTMAXDISTANCE;
bparm.flMaxDistance = 1000.0;
bparm.dwMode = DS3DMODE_NORMAL;

hr = pDSBuf3D->SetAllParameters( &bparm, DS3D_DEFERRED );
Expand All @@ -1300,7 +1302,7 @@ bool CAudioDirectSound::SNDDMA_InitSurround(LPDIRECTSOUND lpDS, WAVEFORMATEX* lp
{
DSBUFFERDESC dsbuf;
WAVEFORMATEX wvex;
DWORD dwSize, dwWrite;
DWORD dwSize;
int reps;
HRESULT hresult;
void *lpData = NULL;
Expand All @@ -1316,8 +1318,9 @@ bool CAudioDirectSound::SNDDMA_InitSurround(LPDIRECTSOUND lpDS, WAVEFORMATEX* lp

memset (&dsbuf, 0, sizeof(dsbuf));
dsbuf.dwSize = sizeof(DSBUFFERDESC);
// NOTE: LOCHARDWARE causes SB AWE64 to crash in it's DSOUND driver
dsbuf.dwFlags = DSBCAPS_CTRL3D; // don't use CTRLFREQUENCY (slow)
// NOTE: LOCHARDWARE causes SB AWE64 to crash in it's DSOUND driver
// don't use CTRLFREQUENCY (slow)
dsbuf.dwFlags = DSBCAPS_CTRL3D | DSBCAPS_TRUEPLAYPOSITION;
if ( !snd_mute_losefocus.GetBool() )
{
dsbuf.dwFlags |= DSBCAPS_GLOBALFOCUS;
Expand Down Expand Up @@ -1623,7 +1626,7 @@ bool CAudioDirectSound::SNDDMA_InitSurround(LPDIRECTSOUND lpDS, WAVEFORMATEX* lp

// get hardware playback position, store it, syncronize all buffers to FL

pDSBufFL->GetCurrentPosition(&m_outputBufferStartOffset, &dwWrite);
pDSBufFL->GetCurrentPosition(&m_outputBufferStartOffset, NULL);
pDSBufFR->SetCurrentPosition(m_outputBufferStartOffset);
pDSBufRL->SetCurrentPosition(m_outputBufferStartOffset);
pDSBufRR->SetCurrentPosition(m_outputBufferStartOffset);
Expand Down
Loading