mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-07-18 23:31:22 +00:00
chore: Merge branch 'master' of https://github.com/nillerusr/source-engine.
This commit is contained in:
commit
d3c09196ba
@ -65,9 +65,12 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
|
||||
#define JPEGLIB_USE_STDIO
|
||||
#if ANDROID
|
||||
#include "android/jpeglib/jpeglib.h"
|
||||
#else
|
||||
#elif defined WIN32
|
||||
#include "jpeglib/jpeglib.h"
|
||||
#else
|
||||
#include <jpeglib.h>
|
||||
#endif
|
||||
|
||||
#undef JPEGLIB_USE_STDIO
|
||||
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ bool CNetworkStringTableItem::SetUserData( int tick, int length, const void *use
|
||||
|
||||
if ( length > 0 )
|
||||
{
|
||||
m_pUserData = new unsigned char[ length ];
|
||||
m_pUserData = new unsigned char[ALIGN_VALUE( length, 4 )];
|
||||
Q_memcpy( m_pUserData, userData, length );
|
||||
}
|
||||
else
|
||||
|
||||
@ -921,7 +921,7 @@ void DownloadThread( void *voidPtr )
|
||||
// Delete rc.data, which was allocated in this thread
|
||||
if ( rc.data != NULL )
|
||||
{
|
||||
delete[] rc.data;
|
||||
free(rc.data);
|
||||
rc.data = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -226,7 +226,7 @@ bool CPureServerWhitelist::LoadCommandsFromKeyValues( KeyValues *kv )
|
||||
else
|
||||
Warning( "Unknown modifier in whitelist file: %s.\n", mods[i] );
|
||||
}
|
||||
mods.PurgeAndDeleteElements();
|
||||
mods.PurgeAndDeleteElementsArray();
|
||||
if (
|
||||
( bFromTrustedSource && ( bAllowFromDisk || bCheckCRC || bAny ) )
|
||||
|| ( bAny && bCheckCRC ) )
|
||||
|
||||
@ -1227,7 +1227,7 @@ void SV_DetermineMulticastRecipients( bool usepas, const Vector& origin, CBitVec
|
||||
serverGameClients->ClientEarPosition( pClient->edict, &vecEarPosition );
|
||||
|
||||
int iBitNumber = CM_LeafCluster( CM_PointLeafnum( vecEarPosition ) );
|
||||
if ( !(pMask[iBitNumber>>3] & (1<<(iBitNumber&7)) ) )
|
||||
if ( iBitNumber < 0 || !(pMask[iBitNumber>>3] & (1<<(iBitNumber&7)) ) )
|
||||
continue;
|
||||
|
||||
playerbits.Set( i );
|
||||
|
||||
@ -1842,7 +1842,7 @@ void CVEngineServer::PlaybackTempEntity( IRecipientFilter& filter, float delay,
|
||||
|
||||
newEvent->bits = buffer.GetNumBitsWritten();
|
||||
int size = Bits2Bytes( buffer.GetNumBitsWritten() );
|
||||
newEvent->pData = new byte[size];
|
||||
newEvent->pData = new byte[ALIGN_VALUE(size,4)];
|
||||
Q_memcpy( newEvent->pData, data, size );
|
||||
|
||||
// add to list
|
||||
|
||||
@ -268,7 +268,7 @@ public:
|
||||
|
||||
if ( data )
|
||||
{
|
||||
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetInt( "PanelPtr", 0 ) : 0;
|
||||
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetPtr( "PanelPtr", 0 ) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -388,7 +388,7 @@ void VGui_RecursivePrintTree(
|
||||
Q_snprintf( str, sizeof( str ), "%s", name );
|
||||
|
||||
pVal->SetString( "Text", str );
|
||||
pVal->SetInt( "PanelPtr", current );
|
||||
pVal->SetPtr( "PanelPtr", (void*)current );
|
||||
|
||||
pNewParent = pVal;
|
||||
|
||||
@ -417,7 +417,7 @@ bool UpdateItemState(
|
||||
vgui::IPanel *ipanel = vgui::ipanel();
|
||||
|
||||
KeyValues *pItemData = pTree->GetItemData( iChildItemId );
|
||||
if ( pItemData->GetInt( "PanelPtr" ) != pSub->GetInt( "PanelPtr" ) ||
|
||||
if ( pItemData->GetPtr( "PanelPtr" ) != pSub->GetPtr( "PanelPtr" ) ||
|
||||
Q_stricmp( pItemData->GetString( "Text" ), pSub->GetString( "Text" ) ) != 0 )
|
||||
{
|
||||
pTree->ModifyItem( iChildItemId, pSub );
|
||||
@ -425,7 +425,7 @@ bool UpdateItemState(
|
||||
}
|
||||
|
||||
// Ok, this is a new panel.
|
||||
vgui::VPANEL vPanel = pSub->GetInt( "PanelPtr" );
|
||||
vgui::VPANEL vPanel = (vgui::VPANEL)pSub->GetPtr( "PanelPtr" );
|
||||
|
||||
int iBaseColor[3] = { 255, 255, 255 };
|
||||
if ( ipanel->IsPopup( vPanel ) )
|
||||
@ -433,7 +433,7 @@ bool UpdateItemState(
|
||||
iBaseColor[0] = 255; iBaseColor[1] = 255; iBaseColor[2] = 0;
|
||||
}
|
||||
|
||||
if ( g_FocusPanelList.Find( vPanel ) != -1 )
|
||||
if ( g_FocusPanelList.Find( vPanel ) != vgui::INVALID_PANEL )
|
||||
{
|
||||
iBaseColor[0] = 0; iBaseColor[1] = 255; iBaseColor[2] = 0;
|
||||
pTree->ExpandItem( iChildItemId, true );
|
||||
|
||||
@ -4203,7 +4203,7 @@ bool CBaseFileSystem::FindNextFileInVPKOrPakHelper( FindData_t *pFindData )
|
||||
{
|
||||
V_strncpy( pFindData->findData.cFileName, V_UnqualifiedFileName( pFindData->m_fileMatchesFromVPKOrPak[0] ), sizeof( pFindData->findData.cFileName ) );
|
||||
pFindData->findData.dwFileAttributes = 0;
|
||||
delete pFindData->m_fileMatchesFromVPKOrPak.Head();
|
||||
delete[] pFindData->m_fileMatchesFromVPKOrPak.Head();
|
||||
pFindData->m_fileMatchesFromVPKOrPak.RemoveMultipleFromHead( 1 );
|
||||
|
||||
return true;
|
||||
|
||||
@ -115,7 +115,7 @@ void CTeamMenu::ApplySchemeSettings(IScheme *pScheme)
|
||||
|
||||
if ( *m_szMapName )
|
||||
{
|
||||
LoadMapPage( m_szMapName ); // reload the map description to pick up the color
|
||||
LoadMapPage( NULL ); // reload the map description to pick up the color
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,22 +185,23 @@ void CTeamMenu::Update()
|
||||
void CTeamMenu::LoadMapPage( const char *mapName )
|
||||
{
|
||||
// Save off the map name so we can re-load the page in ApplySchemeSettings().
|
||||
Q_strncpy( m_szMapName, mapName, strlen( mapName ) + 1 );
|
||||
|
||||
if( mapName )
|
||||
Q_strncpy( m_szMapName, mapName, strlen( mapName ) + 1 );
|
||||
|
||||
char mapRES[ MAX_PATH ];
|
||||
|
||||
char uilanguage[ 64 ];
|
||||
uilanguage[0] = 0;
|
||||
engine->GetUILanguage( uilanguage, sizeof( uilanguage ) );
|
||||
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", mapName, uilanguage );
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", m_szMapName, uilanguage );
|
||||
|
||||
bool bFoundHTML = false;
|
||||
|
||||
if ( !g_pFullFileSystem->FileExists( mapRES ) )
|
||||
{
|
||||
// try english
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_english.html", mapName );
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_english.html", m_szMapName );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -240,7 +241,7 @@ void CTeamMenu::LoadMapPage( const char *mapName )
|
||||
#endif
|
||||
}
|
||||
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "maps/%s.txt", mapName);
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "maps/%s.txt", m_szMapName);
|
||||
|
||||
// if no map specific description exists, load default text
|
||||
if( !g_pFullFileSystem->FileExists( mapRES ) )
|
||||
|
||||
@ -508,7 +508,7 @@ public:
|
||||
if ( panel == m_pDXLevel && RequiresRestart() )
|
||||
{
|
||||
// notify the user that this will require a disconnect
|
||||
QueryBox *box = new QueryBox("#GameUI_SettingRequiresDisconnect_Title", "#GameUI_SettingRequiresDisconnect_Info");
|
||||
QueryBox *box = new QueryBox("#GameUI_SettingRequiresDisconnect_Title", "#GameUI_SettingRequiresDisconnect_Info", this);
|
||||
box->AddActionSignalTarget( this );
|
||||
box->SetCancelCommand(new KeyValues("ResetDXLevelCombo"));
|
||||
box->DoModal();
|
||||
|
||||
@ -1788,14 +1788,14 @@ FORCEINLINE fltx4 LoadAlignedSIMD( const VectorAligned & pSIMD )
|
||||
return SetWToZeroSIMD( LoadAlignedSIMD(pSIMD.Base()) );
|
||||
}
|
||||
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
static __attribute__((no_sanitize("address"))) fltx4 LoadUnalignedSIMD( const void *pSIMD )
|
||||
#ifdef USING_ASAN
|
||||
static NO_ASAN fltx4 LoadUnalignedSIMD( const void *pSIMD )
|
||||
{
|
||||
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
|
||||
|
||||
}
|
||||
|
||||
static __attribute__((no_sanitize("address"))) fltx4 LoadUnaligned3SIMD( const void *pSIMD )
|
||||
static NO_ASAN fltx4 LoadUnaligned3SIMD( const void *pSIMD )
|
||||
{
|
||||
return _mm_loadu_ps( reinterpret_cast<const float *>( pSIMD ) );
|
||||
}
|
||||
|
||||
@ -95,6 +95,7 @@ enum soundlevel_t
|
||||
|
||||
// NOTE: Valid soundlevel_t values are 0-255.
|
||||
// 256-511 are reserved for sounds using goldsrc compatibility attenuation.
|
||||
SNDLVBL_MAX = 511
|
||||
};
|
||||
|
||||
#define MAX_SNDLVL_BITS 9 // Used to encode 0-255 for regular soundlevel_t's and 256-511 for goldsrc-compatible ones.
|
||||
|
||||
@ -1010,7 +1010,7 @@ CUtlString D3DToGL::FixGLSLSwizzle( const char *pDestRegisterName, const char *p
|
||||
{
|
||||
bool bAbsWrapper = false; // Parameter wrapped in an abs()
|
||||
bool bAbsNegative = false; // -abs()
|
||||
char szSrcRegister[128];
|
||||
static char szSrcRegister[128];
|
||||
V_strncpy( szSrcRegister, pSrcRegisterName, sizeof(szSrcRegister) );
|
||||
|
||||
// Check for abs() or -abs() wrapper and strip it off during the fixup
|
||||
|
||||
@ -1500,6 +1500,9 @@ void FileOpenDialog::OnOpen()
|
||||
char pFileName[MAX_PATH];
|
||||
GetSelectedFileName( pFileName, sizeof( pFileName ) );
|
||||
|
||||
if( !pFileName[0] )
|
||||
return;
|
||||
|
||||
int nLen = Q_strlen( pFileName );
|
||||
bool bSpecifiedDirectory = ( pFileName[nLen-1] == '/' || pFileName[nLen-1] == '\\' ) && (!IsOSX() || ( IsOSX() && !Q_stristr( pFileName, ".app" ) ) );
|
||||
Q_StripTrailingSlash( pFileName );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user