mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-17 06:03:02 +00:00
add source-sdk-2013
This commit is contained in:
+13
-71
@@ -17,7 +17,6 @@
|
||||
#include "engine/IEngineTrace.h"
|
||||
#include "engine/IStaticPropMgr.h"
|
||||
#include "shared_classnames.h"
|
||||
#include "steam/steamuniverse.h"
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
#include "cdll_client_int.h"
|
||||
@@ -360,24 +359,15 @@ void UTIL_StringToFloatArray( float *pVector, int count, const char *pString );
|
||||
void UTIL_StringToColor32( color32 *color, const char *pString );
|
||||
|
||||
CBasePlayer *UTIL_PlayerByIndex( int entindex );
|
||||
// Helper for use with console commands and the like.
|
||||
// Returns NULL if not found or if the provided arg would match multiple players.
|
||||
// Currently accepts, in descending priority:
|
||||
// - Formatted SteamID ([U:1:1234])
|
||||
// - SteamID64 (76561197989728462)
|
||||
// - Legacy SteamID (STEAM_0:1:1234)
|
||||
// - UserID preceded by a pound (#4)
|
||||
// - Partial name match (if unique)
|
||||
// - UserID not preceded by a pound*
|
||||
//
|
||||
// *Does not count as ambiguous with higher priority items
|
||||
CBasePlayer* UTIL_PlayerByCommandArg( const char *arg );
|
||||
|
||||
CBasePlayer* UTIL_PlayerByUserId( int userID );
|
||||
CBasePlayer* UTIL_PlayerByName( const char *name ); // not case sensitive
|
||||
// Finds a player who has this non-ambiguous substring. Also not case sensitive.
|
||||
CBasePlayer* UTIL_PlayerByPartialName( const char *name );
|
||||
|
||||
//=============================================================================
|
||||
// HPE_BEGIN:
|
||||
// [menglish] Added UTIL function for events in client win_panel which transmit the player as a user ID
|
||||
//=============================================================================
|
||||
CBasePlayer *UTIL_PlayerByUserId( int userID );
|
||||
//=============================================================================
|
||||
// HPE_END
|
||||
//=============================================================================
|
||||
|
||||
// decodes a buffer using a 64bit ICE key (inplace)
|
||||
void UTIL_DecodeICE( unsigned char * buffer, int size, const unsigned char *key);
|
||||
@@ -451,8 +441,8 @@ inline float DistanceToRay( const Vector &pos, const Vector &rayStart, const Vec
|
||||
public: \
|
||||
interfaceName( bool bAutoAdd = true ); \
|
||||
virtual ~interfaceName(); \
|
||||
static void AddToAutoList( interfaceName *pElement ) { m_##interfaceName##AutoList.AddToTail( pElement ); } \
|
||||
static void RemoveFromAutoList( interfaceName *pElement ) { m_##interfaceName##AutoList.FindAndFastRemove( pElement ); } \
|
||||
static void Add( interfaceName *pElement ) { m_##interfaceName##AutoList.AddToTail( pElement ); } \
|
||||
static void Remove( interfaceName *pElement ) { m_##interfaceName##AutoList.FindAndFastRemove( pElement ); } \
|
||||
static const CUtlVector< interfaceName* >& AutoList( void ) { return m_##interfaceName##AutoList; } \
|
||||
private: \
|
||||
static CUtlVector< interfaceName* > m_##interfaceName##AutoList; \
|
||||
@@ -466,45 +456,14 @@ inline float DistanceToRay( const Vector &pos, const Vector &rayStart, const Vec
|
||||
{ \
|
||||
if ( bAutoAdd ) \
|
||||
{ \
|
||||
AddToAutoList( this ); \
|
||||
Add( this ); \
|
||||
} \
|
||||
} \
|
||||
interfaceName::~interfaceName() \
|
||||
{ \
|
||||
RemoveFromAutoList( this ); \
|
||||
Remove( this ); \
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
// You can use this if you need an autolist without an extra interface type involved.
|
||||
// To use this, just inherit (class Mine : public TAutoList<Mine> {)
|
||||
template< class T >
|
||||
class TAutoList
|
||||
{
|
||||
public:
|
||||
typedef CUtlVector< T* > AutoListType;
|
||||
|
||||
static AutoListType &GetAutoList()
|
||||
{
|
||||
return m_autolist;
|
||||
}
|
||||
|
||||
protected:
|
||||
TAutoList()
|
||||
{
|
||||
m_autolist.AddToTail( static_cast< T* >( this ) );
|
||||
}
|
||||
|
||||
virtual ~TAutoList()
|
||||
{
|
||||
m_autolist.FindAndFastRemove( static_cast< T* >( this ) );
|
||||
}
|
||||
|
||||
private:
|
||||
static AutoListType m_autolist;
|
||||
};
|
||||
|
||||
template< class T >
|
||||
CUtlVector< T* > TAutoList< T >::m_autolist;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
@@ -620,15 +579,7 @@ public:
|
||||
private:
|
||||
float m_duration;
|
||||
float m_timestamp;
|
||||
virtual float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime
|
||||
};
|
||||
|
||||
class RealTimeCountdownTimer : public CountdownTimer
|
||||
{
|
||||
virtual float Now( void ) const OVERRIDE
|
||||
{
|
||||
return Plat_FloatTime();
|
||||
}
|
||||
float Now( void ) const; // work-around since client header doesn't like inlined gpGlobals->curtime
|
||||
};
|
||||
|
||||
char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename = NULL );
|
||||
@@ -649,14 +600,5 @@ bool UTIL_IsHolidayActive( /*EHoliday*/ int eHoliday );
|
||||
// holidays overlapping, the list order will act as priority.
|
||||
const char *UTIL_GetActiveHolidayString();
|
||||
|
||||
const char *UTIL_GetRandomSoundFromEntry( const char* pszEntryName );
|
||||
|
||||
/// Clamp and round float vals to int. The values are in the 0...255 range.
|
||||
Color FloatRGBAToColor( float r, float g, float b, float a );
|
||||
float LerpFloat( float x0, float x1, float t );
|
||||
Color LerpColor( const Color &c0, const Color &c1, float t );
|
||||
|
||||
// Global econ-level helper functionality.
|
||||
EUniverse GetUniverse();
|
||||
|
||||
#endif // UTIL_SHARED_H
|
||||
|
||||
Reference in New Issue
Block a user