mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 03:56:10 +08:00
General:
* Fixed a variety of server browser issues with mods based on this SDK * Fixed many warnings on various platforms * Added source code for fgdlib and raytrace * Updated many source files with the latest shared source from TF2. OSX: * Added support for Xcode 4.6 * Switched OSX builds to use Xcode instead of makefiles * Moved libs from src/lib/osx32 to src/lib/public/osx32 or src/lib/common/osx32 to match windows better. Linux: * Moved libs from src/lib/linux32 to src/lib/public/linux32 or src/lib/common/linux32 to match windows better.
This commit is contained in:
@ -3232,10 +3232,12 @@ int unzlocal_GetCurrentFileInfoInternal (unzFile file, unz_file_info *pfile_info
|
||||
|
||||
// we check the magic
|
||||
if (err==UNZ_OK)
|
||||
{
|
||||
if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
|
||||
err=UNZ_ERRNO;
|
||||
else if (uMagic!=0x02014b50)
|
||||
err=UNZ_BADZIPFILE;
|
||||
}
|
||||
|
||||
if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK)
|
||||
err=UNZ_ERRNO;
|
||||
@ -3312,10 +3314,12 @@ int unzlocal_GetCurrentFileInfoInternal (unzFile file, unz_file_info *pfile_info
|
||||
uSizeRead = extraFieldBufferSize;
|
||||
|
||||
if (lSeek!=0)
|
||||
{
|
||||
if (lufseek(s->file,lSeek,SEEK_CUR)==0)
|
||||
lSeek=0;
|
||||
else
|
||||
err=UNZ_ERRNO;
|
||||
}
|
||||
if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
|
||||
if (lufread(extraField,(uInt)uSizeRead,1,s->file)!=1)
|
||||
err=UNZ_ERRNO;
|
||||
@ -3337,10 +3341,12 @@ int unzlocal_GetCurrentFileInfoInternal (unzFile file, unz_file_info *pfile_info
|
||||
uSizeRead = commentBufferSize;
|
||||
|
||||
if (lSeek!=0)
|
||||
{
|
||||
if (lufseek(s->file,lSeek,SEEK_CUR)==0)
|
||||
{} // unused lSeek=0;
|
||||
else
|
||||
err=UNZ_ERRNO;
|
||||
}
|
||||
if ((file_info.size_file_comment>0) && (commentBufferSize>0))
|
||||
if (lufread(szComment,(uInt)uSizeRead,1,s->file)!=1)
|
||||
err=UNZ_ERRNO;
|
||||
@ -3490,10 +3496,12 @@ int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s,uInt *piSizeVar,
|
||||
|
||||
|
||||
if (err==UNZ_OK)
|
||||
{
|
||||
if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
|
||||
err=UNZ_ERRNO;
|
||||
else if (uMagic!=0x04034b50)
|
||||
err=UNZ_BADZIPFILE;
|
||||
}
|
||||
|
||||
if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
|
||||
err=UNZ_ERRNO;
|
||||
|
@ -57,7 +57,9 @@ public:
|
||||
{
|
||||
p = new T[MAXSTUDIOBONES];
|
||||
if ( ((size_t)p) % TSLIST_NODE_ALIGNMENT != 0 )
|
||||
{
|
||||
DebuggerBreak();
|
||||
}
|
||||
}
|
||||
|
||||
return p;
|
||||
|
@ -566,6 +566,8 @@ public:
|
||||
virtual bool IsActiveApp() = 0;
|
||||
|
||||
virtual void DisconnectInternal() = 0;
|
||||
|
||||
virtual int GetInstancesRunningCount( ) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -63,7 +63,8 @@ public:
|
||||
// Adds decals to static props, returns point of decal in trace_t
|
||||
virtual void AddDecalToStaticProp( const Vector& rayStart, const Vector& rayEnd,
|
||||
int staticPropIndex, int decalIndex, bool doTrace, trace_t& tr ) = 0;
|
||||
|
||||
virtual void AddColorDecalToStaticProp( Vector const& rayStart, Vector const& rayEnd,
|
||||
int staticPropIndex, int decalIndex, bool doTrace, trace_t& tr, bool bUseColor, Color cColor ) = 0;
|
||||
// Adds/removes shadows from static props
|
||||
virtual void AddShadowToStaticProp( unsigned short shadowHandle, IClientRenderable* pRenderable ) = 0;
|
||||
virtual void RemoveAllShadowsFromStaticProp( IClientRenderable* pRenderable ) = 0;
|
||||
|
@ -138,6 +138,8 @@ public:
|
||||
// radius of the decal to create.
|
||||
virtual void AddDecal( ModelInstanceHandle_t handle, Ray_t const& ray,
|
||||
Vector const& decalUp, int decalIndex, int body, bool noPokeThru = false, int maxLODToDecal = ADDDECAL_TO_ALL_LODS ) = 0;
|
||||
virtual void AddColoredDecal( ModelInstanceHandle_t handle, Ray_t const& ray,
|
||||
Vector const& decalUp, int decalIndex, int body, Color cColor, bool noPokeThru = false, int maxLODToDecal = ADDDECAL_TO_ALL_LODS ) = 0;
|
||||
|
||||
// Removes all the decals on a model instance
|
||||
virtual void RemoveAllDecals( ModelInstanceHandle_t handle ) = 0;
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
fieldtype_t FieldType( void ) { return fieldType; }
|
||||
|
||||
void SetBool( bool b ) { bVal = b; fieldType = FIELD_BOOLEAN; }
|
||||
void SetString( char *str ) { Q_snprintf(iszVal, 1024, str); fieldType = FIELD_STRING; }
|
||||
void SetString( char *str ) { Q_snprintf(iszVal, 1024, "%s", str); fieldType = FIELD_STRING; }
|
||||
void SetInt( int val ) { iVal = val, fieldType = FIELD_INTEGER; }
|
||||
void SetFloat( float val ) { flVal = val, fieldType = FIELD_FLOAT; }
|
||||
void SetEdict( edict_t *val ) { eVal = val; fieldType = FIELD_EHANDLE; }
|
||||
|
@ -117,6 +117,13 @@ public:
|
||||
|
||||
// read and clear accumulated raw input values
|
||||
virtual bool GetRawMouseAccumulators( int& accumX, int& accumY ) = 0;
|
||||
|
||||
// tell the input system that we're not a game, we're console text mode.
|
||||
// this is used for dedicated servers to not initialize joystick system.
|
||||
// this needs to be called before CInputSystem::Init (e.g. in PreInit of
|
||||
// some system) if you want ot prevent the joystick system from ever
|
||||
// being initialized.
|
||||
virtual void SetConsoleTextMode( bool bConsoleTextMode ) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -253,9 +253,13 @@ DBG_INTERFACE struct SDL_Window * GetAssertDialogParent();
|
||||
if ( ret == SPEW_DEBUGGER) \
|
||||
{ \
|
||||
if ( !ShouldUseNewAssertDialog() || DoNewAssertDialog( __TFILE__, __LINE__, _msg ) ) \
|
||||
{ \
|
||||
DebuggerBreak(); \
|
||||
} \
|
||||
if ( _bFatal ) \
|
||||
{ \
|
||||
_ExitOnFatalAssert( __TFILE__, __LINE__ ); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -150,7 +150,6 @@ typedef signed char int8;
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#define PLATFORM_64BITS
|
||||
#endif // __x86_64__
|
||||
|
||||
#if defined( _WIN32 )
|
||||
@ -391,7 +390,7 @@ typedef void * HINSTANCE;
|
||||
// On OSX, SIGTRAP doesn't really stop the thread cold when debugging.
|
||||
// So if being debugged, use INT3 which is precise.
|
||||
#ifdef OSX
|
||||
#define DebuggerBreak() if ( Plat_IsInDebugSession() ) __asm ( "int $3" ); else { raise(SIGTRAP); }
|
||||
#define DebuggerBreak() if ( Plat_IsInDebugSession() ) { __asm ( "int $3" ); } else { raise(SIGTRAP); }
|
||||
#else
|
||||
#define DebuggerBreak() raise(SIGTRAP)
|
||||
#endif
|
||||
@ -662,6 +661,7 @@ typedef void * HINSTANCE;
|
||||
#pragma GCC diagnostic ignored "-Wconversion-null" // passing NULL to non-pointer argument 1
|
||||
#pragma GCC diagnostic ignored "-Wnull-arithmetic" // NULL used in arithmetic. Ie, vpanel == NULL where VPANEL is uint.
|
||||
#pragma GCC diagnostic ignored "-Wswitch-enum" // enumeration values not handled in switch
|
||||
#pragma GCC diagnostic ignored "-Wswitch" // enumeration values not handled in switch
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -18,6 +18,9 @@
|
||||
#if defined( _WIN32 )
|
||||
#pragma once
|
||||
#endif
|
||||
#if defined(POSIX)
|
||||
#pragma GCC visibility push(hidden)
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
|
||||
@ -28,7 +31,7 @@
|
||||
int result; \
|
||||
va_list arg_ptr; \
|
||||
bool bTruncated = false; \
|
||||
static int scAsserted = 0; \
|
||||
static unsigned int scAsserted = 0; \
|
||||
\
|
||||
va_start(arg_ptr, lastArg); \
|
||||
result = Q_vsnprintfRet( (szBuf), nBufSize, (*(ppszFormat)), arg_ptr, &bTruncated ); \
|
||||
@ -115,7 +118,7 @@ public:
|
||||
m_nLength = 0;
|
||||
}
|
||||
|
||||
void AppendFormat( PRINTF_FORMAT_STRING const char *pchFormat, ... )
|
||||
void AppendFormat(PRINTF_FORMAT_STRING const char *pchFormat, ... ) FMTFUNCTION( 2, 3 )
|
||||
{
|
||||
char *pchEnd = m_szBuf + m_nLength;
|
||||
FmtStrVSNPrintf( pchEnd, SIZE_BUF - m_nLength, m_bQuietTruncation, &pchFormat, m_nLength, pchFormat );
|
||||
@ -174,6 +177,10 @@ void CFmtStrN<SIZE_BUF>::AppendFormatV( const char *pchFormat, va_list args )
|
||||
}
|
||||
|
||||
|
||||
#if defined(POSIX)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Purpose: Default-sized string formatter
|
||||
|
@ -16,7 +16,8 @@
|
||||
#include "limits.h"
|
||||
|
||||
#if defined( OSX )
|
||||
inline wchar_t *wcsdup(const wchar_t *pString)
|
||||
#define wcsdup wcsdup_osx
|
||||
inline wchar_t *wcsdup_osx(const wchar_t *pString)
|
||||
{
|
||||
wchar_t *pMemory;
|
||||
|
||||
|
@ -519,10 +519,10 @@ public:
|
||||
// [tj] Simple getters and setters to decide which corners to draw rounded
|
||||
unsigned char GetRoundedCorners() { return m_roundedCorners; }
|
||||
void SetRoundedCorners (unsigned char cornerFlags) { m_roundedCorners = cornerFlags; }
|
||||
bool ShouldDrawTopLeftCornerRounded() { return m_roundedCorners & PANEL_ROUND_CORNER_TOP_LEFT; }
|
||||
bool ShouldDrawTopRightCornerRounded() { return m_roundedCorners & PANEL_ROUND_CORNER_TOP_RIGHT; }
|
||||
bool ShouldDrawBottomLeftCornerRounded() { return m_roundedCorners & PANEL_ROUND_CORNER_BOTTOM_LEFT; }
|
||||
bool ShouldDrawBottomRightCornerRounded() { return m_roundedCorners & PANEL_ROUND_CORNER_BOTTOM_RIGHT; }
|
||||
bool ShouldDrawTopLeftCornerRounded() { return ( m_roundedCorners & PANEL_ROUND_CORNER_TOP_LEFT ) != 0; }
|
||||
bool ShouldDrawTopRightCornerRounded() { return ( m_roundedCorners & PANEL_ROUND_CORNER_TOP_RIGHT ) != 0; }
|
||||
bool ShouldDrawBottomLeftCornerRounded() { return ( m_roundedCorners & PANEL_ROUND_CORNER_BOTTOM_LEFT ) != 0; }
|
||||
bool ShouldDrawBottomRightCornerRounded() { return ( m_roundedCorners & PANEL_ROUND_CORNER_BOTTOM_RIGHT ) != 0; }
|
||||
|
||||
//=============================================================================
|
||||
// HPE_END
|
||||
|
Reference in New Issue
Block a user