mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Modified SDK for GCC 4.2
This commit is contained in:
@ -51,4 +51,4 @@ typedef struct BitmapFont_s
|
||||
} BitmapFont_t;
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -72,6 +72,8 @@ CScratchPadGraph::LineID CScratchPadGraph::AddLine( Vector vColor )
|
||||
{
|
||||
CScratchPadGraph::CLineInfo info;
|
||||
info.m_bFirst = true;
|
||||
info.m_flLastTime = 0.0f;
|
||||
info.m_flLastValue = 0.0f;
|
||||
info.m_vColor = vColor;
|
||||
return m_LineInfos.AddToTail( info );
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "mathlib/compressed_vector.h"
|
||||
#include "appframework/IAppSystem.h"
|
||||
|
||||
|
||||
#define SOUNDEMITTERSYSTEM_INTERFACE_VERSION "VSoundEmitter002"
|
||||
|
||||
#define SOUNDGENDER_MACRO "$gender"
|
||||
@ -68,7 +67,7 @@ const char *VolumeToString( float volume );
|
||||
const char *PitchToString( float pitch );
|
||||
soundlevel_t TextToSoundLevel( const char *key );
|
||||
int TextToChannel( const char *name );
|
||||
|
||||
float RandomInterval( const interval_t &interval );
|
||||
|
||||
enum gender_t
|
||||
{
|
||||
@ -104,7 +103,7 @@ struct sound_interval_t
|
||||
T range;
|
||||
|
||||
interval_t &ToInterval( interval_t &dest ) const { dest.start = start; dest.range = range; return dest; }
|
||||
void FromInterval( const interval_t &from ) { start = from.start; range = from.range; }
|
||||
void FromInterval( const interval_t &from ) { start = (T)from.start; range = (T)from.range; }
|
||||
float Random() const { interval_t temp = { start, range }; return RandomInterval( temp ); }
|
||||
};
|
||||
|
||||
@ -123,7 +122,7 @@ struct CSoundParametersInternal
|
||||
|
||||
void CopyFrom( const CSoundParametersInternal& src );
|
||||
|
||||
bool CSoundParametersInternal::operator == ( const CSoundParametersInternal& other ) const;
|
||||
bool operator == ( const CSoundParametersInternal& other ) const;
|
||||
|
||||
const char *VolumeToString( void ) const;
|
||||
const char *ChannelToString( void ) const;
|
||||
@ -147,8 +146,8 @@ struct CSoundParametersInternal
|
||||
|
||||
void SetChannel( int newChannel ) { channel = newChannel; }
|
||||
void SetVolume( float start, float range = 0.0 ) { volume.start = start; volume.range = range; }
|
||||
void SetPitch( float start, float range = 0.0 ) { pitch.start = start; pitch.range = range; }
|
||||
void SetSoundLevel( float start, float range = 0.0 ) { soundlevel.start = start; soundlevel.range = range; }
|
||||
void SetPitch( float start, float range = 0.0 ) { pitch.start = (uint8)start; pitch.range = (uint8)range; }
|
||||
void SetSoundLevel( float start, float range = 0.0 ) { soundlevel.start = (uint16)start; soundlevel.range = (uint16)range; }
|
||||
void SetDelayMsec( int delay ) { delay_msec = delay; }
|
||||
void SetShouldPreload( bool bShouldPreload ) { m_bShouldPreload = bShouldPreload; }
|
||||
void SetOnlyPlayToOwner( bool b ) { play_to_owner_only = b; }
|
||||
|
@ -61,13 +61,13 @@ public:
|
||||
m_pszRepositoryFileName( repositoryFileName ),
|
||||
m_nVersion( version ),
|
||||
m_pfnMetaChecksum( checksumfunc ),
|
||||
m_bDirty( false ),
|
||||
m_bInitialized( false ),
|
||||
m_uCurrentMetaChecksum( 0u ),
|
||||
m_fileCheckType( fileCheckType ),
|
||||
m_bNeverCheckDisk( nevercheckdisk ),
|
||||
m_bReadOnly( readonly ),
|
||||
m_bSaveManifest( savemanifest )
|
||||
m_bSaveManifest( savemanifest ),
|
||||
m_bDirty( false ),
|
||||
m_bInitialized( false )
|
||||
{
|
||||
Assert( m_pszRepositoryFileName && m_pszRepositoryFileName[ 0 ] );
|
||||
}
|
||||
|
@ -29,8 +29,10 @@ typedef enum _D3DFORMAT D3DFORMAT;
|
||||
// The various image format types
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// don't bitch that inline functions aren't used!!!!
|
||||
#pragma warning(disable : 4514)
|
||||
#endif
|
||||
|
||||
enum ImageFormat
|
||||
{
|
||||
@ -321,7 +323,7 @@ namespace ImageLoader
|
||||
struct ResampleInfo_t
|
||||
{
|
||||
|
||||
ResampleInfo_t() : m_nFlags(0), m_flAlphaThreshhold(0.4f), m_flAlphaHiFreqThreshhold(0.4f), m_nSrcDepth(1), m_nDestDepth(1)
|
||||
ResampleInfo_t() : m_nSrcDepth(1), m_nDestDepth(1), m_flAlphaThreshhold(0.4f), m_flAlphaHiFreqThreshhold(0.4f), m_nFlags(0)
|
||||
{
|
||||
m_flColorScale[0] = 1.0f, m_flColorScale[1] = 1.0f, m_flColorScale[2] = 1.0f, m_flColorScale[3] = 1.0f;
|
||||
m_flColorGoal[0] = 0.0f, m_flColorGoal[1] = 0.0f, m_flColorGoal[2] = 0.0f, m_flColorGoal[3] = 0.0f;
|
||||
|
102
public/bitvec.h
102
public/bitvec.h
@ -564,8 +564,8 @@ inline CBitVecT<BASE_OPS>::CBitVecT(int numBits)
|
||||
template <class BASE_OPS>
|
||||
inline CBitVecAccessor CBitVecT<BASE_OPS>::operator[](int i)
|
||||
{
|
||||
Assert(i >= 0 && i < GetNumBits());
|
||||
return CBitVecAccessor(Base(), i);
|
||||
Assert(i >= 0 && i < this->GetNumBits());
|
||||
return CBitVecAccessor(this->Base(), i);
|
||||
}
|
||||
|
||||
|
||||
@ -574,8 +574,8 @@ inline CBitVecAccessor CBitVecT<BASE_OPS>::operator[](int i)
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Init( int val )
|
||||
{
|
||||
if ( Base() )
|
||||
memset( Base(), ( val ) ? 0xff : 0, GetNumDWords() * sizeof(int) );
|
||||
if ( CBitVecT<BASE_OPS>::Base() )
|
||||
memset( CBitVecT<BASE_OPS>::Base(), ( val ) ? 0xff : 0, CBitVecT<BASE_OPS>::GetNumDWords() * sizeof(int) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -583,8 +583,8 @@ inline void CBitVecT<BASE_OPS>::Init( int val )
|
||||
template <class BASE_OPS>
|
||||
inline uint32 CBitVecT<BASE_OPS>::Get( uint32 bitNum ) const
|
||||
{
|
||||
Assert( bitNum < (uint32)GetNumBits() );
|
||||
const uint32 *pInt = Base() + BitVec_Int( bitNum );
|
||||
Assert( bitNum < (uint32)this->GetNumBits() );
|
||||
const uint32 *pInt = this->Base() + BitVec_Int( bitNum );
|
||||
return ( *pInt & BitVec_Bit( bitNum ) );
|
||||
}
|
||||
|
||||
@ -593,8 +593,8 @@ inline uint32 CBitVecT<BASE_OPS>::Get( uint32 bitNum ) const
|
||||
template <class BASE_OPS>
|
||||
inline bool CBitVecT<BASE_OPS>::IsBitSet( int bitNum ) const
|
||||
{
|
||||
Assert( bitNum >= 0 && bitNum < GetNumBits() );
|
||||
const uint32 *pInt = Base() + BitVec_Int( bitNum );
|
||||
Assert( bitNum >= 0 && bitNum < this->GetNumBits() );
|
||||
const uint32 *pInt = this->Base() + BitVec_Int( bitNum );
|
||||
return ( ( *pInt & BitVec_Bit( bitNum ) ) != 0 );
|
||||
}
|
||||
|
||||
@ -603,8 +603,8 @@ inline bool CBitVecT<BASE_OPS>::IsBitSet( int bitNum ) const
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Set( int bitNum )
|
||||
{
|
||||
Assert( bitNum >= 0 && bitNum < GetNumBits() );
|
||||
uint32 *pInt = Base() + BitVec_Int( bitNum );
|
||||
Assert( bitNum >= 0 && bitNum < this->GetNumBits() );
|
||||
uint32 *pInt = this->Base() + BitVec_Int( bitNum );
|
||||
*pInt |= BitVec_Bit( bitNum );
|
||||
}
|
||||
|
||||
@ -613,9 +613,9 @@ inline void CBitVecT<BASE_OPS>::Set( int bitNum )
|
||||
template <class BASE_OPS>
|
||||
inline bool CBitVecT<BASE_OPS>::TestAndSet(int bitNum)
|
||||
{
|
||||
Assert( bitNum >= 0 && bitNum < GetNumBits() );
|
||||
Assert( bitNum >= 0 && bitNum < this->GetNumBits() );
|
||||
uint32 bitVecBit = BitVec_Bit( bitNum );
|
||||
uint32 *pInt = Base() + BitVec_Int( bitNum );
|
||||
uint32 *pInt = this->Base() + BitVec_Int( bitNum );
|
||||
bool bResult = ( ( *pInt & bitVecBit) != 0 );
|
||||
*pInt |= bitVecBit;
|
||||
return bResult;
|
||||
@ -626,8 +626,8 @@ inline bool CBitVecT<BASE_OPS>::TestAndSet(int bitNum)
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Clear(int bitNum)
|
||||
{
|
||||
Assert( bitNum >= 0 && bitNum < GetNumBits() );
|
||||
uint32 *pInt = Base() + BitVec_Int( bitNum );
|
||||
Assert( bitNum >= 0 && bitNum < this->GetNumBits() );
|
||||
uint32 *pInt = this->Base() + BitVec_Int( bitNum );
|
||||
*pInt &= ~BitVec_Bit( bitNum );
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ inline void CBitVecT<BASE_OPS>::Clear(int bitNum)
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Set( int bitNum, bool bNewVal )
|
||||
{
|
||||
uint32 *pInt = Base() + BitVec_Int( bitNum );
|
||||
uint32 *pInt = CBitVecT<BASE_OPS>::Base() + BitVec_Int( bitNum );
|
||||
uint32 bitMask = BitVec_Bit( bitNum );
|
||||
if ( bNewVal )
|
||||
{
|
||||
@ -653,7 +653,7 @@ inline void CBitVecT<BASE_OPS>::Set( int bitNum, bool bNewVal )
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Set( uint32 offset, uint32 mask )
|
||||
{
|
||||
uint32 *pInt = Base() + offset;
|
||||
uint32 *pInt = CBitVecT<BASE_OPS>::Base() + offset;
|
||||
*pInt |= mask;
|
||||
}
|
||||
|
||||
@ -662,7 +662,7 @@ inline void CBitVecT<BASE_OPS>::Set( uint32 offset, uint32 mask )
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Clear( uint32 offset, uint32 mask )
|
||||
{
|
||||
uint32 *pInt = Base() + offset;
|
||||
uint32 *pInt = CBitVecT<BASE_OPS>::Base() + offset;
|
||||
*pInt &= ~mask;
|
||||
}
|
||||
|
||||
@ -671,7 +671,7 @@ inline void CBitVecT<BASE_OPS>::Clear( uint32 offset, uint32 mask )
|
||||
template <class BASE_OPS>
|
||||
inline uint32 CBitVecT<BASE_OPS>::Get( uint32 offset, uint32 mask )
|
||||
{
|
||||
uint32 *pInt = Base() + offset;
|
||||
uint32 *pInt = CBitVecT<BASE_OPS>::Base() + offset;
|
||||
return ( *pInt & mask );
|
||||
}
|
||||
|
||||
@ -687,10 +687,10 @@ inline void CBitVecT<BASE_OPS>::And(const CBitVecT &addStr, CBitVecT *out) const
|
||||
ValidateOperand( *out );
|
||||
|
||||
uint32 * pDest = out->Base();
|
||||
const uint32 *pOperand1 = Base();
|
||||
const uint32 *pOperand1 = CBitVecT<BASE_OPS>::Base();
|
||||
const uint32 *pOperand2 = addStr.Base();
|
||||
|
||||
for (int i = GetNumDWords() - 1; i >= 0 ; --i)
|
||||
for (int i = CBitVecT<BASE_OPS>::GetNumDWords() - 1; i >= 0 ; --i)
|
||||
{
|
||||
pDest[i] = pOperand1[i] & pOperand2[i];
|
||||
}
|
||||
@ -708,10 +708,10 @@ inline void CBitVecT<BASE_OPS>::Or(const CBitVecT &orStr, CBitVecT *out) const
|
||||
ValidateOperand( *out );
|
||||
|
||||
uint32 * pDest = out->Base();
|
||||
const uint32 *pOperand1 = Base();
|
||||
const uint32 *pOperand1 = CBitVecT<BASE_OPS>::Base();
|
||||
const uint32 *pOperand2 = orStr.Base();
|
||||
|
||||
for (int i = GetNumDWords() - 1; i >= 0; --i)
|
||||
for (int i = CBitVecT<BASE_OPS>::GetNumDWords() - 1; i >= 0; --i)
|
||||
{
|
||||
pDest[i] = pOperand1[i] | pOperand2[i];
|
||||
}
|
||||
@ -726,10 +726,10 @@ template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Xor(const CBitVecT &xorStr, CBitVecT *out) const
|
||||
{
|
||||
uint32 * pDest = out->Base();
|
||||
const uint32 *pOperand1 = Base();
|
||||
const uint32 *pOperand1 = CBitVecT<BASE_OPS>::Base();
|
||||
const uint32 *pOperand2 = xorStr.Base();
|
||||
|
||||
for (int i = GetNumDWords() - 1; i >= 0; --i)
|
||||
for (int i = CBitVecT<BASE_OPS>::GetNumDWords() - 1; i >= 0; --i)
|
||||
{
|
||||
pDest[i] = pOperand1[i] ^ pOperand2[i];
|
||||
}
|
||||
@ -746,9 +746,9 @@ inline void CBitVecT<BASE_OPS>::Not(CBitVecT *out) const
|
||||
ValidateOperand( *out );
|
||||
|
||||
uint32 * pDest = out->Base();
|
||||
const uint32 *pOperand = Base();
|
||||
const uint32 *pOperand = CBitVecT<BASE_OPS>::Base();
|
||||
|
||||
for (int i = GetNumDWords() - 1; i >= 0; --i)
|
||||
for (int i = CBitVecT<BASE_OPS>::GetNumDWords() - 1; i >= 0; --i)
|
||||
{
|
||||
pDest[i] = ~(pOperand[i]);
|
||||
}
|
||||
@ -762,12 +762,12 @@ inline void CBitVecT<BASE_OPS>::Not(CBitVecT *out) const
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::CopyTo(CBitVecT *out) const
|
||||
{
|
||||
out->Resize( GetNumBits() );
|
||||
out->Resize( CBitVecT<BASE_OPS>::GetNumBits() );
|
||||
|
||||
ValidateOperand( *out );
|
||||
Assert( out != this );
|
||||
|
||||
memcpy( out->Base(), Base(), GetNumDWords() * sizeof( int ) );
|
||||
memcpy( out->Base(), CBitVecT<BASE_OPS>::Base(), CBitVecT<BASE_OPS>::GetNumDWords() * sizeof( int ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -781,11 +781,11 @@ inline bool CBitVecT<BASE_OPS>::IsAllClear(void) const
|
||||
// Number of available bits may be more than the number
|
||||
// actually used, so make sure to mask out unused bits
|
||||
// before testing for zero
|
||||
(const_cast<CBitVecT *>(this))->Base()[GetNumDWords()-1] &= CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
(const_cast<CBitVecT *>(this))->Base()[CBitVecT<BASE_OPS>::GetNumDWords()-1] &= CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
|
||||
for (int i = GetNumDWords() - 1; i >= 0; --i)
|
||||
for (int i = CBitVecT<BASE_OPS>::GetNumDWords() - 1; i >= 0; --i)
|
||||
{
|
||||
if ( Base()[i] !=0 )
|
||||
if ( CBitVecT<BASE_OPS>::Base()[i] !=0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -804,11 +804,11 @@ inline bool CBitVecT<BASE_OPS>::IsAllSet(void) const
|
||||
// Number of available bits may be more than the number
|
||||
// actually used, so make sure to mask out unused bits
|
||||
// before testing for set bits
|
||||
(const_cast<CBitVecT *>(this))->Base()[GetNumDWords()-1] |= ~CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
(const_cast<CBitVecT *>(this))->Base()[CBitVecT<BASE_OPS>::GetNumDWords()-1] |= ~CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
|
||||
for (int i = GetNumDWords() - 1; i >= 0; --i)
|
||||
for (int i = CBitVecT<BASE_OPS>::GetNumDWords() - 1; i >= 0; --i)
|
||||
{
|
||||
if ( Base()[i] != ~0 )
|
||||
if ( CBitVecT<BASE_OPS>::Base()[i] != ~0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -824,8 +824,8 @@ inline bool CBitVecT<BASE_OPS>::IsAllSet(void) const
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::SetAll(void)
|
||||
{
|
||||
if ( Base() )
|
||||
memset( Base(), 0xff, GetNumDWords() * sizeof(int) );
|
||||
if ( CBitVecT<BASE_OPS>::Base() )
|
||||
memset( CBitVecT<BASE_OPS>::Base(), 0xff, CBitVecT<BASE_OPS>::GetNumDWords() * sizeof(int) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -836,34 +836,34 @@ inline void CBitVecT<BASE_OPS>::SetAll(void)
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::ClearAll(void)
|
||||
{
|
||||
if ( Base() )
|
||||
memset( Base(), 0, GetNumDWords() * sizeof(int) );
|
||||
if ( CBitVecT<BASE_OPS>::Base() )
|
||||
memset( CBitVecT<BASE_OPS>::Base(), 0, CBitVecT<BASE_OPS>::GetNumDWords() * sizeof(int) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::Copy( const CBitVecT<BASE_OPS> &other, int nBits=-1 )
|
||||
inline void CBitVecT<BASE_OPS>::Copy( const CBitVecT<BASE_OPS> &other, int nBits )
|
||||
{
|
||||
if ( nBits == - 1 )
|
||||
{
|
||||
nBits = other.GetNumBits();
|
||||
}
|
||||
|
||||
Resize( nBits );
|
||||
CBitVecT<BASE_OPS>::Resize( nBits );
|
||||
|
||||
ValidateOperand( other );
|
||||
Assert( &other != this );
|
||||
|
||||
memcpy( Base(), other.Base(), GetNumDWords() * sizeof( uint32 ) );
|
||||
memcpy( CBitVecT<BASE_OPS>::Base(), other.Base(), CBitVecT<BASE_OPS>::GetNumDWords() * sizeof( uint32 ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <class BASE_OPS>
|
||||
inline bool CBitVecT<BASE_OPS>::Compare( const CBitVecT<BASE_OPS> &other, int nBits=-1 ) const
|
||||
inline bool CBitVecT<BASE_OPS>::Compare( const CBitVecT<BASE_OPS> &other, int nBits ) const
|
||||
{
|
||||
if ( nBits == - 1 )
|
||||
{
|
||||
if ( other.GetNumBits() != GetNumBits() )
|
||||
if ( other.GetNumBits() != CBitVecT<BASE_OPS>::GetNumBits() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -871,33 +871,33 @@ inline bool CBitVecT<BASE_OPS>::Compare( const CBitVecT<BASE_OPS> &other, int nB
|
||||
nBits = other.GetNumBits();
|
||||
}
|
||||
|
||||
if ( nBits > other.GetNumBits() || nBits > GetNumBits() )
|
||||
if ( nBits > other.GetNumBits() || nBits > CBitVecT<BASE_OPS>::GetNumBits() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
(const_cast<CBitVecT *>(this))->Base()[GetNumDWords()-1] &= CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
(const_cast<CBitVecT *>(&other))->Base()[GetNumDWords()-1] &= other.CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
(const_cast<CBitVecT *>(this))->Base()[CBitVecT<BASE_OPS>::GetNumDWords()-1] &= CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
(const_cast<CBitVecT *>(&other))->Base()[CBitVecT<BASE_OPS>::GetNumDWords()-1] &= other.CBitVecT<BASE_OPS>::GetEndMask(); // external semantics of const retained
|
||||
|
||||
int nBytes = PAD_NUMBER( nBits, 8 ) >> 3;
|
||||
|
||||
return ( memcmp( Base(), other.Base(), nBytes ) == 0 );
|
||||
return ( memcmp( CBitVecT<BASE_OPS>::Base(), other.Base(), nBytes ) == 0 );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <class BASE_OPS>
|
||||
inline uint32 CBitVecT<BASE_OPS>::GetDWord(int i) const
|
||||
{
|
||||
Assert(i >= 0 && i < GetNumDWords());
|
||||
return Base()[i];
|
||||
Assert(i >= 0 && i < CBitVecT<BASE_OPS>::GetNumDWords());
|
||||
return CBitVecT<BASE_OPS>::Base()[i];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <class BASE_OPS>
|
||||
inline void CBitVecT<BASE_OPS>::SetDWord(int i, uint32 val)
|
||||
{
|
||||
Assert(i >= 0 && i < GetNumDWords());
|
||||
Base()[i] = val;
|
||||
Assert(i >= 0 && i < CBitVecT<BASE_OPS>::GetNumDWords());
|
||||
CBitVecT<BASE_OPS>::Base()[i] = val;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -790,7 +790,7 @@ static void CalcZeroframeData( const CStudioHdr *pStudioHdr, const studiohdr_t *
|
||||
else
|
||||
{
|
||||
float s1;
|
||||
int index = fFrame / animdesc.zeroframespan;
|
||||
int index = (int)(fFrame / animdesc.zeroframespan);
|
||||
if (index >= animdesc.zeroframecount - 1)
|
||||
{
|
||||
index = animdesc.zeroframecount - 2;
|
||||
@ -3892,13 +3892,30 @@ void CIKContext::AutoIKRelease( void )
|
||||
{
|
||||
ikcontextikrule_t ikrule;
|
||||
|
||||
ikrule.index = -1;
|
||||
ikrule.chain = pTarget->chain;
|
||||
ikrule.bone = 0;
|
||||
ikrule.type = IK_RELEASE;
|
||||
ikrule.slot = i;
|
||||
ikrule.height = 0.0f;
|
||||
ikrule.radius = 0.0f;
|
||||
ikrule.floor = 0.0f;
|
||||
ikrule.pos = Vector(0.0f, 0.0f, 0.0f);
|
||||
ikrule.q = Quaternion(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
ikrule.start = 0.0f;
|
||||
ikrule.peak = 0.0f;
|
||||
ikrule.tail = 0.0f;
|
||||
ikrule.end = 0.0f;
|
||||
ikrule.top = 0.0f;
|
||||
ikrule.drop = 0.0f;
|
||||
ikrule.commit = 0.0f;
|
||||
ikrule.release = 0.0f;
|
||||
ikrule.flWeight = SimpleSpline( pTarget->error.ramp );
|
||||
ikrule.flRuleWeight = 1.0;
|
||||
ikrule.latched = dt < 0.25 ? 0.0 : ikrule.flWeight;
|
||||
ikrule.szLabel = NULL;
|
||||
ikrule.kneeDir = Vector(0.0f, 0.0f, 0.0f);
|
||||
ikrule.kneePos = Vector(0.0f, 0.0f, 0.0f);
|
||||
|
||||
// don't bother with AutoIKRelease if the bone isn't going to be calculated
|
||||
// this code is crashing for some unknown reason.
|
||||
@ -5017,9 +5034,9 @@ float Studio_GetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, flo
|
||||
return ctlValue * (PoseParam.end - PoseParam.start) + PoseParam.start;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable : 4701)
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -5112,8 +5129,9 @@ static int ClipRayToHitbox( const Ray_t &ray, mstudiobbox_t *pbox, matrix3x4_t&
|
||||
return hitside;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (default : 4701)
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -5312,7 +5330,7 @@ int Studio_MaxFrame( const CStudioHdr *pStudioHdr, int iSequence, const float po
|
||||
|
||||
|
||||
// FIXME: why does the weights sometimes not exactly add it 1.0 and this sometimes rounds down?
|
||||
return (maxFrame + 0.01);
|
||||
return static_cast<int>(maxFrame + 0.01);
|
||||
}
|
||||
|
||||
|
||||
@ -5779,4 +5797,4 @@ bool Studio_PrefetchSequence( const CStudioHdr *pStudioHdr, int iSequence )
|
||||
|
||||
// Everything for this sequence is resident?
|
||||
return !pendingload;
|
||||
}
|
||||
}
|
||||
|
@ -791,7 +791,9 @@ struct dfaceid_t
|
||||
#if defined( _X360 )
|
||||
#pragma bitfield_order( push, lsb_to_msb )
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable:4201 ) // C4201: nonstandard extension used: nameless struct/union
|
||||
#endif
|
||||
struct dleaf_version_0_t
|
||||
{
|
||||
DECLARE_BYTESWAP_DATADESC();
|
||||
@ -845,7 +847,9 @@ struct dleaf_t
|
||||
// Precaculated light info for entities.
|
||||
// CompressedLightCube m_AmbientLighting;
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( default:4201 ) // C4201: nonstandard extension used: nameless struct/union
|
||||
#endif
|
||||
#if defined( _X360 )
|
||||
#pragma bitfield_order( pop )
|
||||
#endif
|
||||
@ -1028,7 +1032,7 @@ public:
|
||||
|
||||
inline void doverlay_t::SetFaceCount( unsigned short count )
|
||||
{
|
||||
Assert( count >= 0 && (count & OVERLAY_RENDER_ORDER_MASK) == 0 );
|
||||
Assert( (count & OVERLAY_RENDER_ORDER_MASK) == 0 );
|
||||
m_nFaceCountAndRenderOrder &= OVERLAY_RENDER_ORDER_MASK;
|
||||
m_nFaceCountAndRenderOrder |= (count & ~OVERLAY_RENDER_ORDER_MASK);
|
||||
}
|
||||
@ -1040,7 +1044,7 @@ inline unsigned short doverlay_t::GetFaceCount() const
|
||||
|
||||
inline void doverlay_t::SetRenderOrder( unsigned short order )
|
||||
{
|
||||
Assert( order >= 0 && order < OVERLAY_NUM_RENDER_ORDERS );
|
||||
Assert( order < OVERLAY_NUM_RENDER_ORDERS );
|
||||
m_nFaceCountAndRenderOrder &= ~OVERLAY_RENDER_ORDER_MASK;
|
||||
m_nFaceCountAndRenderOrder |= (order << (16 - OVERLAY_RENDER_ORDER_NUM_BITS)); // leave 2 bits for render order.
|
||||
}
|
||||
@ -1092,7 +1096,7 @@ public:
|
||||
|
||||
inline void dwateroverlay_t::SetFaceCount( unsigned short count )
|
||||
{
|
||||
Assert( count >= 0 && (count & WATEROVERLAY_RENDER_ORDER_MASK) == 0 );
|
||||
Assert( (count & WATEROVERLAY_RENDER_ORDER_MASK) == 0 );
|
||||
m_nFaceCountAndRenderOrder &= WATEROVERLAY_RENDER_ORDER_MASK;
|
||||
m_nFaceCountAndRenderOrder |= (count & ~WATEROVERLAY_RENDER_ORDER_MASK);
|
||||
}
|
||||
@ -1104,7 +1108,7 @@ inline unsigned short dwateroverlay_t::GetFaceCount() const
|
||||
|
||||
inline void dwateroverlay_t::SetRenderOrder( unsigned short order )
|
||||
{
|
||||
Assert( order >= 0 && order < WATEROVERLAY_NUM_RENDER_ORDERS );
|
||||
Assert( order < WATEROVERLAY_NUM_RENDER_ORDERS );
|
||||
m_nFaceCountAndRenderOrder &= ~WATEROVERLAY_RENDER_ORDER_MASK;
|
||||
m_nFaceCountAndRenderOrder |= ( order << ( 16 - WATEROVERLAY_RENDER_ORDER_NUM_BITS ) ); // leave 2 bits for render order.
|
||||
}
|
||||
|
@ -1917,9 +1917,9 @@ QuadBarycentricRetval_t PointInQuadToBarycentric( const Vector &v1, const Vector
|
||||
// NOTE: axisU[0][projAxes[0]] < axisU[0][projAxes[1]],
|
||||
// this is done to decrease error when dividing later
|
||||
//
|
||||
if( FloatMakePositive( axisU[0][projAxes[0]] ) < FloatMakePositive( axisU[0][projAxes[1]] ) )
|
||||
if( FloatMakePositive( axisU[0][(int)projAxes[0]] ) < FloatMakePositive( axisU[0][(int)projAxes[1]] ) )
|
||||
{
|
||||
int tmp = projAxes[0];
|
||||
int tmp = (int)projAxes[0];
|
||||
projAxes[0] = projAxes[1];
|
||||
projAxes[1] = tmp;
|
||||
}
|
||||
@ -1948,21 +1948,21 @@ QuadBarycentricRetval_t PointInQuadToBarycentric( const Vector &v1, const Vector
|
||||
double s = 0.0, t = 0.0;
|
||||
double A, negB, C;
|
||||
|
||||
A = ( axisU[0][projAxes[1]] * axisV[0][projAxes[0]] ) -
|
||||
( axisU[0][projAxes[0]] * axisV[0][projAxes[1]] ) -
|
||||
( axisU[1][projAxes[1]] * axisV[0][projAxes[0]] ) +
|
||||
( axisU[1][projAxes[0]] * axisV[0][projAxes[1]] );
|
||||
C = ( v1[projAxes[1]] * axisU[0][projAxes[0]] ) -
|
||||
( point[projAxes[1]] * axisU[0][projAxes[0]] ) -
|
||||
( v1[projAxes[0]] * axisU[0][projAxes[1]] ) +
|
||||
( point[projAxes[0]] * axisU[0][projAxes[1]] );
|
||||
A = ( axisU[0][(int)projAxes[1]] * axisV[0][(int)projAxes[0]] ) -
|
||||
( axisU[0][(int)projAxes[0]] * axisV[0][(int)projAxes[1]] ) -
|
||||
( axisU[1][(int)projAxes[1]] * axisV[0][(int)projAxes[0]] ) +
|
||||
( axisU[1][(int)projAxes[0]] * axisV[0][(int)projAxes[1]] );
|
||||
C = ( v1[(int)projAxes[1]] * axisU[0][(int)projAxes[0]] ) -
|
||||
( point[(int)projAxes[1]] * axisU[0][(int)projAxes[0]] ) -
|
||||
( v1[(int)projAxes[0]] * axisU[0][(int)projAxes[1]] ) +
|
||||
( point[(int)projAxes[0]] * axisU[0][(int)projAxes[1]] );
|
||||
negB = C -
|
||||
( v1[projAxes[1]] * axisU[1][projAxes[0]] ) +
|
||||
( point[projAxes[1]] * axisU[1][projAxes[0]] ) +
|
||||
( v1[projAxes[0]] * axisU[1][projAxes[1]] ) -
|
||||
( point[projAxes[0]] * axisU[1][projAxes[1]] ) +
|
||||
( axisU[0][projAxes[1]] * axisV[0][projAxes[0]] ) -
|
||||
( axisU[0][projAxes[0]] * axisV[0][projAxes[1]] );
|
||||
( v1[(int)projAxes[1]] * axisU[1][(int)projAxes[0]] ) +
|
||||
( point[(int)projAxes[1]] * axisU[1][(int)projAxes[0]] ) +
|
||||
( v1[(int)projAxes[0]] * axisU[1][(int)projAxes[1]] ) -
|
||||
( point[(int)projAxes[0]] * axisU[1][(int)projAxes[1]] ) +
|
||||
( axisU[0][(int)projAxes[1]] * axisV[0][(int)projAxes[0]] ) -
|
||||
( axisU[0][(int)projAxes[0]] * axisV[0][(int)projAxes[1]] );
|
||||
|
||||
if( ( A > -PIQ_PLANE_EPSILON ) && ( A < PIQ_PLANE_EPSILON ) )
|
||||
{
|
||||
@ -2008,7 +2008,7 @@ QuadBarycentricRetval_t PointInQuadToBarycentric( const Vector &v1, const Vector
|
||||
double QPlus = ( negB + quad ) / ( 2.0f * A );
|
||||
double QMinus = ( negB - quad ) / ( 2.0f * A );
|
||||
|
||||
ResolveQuadratic( QPlus, QMinus, axisU[0], axisU[1], axisV[0], axisV[1], v1, point, projAxes[0], s, t );
|
||||
ResolveQuadratic( QPlus, QMinus, axisU[0], axisU[1], axisV[0], axisV[1], v1, point, (int)projAxes[0], s, t );
|
||||
}
|
||||
|
||||
if( !bFlipped )
|
||||
@ -3250,4 +3250,4 @@ bool RayHasFullyContainedIntersectionWithQuad( const Ray_t &ray,
|
||||
return true; //there were lines crossing the quad plane, and every line crossing that plane had its intersection with the plane within the quad's boundaries
|
||||
}
|
||||
|
||||
#endif // !_STATIC_LINKED || _SHARED_LIB
|
||||
#endif // !_STATIC_LINKED || _SHARED_LIB
|
||||
|
@ -447,4 +447,4 @@ inline bool IsBoxIntersectingBoxExtents( const fltx4 boxCenter1, const fltx4 box
|
||||
#endif
|
||||
|
||||
|
||||
#endif // COLLISIONUTILS_H
|
||||
#endif // COLLISIONUTILS_H
|
||||
|
@ -95,4 +95,4 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // COORDSIZE_H
|
||||
#endif // COORDSIZE_H
|
||||
|
@ -347,6 +347,8 @@ public:
|
||||
case DC_REMOVED:
|
||||
Assert ( 0 );
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -120,17 +120,19 @@ DECLARE_FIELD_SIZE( FIELD_MODELINDEX, sizeof(int) )
|
||||
DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, sizeof(int) )
|
||||
|
||||
|
||||
#if !defined(offsetof) || defined(_LINUX)
|
||||
#ifndef offsetof
|
||||
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
||||
#endif
|
||||
|
||||
#define ARRAYSIZE2D(p) (sizeof(p)/sizeof(p[0][0]))
|
||||
#define SIZE_OF_ARRAY(p) _ARRAYSIZE(p)
|
||||
|
||||
#define _FIELD(name,fieldtype,count,flags,mapname,tolerance) { fieldtype, #name, { offsetof(classNameTypedef, name), 0 }, count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, tolerance }
|
||||
#define _FIELD(name, fieldtype, count, flags, mapname, tolerance) { fieldtype, #name, { offsetof(classNameTypedef, name), 0 }, count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ), NULL, 0, tolerance }
|
||||
#define _FIELD_NETARRAY(array, i, fieldtype, count, flags, mapname, tolerance) { fieldtype, #array "[" #i "]", { offsetof(classNameTypedef, array) + offsetof(classNameTypedef::NetworkVar_##array, m_Value[i]), 0 }, count, flags, mapname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->array ), NULL, 0, tolerance }
|
||||
#define DEFINE_FIELD_NULL { FIELD_VOID,0, {0,0},0,0,0,0,0,0}
|
||||
#define DEFINE_FIELD(name,fieldtype) _FIELD(name, fieldtype, 1, FTYPEDESC_SAVE, NULL, 0 )
|
||||
#define DEFINE_KEYFIELD(name,fieldtype, mapname) _FIELD(name, fieldtype, 1, FTYPEDESC_KEY | FTYPEDESC_SAVE, mapname, 0 )
|
||||
#define DEFINE_KEYFIELD_NETARRAY(array, i, fieldtype, mapname) _FIELD_NETARRAY(array, i, fieldtype, 1, FTYPEDESC_KEY | FTYPEDESC_SAVE, mapname, 0 )
|
||||
#define DEFINE_KEYFIELD_NOT_SAVED(name,fieldtype, mapname)_FIELD(name, fieldtype, 1, FTYPEDESC_KEY, mapname, 0 )
|
||||
#define DEFINE_AUTO_ARRAY(name,fieldtype) _FIELD(name, fieldtype, SIZE_OF_ARRAY(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, NULL, 0 )
|
||||
#define DEFINE_AUTO_ARRAY_KEYFIELD(name,fieldtype,mapname) _FIELD(name, fieldtype, SIZE_OF_ARRAY(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, mapname, 0 )
|
||||
@ -189,7 +191,7 @@ DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, sizeof(int) )
|
||||
|
||||
// INPUTS
|
||||
#define DEFINE_INPUT( name, fieldtype, inputname ) { fieldtype, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_INPUT | FTYPEDESC_SAVE | FTYPEDESC_KEY, inputname, NULL, NULL, NULL, sizeof( ((classNameTypedef *)0)->name ) }
|
||||
#define DEFINE_INPUTFUNC( fieldtype, inputname, inputfunc ) { fieldtype, #inputfunc, { NULL, NULL }, 1, FTYPEDESC_INPUT, inputname, NULL, static_cast <inputfunc_t> (&classNameTypedef::inputfunc) }
|
||||
#define DEFINE_INPUTFUNC( fieldtype, inputname, inputfunc ) { fieldtype, #inputfunc, { 0, 0 }, 1, FTYPEDESC_INPUT, inputname, NULL, static_cast <inputfunc_t> (&classNameTypedef::inputfunc) }
|
||||
|
||||
// OUTPUTS
|
||||
// the variable 'name' MUST BE derived from CBaseOutput
|
||||
@ -199,7 +201,7 @@ extern ISaveRestoreOps *eventFuncs;
|
||||
#define DEFINE_OUTPUT( name, outputname ) { FIELD_CUSTOM, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_OUTPUT | FTYPEDESC_SAVE | FTYPEDESC_KEY, outputname, eventFuncs }
|
||||
|
||||
// replaces EXPORT table for portability and non-DLL based systems (xbox)
|
||||
#define DEFINE_FUNCTION_RAW( function, func_type ) { FIELD_VOID, nameHolder.GenerateName(#function), { NULL, NULL }, 1, FTYPEDESC_FUNCTIONTABLE, NULL, NULL, (inputfunc_t)((func_type)(&classNameTypedef::function)) }
|
||||
#define DEFINE_FUNCTION_RAW( function, func_type ) { FIELD_VOID, nameHolder.GenerateName(#function), { 0, 0 }, 1, FTYPEDESC_FUNCTIONTABLE, NULL, NULL, (inputfunc_t)((func_type)(&classNameTypedef::function)) }
|
||||
#define DEFINE_FUNCTION( function ) DEFINE_FUNCTION_RAW( function, inputfunc_t )
|
||||
|
||||
|
||||
|
@ -246,4 +246,4 @@ inline void CDispCollTree::GetBounds( Vector& boundMin, Vector& boundMax )
|
||||
}
|
||||
|
||||
|
||||
#endif // DISPCOLL_H
|
||||
#endif // DISPCOLL_H
|
||||
|
@ -81,4 +81,4 @@ struct dlight_t
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -69,4 +69,4 @@ void* DMXAlloc( size_t size );
|
||||
inline void operator delete( void* p ) { } \
|
||||
inline void operator delete( void* p, int nBlockUse, const char *pFileName, int nLine ) { } \
|
||||
|
||||
#endif // DMXLOADER_H
|
||||
#endif // DMXLOADER_H
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#if !defined(_STATIC_LINKED) || defined(CLIENT_DLL)
|
||||
|
||||
char *s_ClientElementNames[MAX_ARRAY_ELEMENTS] =
|
||||
const char *s_ClientElementNames[MAX_ARRAY_ELEMENTS] =
|
||||
{
|
||||
"000", "001", "002", "003", "004", "005", "006", "007", "008", "009",
|
||||
"010", "011", "012", "013", "014", "015", "016", "017", "018", "019",
|
||||
@ -162,7 +162,7 @@ RecvTable::RecvTable()
|
||||
Construct( NULL, 0, NULL );
|
||||
}
|
||||
|
||||
RecvTable::RecvTable(RecvProp *pProps, int nProps, char *pNetTableName)
|
||||
RecvTable::RecvTable(RecvProp *pProps, int nProps, const char *pNetTableName)
|
||||
{
|
||||
Construct( pProps, nProps, pNetTableName );
|
||||
}
|
||||
@ -171,7 +171,7 @@ RecvTable::~RecvTable()
|
||||
{
|
||||
}
|
||||
|
||||
void RecvTable::Construct( RecvProp *pProps, int nProps, char *pNetTableName )
|
||||
void RecvTable::Construct( RecvProp *pProps, int nProps, const char *pNetTableName )
|
||||
{
|
||||
m_pProps = pProps;
|
||||
m_nProps = nProps;
|
||||
@ -187,7 +187,7 @@ void RecvTable::Construct( RecvProp *pProps, int nProps, char *pNetTableName )
|
||||
// ---------------------------------------------------------------------- //
|
||||
|
||||
RecvProp RecvPropFloat(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int flags,
|
||||
@ -213,7 +213,7 @@ RecvProp RecvPropFloat(
|
||||
}
|
||||
|
||||
RecvProp RecvPropVector(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int flags,
|
||||
@ -241,7 +241,7 @@ RecvProp RecvPropVector(
|
||||
#if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!!
|
||||
|
||||
RecvProp RecvPropQuaternion(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar, // Handled by RECVINFO macro, but set to SIZEOF_IGNORE if you don't want to bother.
|
||||
int flags,
|
||||
@ -268,7 +268,7 @@ RecvProp RecvPropQuaternion(
|
||||
#endif
|
||||
|
||||
RecvProp RecvPropInt(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int flags,
|
||||
@ -309,7 +309,7 @@ RecvProp RecvPropInt(
|
||||
}
|
||||
|
||||
RecvProp RecvPropString(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int bufferSize,
|
||||
int flags,
|
||||
@ -329,7 +329,7 @@ RecvProp RecvPropString(
|
||||
}
|
||||
|
||||
RecvProp RecvPropDataTable(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int flags,
|
||||
RecvTable *pTable,
|
||||
@ -349,7 +349,7 @@ RecvProp RecvPropDataTable(
|
||||
}
|
||||
|
||||
RecvProp RecvPropArray3(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int elements,
|
||||
@ -388,7 +388,7 @@ RecvProp RecvPropArray3(
|
||||
RecvProp InternalRecvPropArray(
|
||||
const int elementCount,
|
||||
const int elementStride,
|
||||
char *pName,
|
||||
const char *pName,
|
||||
ArrayLengthRecvProxyFn proxy
|
||||
)
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
char *m_pVarName;
|
||||
const char *m_pVarName;
|
||||
SendPropType m_RecvType;
|
||||
int m_Flags;
|
||||
int m_StringBufferSize;
|
||||
@ -173,10 +173,10 @@ public:
|
||||
typedef RecvProp PropType;
|
||||
|
||||
RecvTable();
|
||||
RecvTable( RecvProp *pProps, int nProps, char *pNetTableName );
|
||||
RecvTable( RecvProp *pProps, int nProps, const char *pNetTableName );
|
||||
~RecvTable();
|
||||
|
||||
void Construct( RecvProp *pProps, int nProps, char *pNetTableName );
|
||||
void Construct( RecvProp *pProps, int nProps, const char *pNetTableName );
|
||||
|
||||
int GetNumProps();
|
||||
RecvProp* GetProp( int i );
|
||||
@ -202,7 +202,7 @@ public:
|
||||
// will have their own decoders that include props for all their children).
|
||||
CRecvDecoder *m_pDecoder;
|
||||
|
||||
char *m_pNetTableName; // The name matched between client and server.
|
||||
const char *m_pNetTableName; // The name matched between client and server.
|
||||
|
||||
|
||||
private:
|
||||
@ -269,7 +269,7 @@ inline bool RecvTable::IsInMainList() const
|
||||
template <> int ClientClassInit<tableName::ignored>(tableName::ignored *) \
|
||||
{ \
|
||||
typedef className currentRecvDTClass; \
|
||||
char *pRecvTableName = #tableName; \
|
||||
const char *pRecvTableName = #tableName; \
|
||||
RecvTable &RecvTable = tableName::g_RecvTable; \
|
||||
static RecvProp RecvProps[] = { \
|
||||
RecvPropInt("should_never_see_this", 0, sizeof(int)), // It adds a dummy property at the start so you can define "empty" SendTables.
|
||||
@ -309,7 +309,7 @@ void DataTableRecvProxy_PointerDataTable(const RecvProp *pProp, void **pOut, voi
|
||||
|
||||
|
||||
RecvProp RecvPropFloat(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE, // Handled by RECVINFO macro, but set to SIZEOF_IGNORE if you don't want to bother.
|
||||
int flags=0,
|
||||
@ -317,7 +317,7 @@ RecvProp RecvPropFloat(
|
||||
);
|
||||
|
||||
RecvProp RecvPropVector(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE, // Handled by RECVINFO macro, but set to SIZEOF_IGNORE if you don't want to bother.
|
||||
int flags=0,
|
||||
@ -330,7 +330,7 @@ RecvProp RecvPropVector(
|
||||
#if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!!
|
||||
|
||||
RecvProp RecvPropQuaternion(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE, // Handled by RECVINFO macro, but set to SIZEOF_IGNORE if you don't want to bother.
|
||||
int flags=0,
|
||||
@ -339,7 +339,7 @@ RecvProp RecvPropQuaternion(
|
||||
#endif
|
||||
|
||||
RecvProp RecvPropInt(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE, // Handled by RECVINFO macro, but set to SIZEOF_IGNORE if you don't want to bother.
|
||||
int flags=0,
|
||||
@ -347,7 +347,7 @@ RecvProp RecvPropInt(
|
||||
);
|
||||
|
||||
RecvProp RecvPropString(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int bufferSize,
|
||||
int flags=0,
|
||||
@ -355,7 +355,7 @@ RecvProp RecvPropString(
|
||||
);
|
||||
|
||||
RecvProp RecvPropDataTable(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int flags,
|
||||
RecvTable *pTable,
|
||||
@ -363,7 +363,7 @@ RecvProp RecvPropDataTable(
|
||||
);
|
||||
|
||||
RecvProp RecvPropArray3(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int elements,
|
||||
@ -377,7 +377,7 @@ RecvProp RecvPropArray3(
|
||||
RecvProp InternalRecvPropArray(
|
||||
const int elementCount,
|
||||
const int elementStride,
|
||||
char *pName,
|
||||
const char *pName,
|
||||
ArrayLengthRecvProxyFn proxy
|
||||
);
|
||||
|
||||
|
@ -26,7 +26,7 @@ void SendProxy_UInt8ToInt32( const SendProp *pProp, const void *pStruct, const v
|
||||
void SendProxy_UInt16ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID);
|
||||
void SendProxy_UInt32ToInt32( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID);
|
||||
|
||||
char *s_ElementNames[MAX_ARRAY_ELEMENTS] =
|
||||
const char *s_ElementNames[MAX_ARRAY_ELEMENTS] =
|
||||
{
|
||||
"000", "001", "002", "003", "004", "005", "006", "007", "008", "009",
|
||||
"010", "011", "012", "013", "014", "015", "016", "017", "018", "019",
|
||||
@ -303,7 +303,7 @@ float AssignRangeMultiplier( int nBits, double range )
|
||||
// Squeeze it down smaller and smaller until it's going to produce an integer
|
||||
// in the valid range when given the highest value.
|
||||
float multipliers[] = { 0.9999, 0.99, 0.9, 0.8, 0.7 };
|
||||
int i;
|
||||
size_t i;
|
||||
for ( i=0; i < ARRAYSIZE( multipliers ); i++ )
|
||||
{
|
||||
float fHighLowMul = (float)( iHighValue / range ) * multipliers[i];
|
||||
@ -331,7 +331,7 @@ float AssignRangeMultiplier( int nBits, double range )
|
||||
|
||||
|
||||
SendProp SendPropFloat(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
// Variable name.
|
||||
int offset, // Offset into container structure.
|
||||
int sizeofVar,
|
||||
@ -382,7 +382,7 @@ SendProp SendPropFloat(
|
||||
}
|
||||
|
||||
SendProp SendPropVector(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits, // Number of bits to use when encoding.
|
||||
@ -419,7 +419,7 @@ SendProp SendPropVector(
|
||||
|
||||
#if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!!
|
||||
SendProp SendPropQuaternion(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits, // Number of bits to use when encoding.
|
||||
@ -456,7 +456,7 @@ SendProp SendPropQuaternion(
|
||||
#endif
|
||||
|
||||
SendProp SendPropAngle(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits,
|
||||
@ -489,7 +489,7 @@ SendProp SendPropAngle(
|
||||
|
||||
|
||||
SendProp SendPropQAngles(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits,
|
||||
@ -522,7 +522,7 @@ SendProp SendPropQAngles(
|
||||
}
|
||||
|
||||
SendProp SendPropInt(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits,
|
||||
@ -586,7 +586,7 @@ SendProp SendPropInt(
|
||||
}
|
||||
|
||||
SendProp SendPropString(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int bufferLen,
|
||||
int flags,
|
||||
@ -606,7 +606,7 @@ SendProp SendPropString(
|
||||
}
|
||||
|
||||
SendProp SendPropArray3(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int elements,
|
||||
@ -653,7 +653,7 @@ SendProp SendPropArray3(
|
||||
}
|
||||
|
||||
SendProp SendPropDataTable(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
SendTable *pTable,
|
||||
SendTableProxyFn varProxy
|
||||
@ -685,7 +685,7 @@ SendProp SendPropDataTable(
|
||||
SendProp InternalSendPropArray(
|
||||
const int elementCount,
|
||||
const int elementStride,
|
||||
char *pName,
|
||||
const char *pName,
|
||||
ArrayLengthSendProxyFn arrayLengthFn
|
||||
)
|
||||
{
|
||||
@ -705,8 +705,8 @@ SendProp InternalSendPropArray(
|
||||
|
||||
|
||||
SendProp SendPropExclude(
|
||||
char *pDataTableName, // Data table name (given to BEGIN_SEND_TABLE and BEGIN_RECV_TABLE).
|
||||
char *pPropName // Name of the property to exclude.
|
||||
const char *pDataTableName, // Data table name (given to BEGIN_SEND_TABLE and BEGIN_RECV_TABLE).
|
||||
const char *pPropName // Name of the property to exclude.
|
||||
)
|
||||
{
|
||||
SendProp ret;
|
||||
@ -772,7 +772,7 @@ SendTable::SendTable()
|
||||
}
|
||||
|
||||
|
||||
SendTable::SendTable(SendProp *pProps, int nProps, char *pNetTableName)
|
||||
SendTable::SendTable(SendProp *pProps, int nProps, const char *pNetTableName)
|
||||
{
|
||||
Construct( pProps, nProps, pNetTableName );
|
||||
}
|
||||
@ -784,7 +784,7 @@ SendTable::~SendTable()
|
||||
}
|
||||
|
||||
|
||||
void SendTable::Construct( SendProp *pProps, int nProps, char *pNetTableName )
|
||||
void SendTable::Construct( SendProp *pProps, int nProps, const char *pNetTableName )
|
||||
{
|
||||
m_pProps = pProps;
|
||||
m_nProps = nProps;
|
||||
|
@ -203,7 +203,7 @@ public:
|
||||
// If it's one of the numbered "000", "001", etc properties in an array, then
|
||||
// these can be used to get its array property name for debugging.
|
||||
const char* GetParentArrayPropName();
|
||||
void SetParentArrayPropName( char *pArrayPropName );
|
||||
void SetParentArrayPropName( const char *pArrayPropName );
|
||||
|
||||
const char* GetName() const;
|
||||
|
||||
@ -257,11 +257,11 @@ public:
|
||||
|
||||
union
|
||||
{
|
||||
char *m_pExcludeDTName; // If this is an exclude prop, then this is the name of the datatable to exclude a prop from.
|
||||
char *m_pParentArrayPropName;
|
||||
const char *m_pExcludeDTName; // If this is an exclude prop, then this is the name of the datatable to exclude a prop from.
|
||||
const char *m_pParentArrayPropName;
|
||||
};
|
||||
|
||||
char *m_pVarName;
|
||||
const char *m_pVarName;
|
||||
float m_fHighLowMul;
|
||||
|
||||
private:
|
||||
@ -334,7 +334,7 @@ inline const char* SendProp::GetParentArrayPropName()
|
||||
return m_pParentArrayPropName;
|
||||
}
|
||||
|
||||
inline void SendProp::SetParentArrayPropName( char *pArrayPropName )
|
||||
inline void SendProp::SetParentArrayPropName( const char *pArrayPropName )
|
||||
{
|
||||
Assert( !m_pParentArrayPropName );
|
||||
m_pParentArrayPropName = pArrayPropName;
|
||||
@ -440,10 +440,10 @@ public:
|
||||
typedef SendProp PropType;
|
||||
|
||||
SendTable();
|
||||
SendTable( SendProp *pProps, int nProps, char *pNetTableName );
|
||||
SendTable( SendProp *pProps, int nProps, const char *pNetTableName );
|
||||
~SendTable();
|
||||
|
||||
void Construct( SendProp *pProps, int nProps, char *pNetTableName );
|
||||
void Construct( SendProp *pProps, int nProps, const char *pNetTableName );
|
||||
|
||||
const char* GetName() const;
|
||||
|
||||
@ -466,7 +466,7 @@ public:
|
||||
SendProp *m_pProps;
|
||||
int m_nProps;
|
||||
|
||||
char *m_pNetTableName; // The name matched between client and server.
|
||||
const char *m_pNetTableName; // The name matched between client and server.
|
||||
|
||||
// The engine hooks the SendTable here.
|
||||
CSendTablePrecalc *m_pPrecalc;
|
||||
@ -563,7 +563,7 @@ inline void SendTable::SetHasPropsEncodedAgainstTickcount( bool bState )
|
||||
template <> int ServerClassInit<tableName::ignored>(tableName::ignored *) \
|
||||
{ \
|
||||
typedef className currentSendDTClass; \
|
||||
static char *g_pSendTableName = #tableName; \
|
||||
static const char *g_pSendTableName = #tableName; \
|
||||
SendTable &sendTable = tableName::g_SendTable; \
|
||||
static SendProp g_SendProps[] = { \
|
||||
SendPropInt("should_never_see_this", 0, sizeof(int)), // It adds a dummy property at the start so you can define "empty" SendTables.
|
||||
@ -582,6 +582,7 @@ inline void SendTable::SetHasPropsEncodedAgainstTickcount( bool bState )
|
||||
#define SENDINFO_ARRAY(varName) #varName, offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName), sizeof(((currentSendDTClass*)0)->varName[0])
|
||||
#define SENDINFO_ARRAY3(varName) #varName, offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName), sizeof(((currentSendDTClass*)0)->varName[0]), sizeof(((currentSendDTClass*)0)->varName)/sizeof(((currentSendDTClass*)0)->varName[0])
|
||||
#define SENDINFO_ARRAYELEM(varName, i) #varName "[" #i "]", offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName[i]), sizeof(((currentSendDTClass*)0)->varName[0])
|
||||
#define SENDINFO_ARRAYELEM2(varName, i) #varName "[" #i "]", offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName) + offsetof(currentSendDTClass::MakeANetworkVar_##varName::NetworkVar_##varName, m_Value[i]), sizeof(((currentSendDTClass*)0)->varName[0])
|
||||
#define SENDINFO_NETWORKARRAYELEM(varName, i)#varName "[" #i "]", offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName.m_Value[i]), sizeof(((currentSendDTClass*)0)->varName.m_Value[0])
|
||||
|
||||
// NOTE: Be VERY careful to specify any other vector elems for the same vector IN ORDER and
|
||||
@ -589,12 +590,14 @@ inline void SendTable::SetHasPropsEncodedAgainstTickcount( bool bState )
|
||||
//
|
||||
// Note: this macro specifies a negative offset so the engine can detect it and setup m_pNext
|
||||
#define SENDINFO_VECTORELEM(varName, i) #varName "[" #i "]", -(int)offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName.m_Value[i]), sizeof(((currentSendDTClass*)0)->varName.m_Value[0])
|
||||
#define SENDINFO_VECTORELEM2(varName, i, which) #varName "[" #i "]", -(int)offsetof(currentSendDTClass::MakeANetworkVar_##varName, varName.m_Value.which), sizeof(((currentSendDTClass*)0)->varName.m_Value[0])
|
||||
|
||||
#define SENDINFO_STRUCTELEM(varName) #varName, offsetof(currentSendDTClass, varName), sizeof(((currentSendDTClass*)0)->varName.m_Value)
|
||||
#define SENDINFO_STRUCTARRAYELEM(varName, i)#varName "[" #i "]", offsetof(currentSendDTClass, varName.m_Value[i]), sizeof(((currentSendDTClass*)0)->varName.m_Value[0])
|
||||
|
||||
// Use this when you're not using a CNetworkVar to represent the data you're sending.
|
||||
#define SENDINFO_NOCHECK(varName) #varName, offsetof(currentSendDTClass, varName), sizeof(((currentSendDTClass*)0)->varName)
|
||||
#define SENDINFO_NOCHECK_VECTORELEM(varName, i, which) #varName "[" #i "]", offsetof(currentSendDTClass, varName.which), sizeof(((currentSendDTClass*)0)->varName.which)
|
||||
#define SENDINFO_STRING_NOCHECK(varName) #varName, offsetof(currentSendDTClass, varName)
|
||||
#define SENDINFO_DT(varName) #varName, offsetof(currentSendDTClass, varName)
|
||||
#define SENDINFO_DT_NAME(varName, remoteVarName) #remoteVarName, offsetof(currentSendDTClass, varName)
|
||||
@ -634,7 +637,7 @@ void* SendProxy_SendLocalDataTable( const SendProp *pProp, const void *pStruct,
|
||||
// Use these functions to setup your data tables.
|
||||
// ------------------------------------------------------------------------ //
|
||||
SendProp SendPropFloat(
|
||||
char *pVarName, // Variable name.
|
||||
const char *pVarName, // Variable name.
|
||||
int offset, // Offset into container structure.
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32, // Number of bits to use when encoding.
|
||||
@ -645,7 +648,7 @@ SendProp SendPropFloat(
|
||||
);
|
||||
|
||||
SendProp SendPropVector(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32, // Number of bits (for each floating-point component) to use when encoding.
|
||||
@ -657,7 +660,7 @@ SendProp SendPropVector(
|
||||
|
||||
#if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!!
|
||||
SendProp SendPropQuaternion(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32, // Number of bits (for each floating-point component) to use when encoding.
|
||||
@ -669,7 +672,7 @@ SendProp SendPropQuaternion(
|
||||
#endif
|
||||
|
||||
SendProp SendPropAngle(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32,
|
||||
@ -678,7 +681,7 @@ SendProp SendPropAngle(
|
||||
);
|
||||
|
||||
SendProp SendPropQAngles(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32,
|
||||
@ -687,7 +690,7 @@ SendProp SendPropQAngles(
|
||||
);
|
||||
|
||||
SendProp SendPropInt(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE, // Handled by SENDINFO macro.
|
||||
int nBits=-1, // Set to -1 to automatically pick (max) number of bits based on size of element.
|
||||
@ -697,11 +700,11 @@ SendProp SendPropInt(
|
||||
|
||||
inline SendProp SendPropModelIndex( const char *pVarName, int offset, int sizeofVar=SIZEOF_IGNORE )
|
||||
{
|
||||
return SendPropInt( (char *)pVarName, offset, sizeofVar, SP_MODEL_INDEX_BITS, 0 );
|
||||
return SendPropInt( pVarName, offset, sizeofVar, SP_MODEL_INDEX_BITS, 0 );
|
||||
}
|
||||
|
||||
SendProp SendPropString(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int bufferLen,
|
||||
int flags=0,
|
||||
@ -709,14 +712,14 @@ SendProp SendPropString(
|
||||
|
||||
// The data table encoder looks at DVariant::m_pData.
|
||||
SendProp SendPropDataTable(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
SendTable *pTable,
|
||||
SendTableProxyFn varProxy=SendProxy_DataTableToDataTable
|
||||
);
|
||||
|
||||
SendProp SendPropArray3(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int elements,
|
||||
@ -732,7 +735,7 @@ SendProp SendPropArray3(
|
||||
SendProp InternalSendPropArray(
|
||||
const int elementCount,
|
||||
const int elementStride,
|
||||
char *pName,
|
||||
const char *pName,
|
||||
ArrayLengthSendProxyFn proxy
|
||||
);
|
||||
|
||||
@ -783,8 +786,8 @@ SendProp InternalSendPropArray(
|
||||
// Use these to create properties that exclude other properties. This is useful if you want to use most of
|
||||
// a base class's datatable data, but you want to override some of its variables.
|
||||
SendProp SendPropExclude(
|
||||
char *pDataTableName, // Data table name (given to BEGIN_SEND_TABLE and BEGIN_RECV_TABLE).
|
||||
char *pPropName // Name of the property to exclude.
|
||||
const char *pDataTableName, // Data table name (given to BEGIN_SEND_TABLE and BEGIN_RECV_TABLE).
|
||||
const char *pPropName // Name of the property to exclude.
|
||||
);
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
// Use these functions to setup your data tables.
|
||||
DataTableProp PropFloat(
|
||||
char *pVarName, // Variable name.
|
||||
const char *pVarName, // Variable name.
|
||||
int offset, // Offset into container structure.
|
||||
int sizeofVar,
|
||||
int nBits, // Number of bits to use when encoding.
|
||||
@ -38,7 +38,7 @@ DataTableProp PropFloat(
|
||||
}
|
||||
|
||||
DataTableProp PropVector(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits, // Number of bits (for each floating-point component) to use when encoding.
|
||||
@ -55,7 +55,7 @@ DataTableProp PropVector(
|
||||
}
|
||||
|
||||
DataTableProp PropAngle(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
int nBits,
|
||||
@ -70,7 +70,7 @@ DataTableProp PropAngle(
|
||||
}
|
||||
|
||||
DataTableProp PropInt(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar, // Handled by SENDINFO macro.
|
||||
int nBits, // Set to -1 to automatically pick (max) number of bits based on size of element.
|
||||
@ -86,7 +86,7 @@ DataTableProp PropInt(
|
||||
}
|
||||
|
||||
DataTableProp PropString(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int bufferLen,
|
||||
int flags
|
||||
@ -100,7 +100,7 @@ DataTableProp PropString(
|
||||
}
|
||||
|
||||
DataTableProp PropEHandle(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar )
|
||||
{
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
// Use these functions to setup your data tables.
|
||||
DataTableProp PropFloat(
|
||||
char *pVarName, // Variable name.
|
||||
const char *pVarName, // Variable name.
|
||||
int offset, // Offset into container structure.
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32, // Number of bits to use when encoding.
|
||||
@ -61,7 +61,7 @@ DataTableProp PropFloat(
|
||||
);
|
||||
|
||||
DataTableProp PropVector(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32, // Number of bits (for each floating-point component) to use when encoding.
|
||||
@ -71,7 +71,7 @@ DataTableProp PropVector(
|
||||
);
|
||||
|
||||
DataTableProp PropAngle(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE,
|
||||
int nBits=32,
|
||||
@ -79,7 +79,7 @@ DataTableProp PropAngle(
|
||||
);
|
||||
|
||||
DataTableProp PropInt(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE, // Handled by SENDINFO macro.
|
||||
int nBits=-1, // Set to -1 to automatically pick (max) number of bits based on size of element.
|
||||
@ -88,14 +88,14 @@ DataTableProp PropInt(
|
||||
);
|
||||
|
||||
DataTableProp PropString(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int bufferLen,
|
||||
int flags=0
|
||||
);
|
||||
|
||||
DataTableProp PropEHandle(
|
||||
char *pVarName,
|
||||
const char *pVarName,
|
||||
int offset,
|
||||
int sizeofVar=SIZEOF_IGNORE );
|
||||
|
||||
|
@ -9,9 +9,10 @@
|
||||
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
static CUtlDict<int,int> *g_STDict = 0;
|
||||
static CUtlDict<int,int> *g_RTDict = 0;
|
||||
|
||||
#endif
|
||||
|
||||
char* AllocateStringHelper2( const char *pFormat, va_list marker )
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
|
||||
extern char *s_ClientElementNames[MAX_ARRAY_ELEMENTS];
|
||||
extern const char *s_ClientElementNames[MAX_ARRAY_ELEMENTS];
|
||||
|
||||
|
||||
class CRecvPropExtra_UtlVector
|
||||
@ -78,9 +78,9 @@ void DataTableRecvProxy_LengthProxy( const RecvProp *pProp, void **pOut, void *p
|
||||
|
||||
|
||||
RecvProp RecvPropUtlVector(
|
||||
char *pVarName, // Use RECVINFO_UTLVECTOR to generate these 4.
|
||||
int offset, // Used to generate pData in the function specified in varProxy.
|
||||
int sizeofVar, // The size of each element in the utlvector.
|
||||
const char *pVarName, // Use RECVINFO_UTLVECTOR to generate these 4.
|
||||
int offset, // Used to generate pData in the function specified in varProxy.
|
||||
int sizeofVar, // The size of each element in the utlvector.
|
||||
ResizeUtlVectorFn fn,
|
||||
EnsureCapacityFn ensureFn,
|
||||
int nMaxElements, // Max # of elements in the array. Keep this as low as possible.
|
||||
|
@ -45,7 +45,7 @@
|
||||
// RecvPropUtlVector( RECVINFO_UTLVECTOR( m_FloatArray ), 16, RecvPropFloat(NULL,0,0) )
|
||||
//
|
||||
RecvProp RecvPropUtlVector(
|
||||
char *pVarName, // Use RECVINFO_UTLVECTOR to generate these first 5 parameters.
|
||||
const char *pVarName, // Use RECVINFO_UTLVECTOR to generate these first 5 parameters.
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
ResizeUtlVectorFn fn,
|
||||
@ -57,4 +57,4 @@ RecvProp RecvPropUtlVector(
|
||||
);
|
||||
|
||||
|
||||
#endif // DT_UTLVECTOR_RECV_H
|
||||
#endif // DT_UTLVECTOR_RECV_H
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
|
||||
extern char *s_ElementNames[MAX_ARRAY_ELEMENTS];
|
||||
extern const char *s_ElementNames[MAX_ARRAY_ELEMENTS];
|
||||
|
||||
// This gets associated with SendProps inside a utlvector and stores extra data needed to make it work.
|
||||
class CSendPropExtra_UtlVector
|
||||
@ -124,7 +124,7 @@ void* SendProxy_LengthTable( const SendProp *pProp, const void *pStructBase, con
|
||||
// Note: you have to be DILIGENT about calling NetworkStateChanged whenever an element in your CUtlVector changes
|
||||
// since CUtlVector doesn't do this automatically.
|
||||
SendProp SendPropUtlVector(
|
||||
char *pVarName, // Use SENDINFO_UTLVECTOR to generate these 4.
|
||||
const char *pVarName, // Use SENDINFO_UTLVECTOR to generate these 4.
|
||||
int offset, // Used to generate pData in the function specified in varProxy.
|
||||
int sizeofVar, // The size of each element in the utlvector.
|
||||
EnsureCapacityFn ensureFn, // This is the value returned for elements out of the array's current range.
|
||||
|
@ -43,7 +43,7 @@
|
||||
// )
|
||||
//
|
||||
SendProp SendPropUtlVector(
|
||||
char *pVarName, // Use SENDINFO_UTLVECTOR to generate these first 4 parameters.
|
||||
const char *pVarName, // Use SENDINFO_UTLVECTOR to generate these first 4 parameters.
|
||||
int offset,
|
||||
int sizeofVar,
|
||||
EnsureCapacityFn ensureFn,
|
||||
|
@ -132,4 +132,4 @@ struct virtualterrainparams_t
|
||||
int index;
|
||||
};
|
||||
|
||||
#endif // IVMODELINFO_H
|
||||
#endif // IVMODELINFO_H
|
||||
|
@ -484,7 +484,7 @@ public:
|
||||
virtual bool EndOfFile( FileHandle_t file ) = 0;
|
||||
|
||||
virtual char *ReadLine( char *pOutput, int maxChars, FileHandle_t file ) = 0;
|
||||
virtual int FPrintf( FileHandle_t file, char *pFormat, ... ) = 0;
|
||||
virtual int FPrintf( FileHandle_t file, const char *pFormat, ... ) = 0;
|
||||
|
||||
//--------------------------------------------------------
|
||||
// Dynamic library operations
|
||||
|
@ -142,4 +142,4 @@ public:
|
||||
|
||||
extern IQueuedLoader *g_pQueuedLoader;
|
||||
|
||||
#endif // QUEUEDLOADER_H
|
||||
#endif // QUEUEDLOADER_H
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
#undef PROTECTED_THINGS_ENABLE
|
||||
#undef PROTECT_FILEIO_FUNCTIONS
|
||||
#ifndef _LINUX
|
||||
#undef fopen
|
||||
#endif
|
||||
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#include <windows.h>
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
virtual bool IsOk( FileHandle_t file ) { return m_pFileSystemPassThru->IsOk( file ); }
|
||||
virtual bool EndOfFile( FileHandle_t file ) { return m_pFileSystemPassThru->EndOfFile( file ); }
|
||||
virtual char *ReadLine( char *pOutput, int maxChars, FileHandle_t file ) { return m_pFileSystemPassThru->ReadLine( pOutput, maxChars, file ); }
|
||||
virtual int FPrintf( FileHandle_t file, char *pFormat, ... )
|
||||
virtual int FPrintf( FileHandle_t file, const char *pFormat, ... )
|
||||
{
|
||||
char str[8192];
|
||||
va_list marker;
|
||||
|
@ -38,4 +38,4 @@ public:
|
||||
|
||||
extern IClientRenderTargets * g_pClientRenderTargets;
|
||||
|
||||
#endif // ICLIENTRENDERTARGETS_H
|
||||
#endif // ICLIENTRENDERTARGETS_H
|
||||
|
@ -58,4 +58,4 @@ public:
|
||||
extern IViewPort *gViewPortInterface;
|
||||
|
||||
|
||||
#endif // IVIEWPORT_H
|
||||
#endif // IVIEWPORT_H
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
#include <inetmsghandler.h>
|
||||
#include "tier0/platform.h"
|
||||
#include "userid.h"
|
||||
|
||||
class IServer;
|
||||
class INetMessage;
|
||||
struct USERID_t;
|
||||
|
||||
abstract_class IClient : public INetChannelHandler
|
||||
{
|
||||
|
@ -53,4 +53,4 @@ extern IClientEntityList *entitylist;
|
||||
|
||||
#define VCLIENTENTITYLIST_INTERFACE_VERSION "VClientEntityList003"
|
||||
|
||||
#endif // ICLIENTENTITYLIST_H
|
||||
#endif // ICLIENTENTITYLIST_H
|
||||
|
@ -64,4 +64,4 @@ public:
|
||||
|
||||
extern IVEfx *effects;
|
||||
|
||||
#endif // IEFX_H
|
||||
#endif // IEFX_H
|
||||
|
@ -45,4 +45,4 @@ public:
|
||||
virtual void BroadcastEvent(IGameEvent *event) = 0; // send a director command to all specs
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -55,4 +55,4 @@ public:
|
||||
virtual void ShowTracks(float seconds) = 0; // show player trails for n seconds
|
||||
};
|
||||
|
||||
#endif // IMAPOVERVIEW_H
|
||||
#endif // IMAPOVERVIEW_H
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
|
||||
virtual bool SendNetMsg(INetMessage &msg, bool bForceReliable = false, bool bVoice = false ) = 0;
|
||||
#ifdef _LINUX
|
||||
FORCEINLINE bool SendNetMsg(INetMessage const &msg, bool bForceReliable = false, bool bVoice = false ) { SendNetMsg( *( (INetMessage *) &msg ), bForceReliable, bVoice ); }
|
||||
FORCEINLINE bool SendNetMsg(INetMessage const &msg, bool bForceReliable = false, bool bVoice = false ) { return SendNetMsg( *( (INetMessage *) &msg ), bForceReliable, bVoice ); }
|
||||
#endif
|
||||
virtual bool SendData(bf_write &msg, bool bReliable = true) = 0;
|
||||
virtual bool SendFile(const char *filename, unsigned int transferID) = 0;
|
||||
|
@ -73,4 +73,4 @@ public:
|
||||
virtual float GetTimeoutSeconds() const = 0;
|
||||
};
|
||||
|
||||
#endif // INETCHANNELINFO_H
|
||||
#endif // INETCHANNELINFO_H
|
||||
|
@ -503,4 +503,4 @@ void Interpolator_CurveInterpolate_NonNormalized( int interpolationType,
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,4 +64,4 @@ extern IPrediction *g_pClientSidePrediction;
|
||||
|
||||
#define VCLIENT_PREDICTION_INTERFACE_VERSION "VClientPrediction001"
|
||||
|
||||
#endif // IPREDICTION_H
|
||||
#endif // IPREDICTION_H
|
||||
|
@ -45,4 +45,4 @@ IRegistry *InstanceRegistry( char const *subDirectoryUnderValve );
|
||||
// Calls Shutdown and deletes it
|
||||
void ReleaseInstancedRegistry( IRegistry *reg );
|
||||
|
||||
#endif // UTIL_REGISTRY_H
|
||||
#endif // UTIL_REGISTRY_H
|
||||
|
@ -36,4 +36,4 @@ extern ICenterPrint *centerprint;
|
||||
|
||||
#define VCENTERPRINT_INTERFACE_VERSION "VCENTERPRINT002"
|
||||
|
||||
#endif // IVGUICENTERPRINT_H
|
||||
#endif // IVGUICENTERPRINT_H
|
||||
|
@ -13,7 +13,10 @@
|
||||
#include <string.h>
|
||||
|
||||
typedef unsigned char byte;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
|
||||
#include "tier0/dbg.h"
|
||||
#include "mathlib/vector.h"
|
||||
@ -72,7 +75,7 @@ typedef float (*TimeModifierFunc_t)(float);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *szName;
|
||||
const char *szName;
|
||||
TimeModifierFunc_t pFunc;
|
||||
|
||||
} TimeModifier_t;
|
||||
@ -104,7 +107,7 @@ int Motion_GetNumberOfTimeModifiers( void )
|
||||
return ARRAYSIZE(g_TimeModifiers);
|
||||
}
|
||||
|
||||
bool Motion_GetTimeModifierDetails( int timeInterpNum, char **outName )
|
||||
bool Motion_GetTimeModifierDetails( int timeInterpNum, const char **outName )
|
||||
{
|
||||
if ( timeInterpNum < 0 || timeInterpNum >= Motion_GetNumberOfTimeModifiers() )
|
||||
{
|
||||
@ -154,7 +157,7 @@ class CPositionInterpolator_Linear : public IPositionInterpolator
|
||||
{
|
||||
public:
|
||||
virtual void Release();
|
||||
virtual void GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
virtual void GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
virtual void SetKeyPosition( int keyNum, Vector const &vPos );
|
||||
virtual void InterpolatePosition( float time, Vector &vOut );
|
||||
virtual bool ProcessKey( char const *pName, char const *pValue ) { return false; }
|
||||
@ -171,7 +174,7 @@ void CPositionInterpolator_Linear::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void CPositionInterpolator_Linear::GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
void CPositionInterpolator_Linear::GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
{
|
||||
*outName = "Linear";
|
||||
*outMinKeyReq = 0;
|
||||
@ -201,7 +204,7 @@ class CPositionInterpolator_CatmullRom : public IPositionInterpolator
|
||||
{
|
||||
public:
|
||||
virtual void Release();
|
||||
virtual void GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
virtual void GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
virtual void SetKeyPosition( int keyNum, Vector const &vPos );
|
||||
virtual void InterpolatePosition( float time, Vector &vOut );
|
||||
virtual bool ProcessKey( char const *pName, char const *pValue ) { return false; }
|
||||
@ -218,7 +221,7 @@ void CPositionInterpolator_CatmullRom::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void CPositionInterpolator_CatmullRom::GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
void CPositionInterpolator_CatmullRom::GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
{
|
||||
*outName = "Catmull-Rom Spline";
|
||||
*outMinKeyReq = -1;
|
||||
@ -282,7 +285,7 @@ public:
|
||||
CPositionInterpolator_Rope();
|
||||
|
||||
virtual void Release();
|
||||
virtual void GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
virtual void GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
virtual void SetKeyPosition( int keyNum, Vector const &vPos );
|
||||
virtual void InterpolatePosition( float time, Vector &vOut );
|
||||
virtual bool ProcessKey( char const *pName, char const *pValue );
|
||||
@ -319,7 +322,7 @@ void CPositionInterpolator_Rope::Release()
|
||||
delete this;
|
||||
}
|
||||
|
||||
void CPositionInterpolator_Rope::GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
void CPositionInterpolator_Rope::GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
{
|
||||
*outName = "Rope";
|
||||
*outMinKeyReq = 0;
|
||||
@ -433,7 +436,7 @@ typedef void (*RotationInterpolatorFunc_t)(float time, Quaternion &outRot);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *szName;
|
||||
const char *szName;
|
||||
RotationInterpolatorFunc_t pFunc;
|
||||
|
||||
// defines the range of keys this interpolator needs to function
|
||||
@ -458,7 +461,7 @@ int Motion_GetNumberOfRotationInterpolators( void )
|
||||
return ARRAYSIZE(g_RotationInterpolators);
|
||||
}
|
||||
|
||||
bool Motion_GetRotationInterpolatorDetails( int rotInterpNum, char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
bool Motion_GetRotationInterpolatorDetails( int rotInterpNum, const char **outName, int *outMinKeyReq, int *outMaxKeyReq )
|
||||
{
|
||||
if ( rotInterpNum < 0 || rotInterpNum >= Motion_GetNumberOfRotationInterpolators() )
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ class IPositionInterpolator
|
||||
public:
|
||||
virtual void Release() = 0;
|
||||
|
||||
virtual void GetDetails( char **outName, int *outMinKeyReq, int *outMaxKeyReq ) = 0;
|
||||
virtual void GetDetails( const char **outName, int *outMinKeyReq, int *outMaxKeyReq ) = 0;
|
||||
virtual void SetKeyPosition( int keyNum, Vector const &vPos ) = 0;
|
||||
virtual void InterpolatePosition( float time, Vector &vOut ) = 0;
|
||||
|
||||
@ -25,7 +25,7 @@ public:
|
||||
|
||||
// Time modifiers.
|
||||
int Motion_GetNumberOfTimeModifiers( void );
|
||||
bool Motion_GetTimeModifierDetails( int timeInterpNum, char **outName );
|
||||
bool Motion_GetTimeModifierDetails( int timeInterpNum, const char **outName );
|
||||
bool Motion_CalculateModifiedTime( float time, int timeModifierFuncNum, float *outNewTime );
|
||||
|
||||
// Position interpolators.
|
||||
@ -34,7 +34,7 @@ IPositionInterpolator* Motion_GetPositionInterpolator( int interpNum );
|
||||
|
||||
// Rotation interpolators.
|
||||
int Motion_GetNumberOfRotationInterpolators( void );
|
||||
bool Motion_GetRotationInterpolatorDetails( int rotInterpNum, char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
bool Motion_GetRotationInterpolatorDetails( int rotInterpNum, const char **outName, int *outMinKeyReq, int *outMaxKeyReq );
|
||||
bool Motion_InterpolateRotation( float time, int interpFuncNum, Quaternion &outQuatRotation );
|
||||
bool Motion_SetKeyAngles( int keyNum, Quaternion &quatAngles );
|
||||
|
||||
|
@ -120,4 +120,4 @@ void DeleteCmdLine( int argc, char **argv )
|
||||
delete [] argv[i];
|
||||
}
|
||||
delete [] argv;
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,4 @@ void LoadCmdLineFromFile( int &argc, char **&argv, const char *keyname, const ch
|
||||
//-----------------------------------------------------------------------------
|
||||
void DeleteCmdLine( int argc, char **argv );
|
||||
|
||||
#endif // LOADCMDLINE_H
|
||||
#endif // LOADCMDLINE_H
|
||||
|
@ -70,4 +70,4 @@ public:
|
||||
virtual void GetCurrentColorCorrection( ShaderColorCorrectionInfo_t* pInfo ) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@ class Vector;
|
||||
enum VertexFormatFlags_t
|
||||
{
|
||||
// Indicates an uninitialized VertexFormat_t value
|
||||
VERTEX_FORMAT_INVALID = 0xFFFFFFFFFFFFFFFFL,
|
||||
VERTEX_FORMAT_INVALID = 0xFFFFFFFFFFFFFFFFLL,
|
||||
|
||||
VERTEX_POSITION = 0x0001,
|
||||
VERTEX_NORMAL = 0x0002,
|
||||
|
@ -403,7 +403,7 @@ struct MaterialVideoMode_t
|
||||
// fixme: should move this into something else.
|
||||
struct FlashlightState_t
|
||||
{
|
||||
FlashlightState_t::FlashlightState_t()
|
||||
FlashlightState_t()
|
||||
{
|
||||
m_bEnableShadows = false; // Provide reasonable defaults for shadow depth mapping parameters
|
||||
m_bDrawShadowFrustum = false;
|
||||
|
@ -281,10 +281,10 @@ FORCEINLINE void VectorMAInline( const Vector& start, float scale, const Vector&
|
||||
dest.z=start.z+direction.z*scale;
|
||||
}
|
||||
|
||||
FORCEINLINE void VectorMA( const Vector& start, float scale, const Vector& direction, Vector& dest )
|
||||
{
|
||||
VectorMAInline(start, scale, direction, dest);
|
||||
}
|
||||
//FORCEINLINE void VectorMA( const Vector& start, float scale, const Vector& direction, Vector& dest )
|
||||
//{
|
||||
// VectorMAInline(start, scale, direction, dest);
|
||||
//}
|
||||
|
||||
FORCEINLINE void VectorMA( const float * start, float scale, const float *direction, float *dest )
|
||||
{
|
||||
@ -525,7 +525,7 @@ inline float RemapValClamped( float val, float A, float B, float C, float D)
|
||||
template <class T>
|
||||
FORCEINLINE T Lerp( float flPercent, T const &A, T const &B )
|
||||
{
|
||||
return A + (B - A) * flPercent;
|
||||
return (T)(A + (B - A) * flPercent);
|
||||
}
|
||||
|
||||
FORCEINLINE float Sqr( float f )
|
||||
|
@ -1,73 +1,73 @@
|
||||
//====== Copyright <20> 2007-2007, Valve Corporation, All rights reserved. =======//
|
||||
//
|
||||
// Purpose: Functions for spherical geometry.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef SPHERICAL_GEOMETRY_H
|
||||
#define SPHERICAL_GEOMETRY_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
// see http://mathworld.wolfram.com/SphericalTrigonometry.html
|
||||
|
||||
// return the spherical distance, in radians, between 2 points on the unit sphere.
|
||||
FORCEINLINE float UnitSphereLineSegmentLength( Vector const &a, Vector const &b )
|
||||
{
|
||||
// check unit length
|
||||
Assert( fabs( VectorLength( a ) - 1.0 ) < 1.0e-3 );
|
||||
Assert( fabs( VectorLength( b ) - 1.0 ) < 1.0e-3 );
|
||||
return acos( DotProduct( a, b ) );
|
||||
}
|
||||
|
||||
|
||||
// given 3 points on the unit sphere, return the spherical area (in radians) of the triangle they form.
|
||||
// valid for "small" triangles.
|
||||
FORCEINLINE float UnitSphereTriangleArea( Vector const &a, Vector const &b , Vector const &c )
|
||||
{
|
||||
float flLengthA = UnitSphereLineSegmentLength( b, c );
|
||||
float flLengthB = UnitSphereLineSegmentLength( c, a );
|
||||
float flLengthC = UnitSphereLineSegmentLength( a, b );
|
||||
|
||||
if ( ( flLengthA == 0. ) || ( flLengthB == 0. ) || ( flLengthC == 0. ) )
|
||||
return 0.; // zero area triangle
|
||||
|
||||
// now, find the 3 incribed angles for the triangle
|
||||
float flHalfSumLens = 0.5 * ( flLengthA + flLengthB + flLengthC );
|
||||
float flSinSums = sin( flHalfSumLens );
|
||||
float flSinSMinusA= sin( flHalfSumLens - flLengthA );
|
||||
float flSinSMinusB= sin( flHalfSumLens - flLengthB );
|
||||
float flSinSMinusC= sin( flHalfSumLens - flLengthC );
|
||||
|
||||
float flTanAOver2 = sqrt ( ( flSinSMinusB * flSinSMinusC ) / ( flSinSums * flSinSMinusA ) );
|
||||
float flTanBOver2 = sqrt ( ( flSinSMinusA * flSinSMinusC ) / ( flSinSums * flSinSMinusB ) );
|
||||
float flTanCOver2 = sqrt ( ( flSinSMinusA * flSinSMinusB ) / ( flSinSums * flSinSMinusC ) );
|
||||
|
||||
// Girards formula : area = sum of angles - pi.
|
||||
return 2.0 * ( atan( flTanAOver2 ) + atan( flTanBOver2 ) + atan( flTanCOver2 ) ) - M_PI;
|
||||
}
|
||||
|
||||
// spherical harmonics-related functions. Best explanation at http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.pdf
|
||||
|
||||
// Evaluate associated legendre polynomial P( l, m ) at flX, using recurrence relation
|
||||
float AssociatedLegendrePolynomial( int nL, int nM, float flX );
|
||||
|
||||
// Evaluate order N spherical harmonic with spherical coordinates
|
||||
// nL = band, 0..N
|
||||
// nM = -nL .. nL
|
||||
// theta = 0..M_PI
|
||||
// phi = 0.. 2 * M_PHI
|
||||
float SphericalHarmonic( int nL, int nM, float flTheta, float flPhi );
|
||||
|
||||
// evaluate spherical harmonic with normalized vector direction
|
||||
float SphericalHarmonic( int nL, int nM, Vector const &vecDirection );
|
||||
|
||||
|
||||
#endif // SPHERICAL_GEOMETRY_H
|
||||
//====== Copyright <20> 2007-2007, Valve Corporation, All rights reserved. =======//
|
||||
//
|
||||
// Purpose: Functions for spherical geometry.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef SPHERICAL_GEOMETRY_H
|
||||
#define SPHERICAL_GEOMETRY_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
// see http://mathworld.wolfram.com/SphericalTrigonometry.html
|
||||
|
||||
// return the spherical distance, in radians, between 2 points on the unit sphere.
|
||||
FORCEINLINE float UnitSphereLineSegmentLength( Vector const &a, Vector const &b )
|
||||
{
|
||||
// check unit length
|
||||
Assert( fabs( VectorLength( a ) - 1.0 ) < 1.0e-3 );
|
||||
Assert( fabs( VectorLength( b ) - 1.0 ) < 1.0e-3 );
|
||||
return acos( DotProduct( a, b ) );
|
||||
}
|
||||
|
||||
|
||||
// given 3 points on the unit sphere, return the spherical area (in radians) of the triangle they form.
|
||||
// valid for "small" triangles.
|
||||
FORCEINLINE float UnitSphereTriangleArea( Vector const &a, Vector const &b , Vector const &c )
|
||||
{
|
||||
float flLengthA = UnitSphereLineSegmentLength( b, c );
|
||||
float flLengthB = UnitSphereLineSegmentLength( c, a );
|
||||
float flLengthC = UnitSphereLineSegmentLength( a, b );
|
||||
|
||||
if ( ( flLengthA == 0. ) || ( flLengthB == 0. ) || ( flLengthC == 0. ) )
|
||||
return 0.; // zero area triangle
|
||||
|
||||
// now, find the 3 incribed angles for the triangle
|
||||
float flHalfSumLens = 0.5 * ( flLengthA + flLengthB + flLengthC );
|
||||
float flSinSums = sin( flHalfSumLens );
|
||||
float flSinSMinusA= sin( flHalfSumLens - flLengthA );
|
||||
float flSinSMinusB= sin( flHalfSumLens - flLengthB );
|
||||
float flSinSMinusC= sin( flHalfSumLens - flLengthC );
|
||||
|
||||
float flTanAOver2 = sqrt ( ( flSinSMinusB * flSinSMinusC ) / ( flSinSums * flSinSMinusA ) );
|
||||
float flTanBOver2 = sqrt ( ( flSinSMinusA * flSinSMinusC ) / ( flSinSums * flSinSMinusB ) );
|
||||
float flTanCOver2 = sqrt ( ( flSinSMinusA * flSinSMinusB ) / ( flSinSums * flSinSMinusC ) );
|
||||
|
||||
// Girards formula : area = sum of angles - pi.
|
||||
return 2.0 * ( atan( flTanAOver2 ) + atan( flTanBOver2 ) + atan( flTanCOver2 ) ) - M_PI;
|
||||
}
|
||||
|
||||
// spherical harmonics-related functions. Best explanation at http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.pdf
|
||||
|
||||
// Evaluate associated legendre polynomial P( l, m ) at flX, using recurrence relation
|
||||
float AssociatedLegendrePolynomial( int nL, int nM, float flX );
|
||||
|
||||
// Evaluate order N spherical harmonic with spherical coordinates
|
||||
// nL = band, 0..N
|
||||
// nM = -nL .. nL
|
||||
// theta = 0..M_PI
|
||||
// phi = 0.. 2 * M_PHI
|
||||
float SphericalHarmonic( int nL, int nM, float flTheta, float flPhi );
|
||||
|
||||
// evaluate spherical harmonic with normalized vector direction
|
||||
float SphericalHarmonic( int nL, int nM, Vector const &vecDirection );
|
||||
|
||||
|
||||
#endif // SPHERICAL_GEOMETRY_H
|
||||
|
@ -49,7 +49,7 @@
|
||||
#ifdef VECTOR_PARANOIA
|
||||
#define CHECK_VALID( _v) Assert( (_v).IsValid() )
|
||||
#else
|
||||
#define CHECK_VALID( _v) 0
|
||||
#define CHECK_VALID( _v)
|
||||
#endif
|
||||
|
||||
#define VecToString(v) (static_cast<const char *>(CFmtStr("(%f, %f, %f)", (v).x, (v).y, (v).z))) // ** Note: this generates a temporary, don't hold reference!
|
||||
@ -832,10 +832,10 @@ FORCEINLINE ShortVector& ShortVector::operator-=(const ShortVector& v)
|
||||
|
||||
FORCEINLINE ShortVector& ShortVector::operator*=(float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
z *= fl;
|
||||
w *= fl;
|
||||
x = static_cast<short>(x* fl);
|
||||
y = static_cast<short>(y * fl);
|
||||
z = static_cast<short>(z * fl);
|
||||
w = static_cast<short>(w * fl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -852,10 +852,10 @@ FORCEINLINE ShortVector& ShortVector::operator/=(float fl)
|
||||
{
|
||||
Assert( fl != 0.0f );
|
||||
float oofl = 1.0f / fl;
|
||||
x *= oofl;
|
||||
y *= oofl;
|
||||
z *= oofl;
|
||||
w *= oofl;
|
||||
x = static_cast<short>(x * oofl);
|
||||
y = static_cast<short>(y * oofl);
|
||||
z = static_cast<short>(z * oofl);
|
||||
w = static_cast<short>(w * oofl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -872,10 +872,10 @@ FORCEINLINE ShortVector& ShortVector::operator/=(const ShortVector& v)
|
||||
FORCEINLINE void ShortVectorMultiply( const ShortVector& src, float fl, ShortVector& res )
|
||||
{
|
||||
Assert( IsFinite(fl) );
|
||||
res.x = src.x * fl;
|
||||
res.y = src.y * fl;
|
||||
res.z = src.z * fl;
|
||||
res.w = src.w * fl;
|
||||
res.x = static_cast<short>(src.x * fl);
|
||||
res.y = static_cast<short>(src.y * fl);
|
||||
res.z = static_cast<short>(src.z * fl);
|
||||
res.w = static_cast<short>(src.w * fl);
|
||||
}
|
||||
|
||||
FORCEINLINE ShortVector ShortVector::operator*(float fl) const
|
||||
@ -982,10 +982,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator-=(const IntVector4D& v)
|
||||
|
||||
FORCEINLINE IntVector4D& IntVector4D::operator*=(float fl)
|
||||
{
|
||||
x *= fl;
|
||||
y *= fl;
|
||||
z *= fl;
|
||||
w *= fl;
|
||||
x = static_cast<int>(x * fl);
|
||||
y = static_cast<int>(y * fl);
|
||||
z = static_cast<int>(z * fl);
|
||||
w = static_cast<int>(w * fl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -1002,10 +1002,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator/=(float fl)
|
||||
{
|
||||
Assert( fl != 0.0f );
|
||||
float oofl = 1.0f / fl;
|
||||
x *= oofl;
|
||||
y *= oofl;
|
||||
z *= oofl;
|
||||
w *= oofl;
|
||||
x = static_cast<int>(x * oofl);
|
||||
y = static_cast<int>(y * oofl);
|
||||
z = static_cast<int>(z * oofl);
|
||||
w = static_cast<int>(w * oofl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -1022,10 +1022,10 @@ FORCEINLINE IntVector4D& IntVector4D::operator/=(const IntVector4D& v)
|
||||
FORCEINLINE void IntVector4DMultiply( const IntVector4D& src, float fl, IntVector4D& res )
|
||||
{
|
||||
Assert( IsFinite(fl) );
|
||||
res.x = src.x * fl;
|
||||
res.y = src.y * fl;
|
||||
res.z = src.z * fl;
|
||||
res.w = src.w * fl;
|
||||
res.x = static_cast<int>(src.x * fl);
|
||||
res.y = static_cast<int>(src.y * fl);
|
||||
res.z = static_cast<int>(src.z * fl);
|
||||
res.w = static_cast<int>(src.w * fl);
|
||||
}
|
||||
|
||||
FORCEINLINE IntVector4D IntVector4D::operator*(float fl) const
|
||||
@ -1082,6 +1082,14 @@ inline void VectorScale ( const Vector& in, vec_t scale, Vector& result )
|
||||
VectorMultiply( in, scale, result );
|
||||
}
|
||||
|
||||
inline void VectorMA( const Vector& start, float scale, const Vector& direction, Vector& dest )
|
||||
{
|
||||
CHECK_VALID(start);
|
||||
CHECK_VALID(direction);
|
||||
dest.x = start.x + scale * direction.x;
|
||||
dest.y = start.y + scale * direction.y;
|
||||
dest.z = start.z + scale * direction.z;
|
||||
}
|
||||
|
||||
FORCEINLINE void VectorDivide( const Vector& a, vec_t b, Vector& c )
|
||||
{
|
||||
|
@ -324,4 +324,4 @@ protected:
|
||||
|
||||
|
||||
}
|
||||
#endif // VALVEMAYA_UNDO_H
|
||||
#endif // VALVEMAYA_UNDO_H
|
||||
|
@ -27,4 +27,4 @@ class VsMayaDmx
|
||||
|
||||
};
|
||||
|
||||
#endif // VSMAYADMX_H
|
||||
#endif // VSMAYADMX_H
|
||||
|
@ -951,4 +951,4 @@ private:
|
||||
static CVsMayaMPxFactory< CVsMayaMPxDeformerNodeDecorator< _class > > s_##_name##_Factory
|
||||
|
||||
|
||||
#endif // VSMAYAMPXFACTORY_H
|
||||
#endif // VSMAYAMPXFACTORY_H
|
||||
|
@ -469,4 +469,4 @@ extern CMayaWarnStream mwarn;
|
||||
extern CMayaErrStream merr;
|
||||
|
||||
|
||||
#endif // VALVEMAYA_H
|
||||
#endif // VALVEMAYA_H
|
||||
|
@ -268,4 +268,4 @@ void ResetTimeMeasurements( void )
|
||||
p = p->GetNext();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -124,4 +124,4 @@ private:
|
||||
CMeasureSection *m_pMS;
|
||||
};
|
||||
|
||||
#endif // MEASURE_SECTION_H
|
||||
#endif // MEASURE_SECTION_H
|
||||
|
@ -38,4 +38,4 @@ enum modtype_t
|
||||
mod_studio
|
||||
};
|
||||
|
||||
#endif // MODEL_TYPES_H
|
||||
#endif // MODEL_TYPES_H
|
||||
|
@ -191,4 +191,4 @@ inline CVoiceData *CMouthInfo::AddSource( CAudioSource *source, bool bIgnorePhon
|
||||
return data;
|
||||
}
|
||||
|
||||
#endif // MOUTHINFO_H
|
||||
#endif // MOUTHINFO_H
|
||||
|
@ -18,9 +18,9 @@
|
||||
#include "basehandle.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT<int>::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation)
|
||||
|
||||
#endif
|
||||
|
||||
#define MyOffsetOf( type, var ) ( (int)&((type*)0)->var )
|
||||
|
||||
@ -348,7 +348,7 @@ protected:
|
||||
{
|
||||
if ( out != in )
|
||||
{
|
||||
NetworkStateChanged();
|
||||
this->NetworkStateChanged();
|
||||
out = in;
|
||||
}
|
||||
}
|
||||
@ -432,7 +432,7 @@ private:
|
||||
{
|
||||
if ( out != in )
|
||||
{
|
||||
NetworkStateChanged();
|
||||
this->NetworkStateChanged();
|
||||
out = in;
|
||||
}
|
||||
}
|
||||
@ -519,7 +519,7 @@ private:
|
||||
{
|
||||
if ( out != in )
|
||||
{
|
||||
NetworkStateChanged();
|
||||
this->NetworkStateChanged();
|
||||
out = in;
|
||||
}
|
||||
}
|
||||
@ -557,7 +557,7 @@ private:
|
||||
{
|
||||
if ( CNetworkHandleBase<Type,Changer>::m_Value != val )
|
||||
{
|
||||
NetworkStateChanged();
|
||||
this->NetworkStateChanged();
|
||||
CNetworkHandleBase<Type,Changer>::m_Value = val;
|
||||
}
|
||||
return val;
|
||||
@ -699,7 +699,8 @@ private:
|
||||
class NetworkVar_##name \
|
||||
{ \
|
||||
public: \
|
||||
template <typename T> friend int ServerClassInit(T *); \
|
||||
template <typename T> friend int ServerClassInit(T *); \
|
||||
template <typename T> friend datamap_t *DataMapInit(T *); \
|
||||
const type& operator[]( int i ) const \
|
||||
{ \
|
||||
return Get( i ); \
|
||||
|
@ -55,4 +55,4 @@ public:
|
||||
OverlayText_t *nextOverlayText;
|
||||
};
|
||||
|
||||
#endif // OVERLAYTEXT_H
|
||||
#endif // OVERLAYTEXT_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -199,4 +199,4 @@ const char *DescForPhonemeByIndex( int index )
|
||||
if ( index < 0 || index >= NumPhonemes() )
|
||||
return NULL;
|
||||
return g_Phonemes[ index ].desc;
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +35,4 @@ public:
|
||||
|
||||
extern CVEfx *g_pEfx;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -12,7 +12,7 @@
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#ifdef _LINUX
|
||||
#if defined _LINUX && !defined __stdcall
|
||||
#define __stdcall
|
||||
#endif
|
||||
|
||||
|
@ -1761,4 +1761,4 @@ void CSentence::CreateEventWordDistribution( char const *pszText, float flSenten
|
||||
}
|
||||
|
||||
|
||||
#endif // !_STATIC_LINKED || _SHARED_LIB
|
||||
#endif // !_STATIC_LINKED || _SHARED_LIB
|
||||
|
@ -27,7 +27,7 @@ extern ServerClass *g_pServerClassHead;
|
||||
class ServerClass
|
||||
{
|
||||
public:
|
||||
ServerClass( char *pNetworkName, SendTable *pTable )
|
||||
ServerClass( const char *pNetworkName, SendTable *pTable )
|
||||
{
|
||||
m_pNetworkName = pNetworkName;
|
||||
m_pTable = pTable;
|
||||
@ -69,10 +69,10 @@ public:
|
||||
|
||||
|
||||
public:
|
||||
char *m_pNetworkName;
|
||||
const char *m_pNetworkName;
|
||||
SendTable *m_pTable;
|
||||
ServerClass *m_pNext;
|
||||
int m_ClassID; // Managed by the engine.
|
||||
int m_ClassID; // Managed by the engine.
|
||||
|
||||
// This is an index into the network string table (sv.GetInstanceBaselineTable()).
|
||||
int m_InstanceBaselineIndex; // INVALID_STRING_INDEX if not initialized yet.
|
||||
|
@ -18,4 +18,4 @@ enum ShatterSurface_t
|
||||
SHATTERSURFACE_TILE = 1,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -150,7 +150,7 @@ inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
Q_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
|
@ -516,7 +516,7 @@ void studiohdr_t::SetAttachmentBone( int iAttachment, int iBone )
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
char *studiohdr_t::pszNodeName( int iNode ) const
|
||||
const char *studiohdr_t::pszNodeName( int iNode ) const
|
||||
{
|
||||
if (numincludemodels == 0)
|
||||
{
|
||||
@ -799,7 +799,9 @@ const virtualmodel_t * CStudioHdr::ResetVModel( const virtualmodel_t *pVModel )
|
||||
if (pVModel != NULL)
|
||||
{
|
||||
m_pVModel = (virtualmodel_t *)pVModel;
|
||||
#if defined(_WIN32) && !defined(THREAD_PROFILER)
|
||||
Assert( !pVModel->m_Lock.GetOwnerId() );
|
||||
#endif
|
||||
m_pStudioHdrCache.SetCount( m_pVModel->m_group.Count() );
|
||||
|
||||
int i;
|
||||
@ -847,7 +849,9 @@ const studiohdr_t *CStudioHdr::GroupStudioHdr( int i ) const
|
||||
|
||||
if (pStudioHdr == NULL)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(THREAD_PROFILER)
|
||||
Assert( !m_pVModel->m_Lock.GetOwnerId() );
|
||||
#endif
|
||||
virtualgroup_t *pGroup = &m_pVModel->m_group[ i ];
|
||||
pStudioHdr = pGroup->GetStudioHdr();
|
||||
m_pStudioHdrCache[ i ] = pStudioHdr;
|
||||
@ -1149,7 +1153,7 @@ void CStudioHdr::SetAttachmentBone( int iAttachment, int iBone )
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
char *CStudioHdr::pszNodeName( int iNode ) const
|
||||
const char *CStudioHdr::pszNodeName( int iNode ) const
|
||||
{
|
||||
if (m_pVModel == NULL)
|
||||
{
|
||||
@ -1816,4 +1820,4 @@ void CStudioHdr::CActivityToSequenceMapping::SetValidationPair( const CStudioHdr
|
||||
{
|
||||
m_expectedPStudioHdr = pstudiohdr->GetRenderHdr();
|
||||
m_expectedVModel = pstudiohdr->GetVirtualModel();
|
||||
}
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ struct mstudiobbox_t
|
||||
int szhitboxnameindex; // offset to the name of the hitbox.
|
||||
int unused[8];
|
||||
|
||||
char* pszHitboxName()
|
||||
const char* pszHitboxName()
|
||||
{
|
||||
if( szhitboxnameindex == 0 )
|
||||
return "";
|
||||
@ -974,15 +974,15 @@ public:
|
||||
}
|
||||
inline void SetDeltaFixed( const Vector& vInput )
|
||||
{
|
||||
delta[0] = vInput.x * g_VertAnimFixedPointScaleInv;
|
||||
delta[1] = vInput.y * g_VertAnimFixedPointScaleInv;
|
||||
delta[2] = vInput.z * g_VertAnimFixedPointScaleInv;
|
||||
delta[0] = static_cast<short>(vInput.x * g_VertAnimFixedPointScaleInv);
|
||||
delta[1] = static_cast<short>(vInput.y * g_VertAnimFixedPointScaleInv);
|
||||
delta[2] = static_cast<short>(vInput.z * g_VertAnimFixedPointScaleInv);
|
||||
}
|
||||
inline void SetNDeltaFixed( const Vector& vInputNormal )
|
||||
{
|
||||
ndelta[0] = vInputNormal.x * g_VertAnimFixedPointScaleInv;
|
||||
ndelta[1] = vInputNormal.y * g_VertAnimFixedPointScaleInv;
|
||||
ndelta[2] = vInputNormal.z * g_VertAnimFixedPointScaleInv;
|
||||
ndelta[0] = static_cast<short>(vInputNormal.x * g_VertAnimFixedPointScaleInv);
|
||||
ndelta[1] = static_cast<short>(vInputNormal.y * g_VertAnimFixedPointScaleInv);
|
||||
ndelta[2] = static_cast<short>(vInputNormal.z * g_VertAnimFixedPointScaleInv);
|
||||
}
|
||||
|
||||
// Ick...can also force fp16 data into this structure for writing to file in legacy format...
|
||||
@ -1015,7 +1015,7 @@ struct mstudiovertanim_wrinkle_t : public mstudiovertanim_t
|
||||
|
||||
inline void SetWrinkleFixed( float flWrinkle )
|
||||
{
|
||||
int nWrinkleDeltaInt = flWrinkle * g_VertAnimFixedPointScaleInv;
|
||||
int nWrinkleDeltaInt = static_cast<int>(flWrinkle * g_VertAnimFixedPointScaleInv);
|
||||
wrinkledelta = clamp( nWrinkleDeltaInt, -32767, 32767 );
|
||||
}
|
||||
|
||||
@ -2100,7 +2100,7 @@ struct studiohdr_t
|
||||
//public:
|
||||
int EntryNode( int iSequence ) const;
|
||||
int ExitNode( int iSequence ) const;
|
||||
char *pszNodeName( int iNode ) const;
|
||||
const char *pszNodeName( int iNode ) const;
|
||||
int GetTransition( int iFrom, int iTo ) const;
|
||||
|
||||
int numflexdesc;
|
||||
@ -2304,7 +2304,7 @@ public:
|
||||
|
||||
int EntryNode( int iSequence ) const;
|
||||
int ExitNode( int iSequence ) const;
|
||||
char *pszNodeName( int iNode ) const;
|
||||
const char *pszNodeName( int iNode ) const;
|
||||
// FIXME: where should this one be?
|
||||
int GetTransition( int iFrom, int iTo ) const;
|
||||
|
||||
@ -2473,10 +2473,11 @@ public:
|
||||
|
||||
// ctor
|
||||
CActivityToSequenceMapping( void )
|
||||
: m_pSequenceTuples(NULL), m_iSequenceTuplesCount(0), m_ActToSeqHash(8,0,0), m_expectedPStudioHdr(NULL), m_expectedVModel(NULL)
|
||||
: m_pSequenceTuples(NULL), m_iSequenceTuplesCount(0),
|
||||
#if STUDIO_SEQUENCE_ACTIVITY_LAZY_INITIALIZE
|
||||
, m_bIsInitialized(false)
|
||||
m_bIsInitialized(false),
|
||||
#endif
|
||||
m_ActToSeqHash(8,0,0), m_expectedPStudioHdr(NULL), m_expectedVModel(NULL)
|
||||
{};
|
||||
|
||||
// dtor -- not virtual because this class has no inheritors
|
||||
|
@ -192,4 +192,4 @@ enum PerfErrors
|
||||
|
||||
#pragma warning( pop )
|
||||
|
||||
#endif // PMELIB_H
|
||||
#endif // PMELIB_H
|
||||
|
@ -141,4 +141,4 @@ char (*RtlpNumberOf( UNALIGNED T (&)[N] ))[N];
|
||||
#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
|
||||
#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
|
||||
|
||||
#endif // COMMONMACROS_H
|
||||
#endif // COMMONMACROS_H
|
||||
|
@ -478,11 +478,22 @@ public:
|
||||
// Macro to assist in asserting constant invariants during compilation
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define COMPILE_TIME_ASSERT( pred ) switch(0){case 0:case pred:;}
|
||||
#define ASSERT_INVARIANT( pred ) static void UNIQUE_ID() { COMPILE_TIME_ASSERT( pred ) }
|
||||
#define COMPILE_TIME_ASSERT( pred ) switch(0){case 0:case pred:;}
|
||||
#ifdef _MSC_VER
|
||||
#define ASSERT_INVARIANT( pred ) static void UNIQUE_ID() { COMPILE_TIME_ASSERT( pred ) }
|
||||
#elif defined __GNUC__
|
||||
#define ASSERT_INVARIANT( pred ) __attribute__((unused)) static void UNIQUE_ID() { COMPILE_TIME_ASSERT( pred ) }
|
||||
#endif
|
||||
#else
|
||||
#define COMPILE_TIME_ASSERT( pred )
|
||||
#define ASSERT_INVARIANT( pred )
|
||||
#define COMPILE_TIME_ASSERT( pred )
|
||||
#define ASSERT_INVARIANT( pred )
|
||||
#endif
|
||||
|
||||
// Member function pointer size
|
||||
#ifdef _MSC_VER
|
||||
#define MFP_SIZE 4
|
||||
#elif __GNUC__
|
||||
#define MFP_SIZE 8
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
@ -283,8 +283,10 @@ inline void CCycleCount::Init( int64 cycles )
|
||||
m_Int64 = cycles;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4189) // warning C4189: local variable is initialized but not referenced
|
||||
#endif
|
||||
|
||||
inline void CCycleCount::Sample()
|
||||
{
|
||||
@ -332,8 +334,9 @@ inline void CCycleCount::Sample()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
|
||||
#endif
|
||||
|
||||
inline CCycleCount& CCycleCount::operator+=( CCycleCount const &other )
|
||||
{
|
||||
|
@ -50,4 +50,4 @@ PLATFORM_INTERFACE ICommandLine *CommandLine_Tier0();
|
||||
#define CommandLine CommandLine_Tier0
|
||||
#endif
|
||||
|
||||
#endif // TIER0_ICOMMANDLINE_H
|
||||
#endif // TIER0_ICOMMANDLINE_H
|
||||
|
@ -43,4 +43,4 @@ private:
|
||||
int m_iL2CacheMissCount;
|
||||
};
|
||||
|
||||
#endif // CL2CACHE_H
|
||||
#endif // CL2CACHE_H
|
||||
|
@ -346,7 +346,7 @@ struct MemAllocFileLine_t
|
||||
#define MEM_ALLOC_CREDIT_CLASS()
|
||||
#define MEM_ALLOC_CLASSNAME(type) NULL
|
||||
|
||||
#endif !STEAM && NO_MALLOC_OVERRIDE
|
||||
#endif // !STEAM && NO_MALLOC_OVERRIDE
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
@ -43,8 +43,11 @@
|
||||
#endif // _LINUX
|
||||
|
||||
#include <malloc.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <new.h>
|
||||
|
||||
#elif defined __GNUC__
|
||||
#include <new>
|
||||
#endif
|
||||
|
||||
// need this for memset
|
||||
#include <string.h>
|
||||
@ -395,11 +398,11 @@ typedef void * HINSTANCE;
|
||||
#ifdef _WIN32
|
||||
// Alloca defined for this platform
|
||||
#define stackalloc( _size ) _alloca( ALIGN_VALUE( _size, 16 ) )
|
||||
#define stackfree( _p ) 0
|
||||
#define stackfree( _p )
|
||||
#elif _LINUX
|
||||
// Alloca defined for this platform
|
||||
#define stackalloc( _size ) _alloca( ALIGN_VALUE( _size, 16 ) )
|
||||
#define stackfree( _p ) 0
|
||||
#define stackfree( _p )
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -444,7 +447,7 @@ typedef void * HINSTANCE;
|
||||
#endif
|
||||
|
||||
// When we port to 64 bit, we'll have to resolve the int, ptr vs size_t 32/64 bit problems...
|
||||
#if !defined( _WIN64 )
|
||||
#if !defined( _WIN64 ) && defined _MSC_VER
|
||||
#pragma warning( disable : 4267 ) // conversion from 'size_t' to 'int', possible loss of data
|
||||
#pragma warning( disable : 4311 ) // pointer truncation from 'char *' to 'int'
|
||||
#pragma warning( disable : 4312 ) // conversion from 'unsigned int' to 'memhandle_t' of greater size
|
||||
@ -665,11 +668,11 @@ inline T DWordSwapAsm( T dw )
|
||||
// The typically used methods.
|
||||
//-------------------------------------
|
||||
|
||||
#if defined(__i386__)
|
||||
#if defined(__i386__) && !defined LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
|
||||
#if defined( _SGI_SOURCE ) || defined( _X360 )
|
||||
#if (defined( _SGI_SOURCE ) || defined( _X360 )) && !defined BIG_ENDIAN
|
||||
#define BIG_ENDIAN 1
|
||||
#endif
|
||||
|
||||
|
@ -70,4 +70,4 @@ private:
|
||||
PMCounters m_Delta ; ///< computed total delta between start/stop
|
||||
};
|
||||
|
||||
#endif // CPMCDATA_H
|
||||
#endif // CPMCDATA_H
|
||||
|
@ -187,12 +187,12 @@ inline long ThreadInterlockedExchangeAdd( long volatile *p, long value ) {
|
||||
inline long ThreadInterlockedCompareExchange( long volatile *p, long value, long comperand ) { Assert( (size_t)p % 4 == 0 ); return _InterlockedCompareExchange( p, value, comperand ); }
|
||||
inline bool ThreadInterlockedAssignIf( long volatile *p, long value, long comperand ) { Assert( (size_t)p % 4 == 0 ); return ( _InterlockedCompareExchange( p, value, comperand ) == comperand ); }
|
||||
#else
|
||||
TT_INTERFACE long ThreadInterlockedIncrement( long volatile * ) NOINLINE;
|
||||
TT_INTERFACE long ThreadInterlockedDecrement( long volatile * ) NOINLINE;
|
||||
TT_INTERFACE long ThreadInterlockedExchange( long volatile *, long value ) NOINLINE;
|
||||
TT_INTERFACE long ThreadInterlockedExchangeAdd( long volatile *, long value ) NOINLINE;
|
||||
TT_INTERFACE long ThreadInterlockedCompareExchange( long volatile *, long value, long comperand ) NOINLINE;
|
||||
TT_INTERFACE bool ThreadInterlockedAssignIf( long volatile *, long value, long comperand ) NOINLINE;
|
||||
TT_INTERFACE long ThreadInterlockedIncrement( long volatile * );
|
||||
TT_INTERFACE long ThreadInterlockedDecrement( long volatile * );
|
||||
TT_INTERFACE long ThreadInterlockedExchange( long volatile *, long value );
|
||||
TT_INTERFACE long ThreadInterlockedExchangeAdd( long volatile *, long value );
|
||||
TT_INTERFACE long ThreadInterlockedCompareExchange( long volatile *, long value, long comperand );
|
||||
TT_INTERFACE bool ThreadInterlockedAssignIf( long volatile *, long value, long comperand );
|
||||
#endif
|
||||
|
||||
inline unsigned ThreadInterlockedExchangeSubtract( long volatile *p, long value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, -value ); }
|
||||
@ -203,21 +203,21 @@ inline void *ThreadInterlockedExchangePointer( void * volatile *p, void *value )
|
||||
inline void *ThreadInterlockedCompareExchangePointer( void * volatile *p, void *value, void *comperand ) { return (void *)_InterlockedCompareExchange( reinterpret_cast<long volatile *>(p), reinterpret_cast<long>(value), reinterpret_cast<long>(comperand) ); }
|
||||
inline bool ThreadInterlockedAssignPointerIf( void * volatile *p, void *value, void *comperand ) { return ( _InterlockedCompareExchange( reinterpret_cast<long volatile *>(p), reinterpret_cast<long>(value), reinterpret_cast<long>(comperand) ) == reinterpret_cast<long>(comperand) ); }
|
||||
#else
|
||||
TT_INTERFACE void *ThreadInterlockedExchangePointer( void * volatile *, void *value ) NOINLINE;
|
||||
TT_INTERFACE void *ThreadInterlockedCompareExchangePointer( void * volatile *, void *value, void *comperand ) NOINLINE;
|
||||
TT_INTERFACE bool ThreadInterlockedAssignPointerIf( void * volatile *, void *value, void *comperand ) NOINLINE;
|
||||
TT_INTERFACE void *ThreadInterlockedExchangePointer( void * volatile *, void *value );
|
||||
TT_INTERFACE void *ThreadInterlockedCompareExchangePointer( void * volatile *, void *value, void *comperand );
|
||||
TT_INTERFACE bool ThreadInterlockedAssignPointerIf( void * volatile *, void *value, void *comperand );
|
||||
#endif
|
||||
|
||||
inline void const *ThreadInterlockedExchangePointerToConst( void const * volatile *p, void const *value ) { return ThreadInterlockedExchangePointer( const_cast < void * volatile * > ( p ), const_cast < void * > ( value ) ); }
|
||||
inline void const *ThreadInterlockedCompareExchangePointerToConst( void const * volatile *p, void const *value, void const *comperand ) { return ThreadInterlockedCompareExchangePointer( const_cast < void * volatile * > ( p ), const_cast < void * > ( value ), const_cast < void * > ( comperand ) ); }
|
||||
inline bool ThreadInterlockedAssignPointerToConstIf( void const * volatile *p, void const *value, void const *comperand ) { return ThreadInterlockedAssignPointerIf( const_cast < void * volatile * > ( p ), const_cast < void * > ( value ), const_cast < void * > ( comperand ) ); }
|
||||
|
||||
TT_INTERFACE int64 ThreadInterlockedIncrement64( int64 volatile * ) NOINLINE;
|
||||
TT_INTERFACE int64 ThreadInterlockedDecrement64( int64 volatile * ) NOINLINE;
|
||||
TT_INTERFACE int64 ThreadInterlockedCompareExchange64( int64 volatile *, int64 value, int64 comperand ) NOINLINE;
|
||||
TT_INTERFACE int64 ThreadInterlockedExchange64( int64 volatile *, int64 value ) NOINLINE;
|
||||
TT_INTERFACE int64 ThreadInterlockedExchangeAdd64( int64 volatile *, int64 value ) NOINLINE;
|
||||
TT_INTERFACE bool ThreadInterlockedAssignIf64(volatile int64 *pDest, int64 value, int64 comperand ) NOINLINE;
|
||||
TT_INTERFACE int64 ThreadInterlockedIncrement64( int64 volatile * );
|
||||
TT_INTERFACE int64 ThreadInterlockedDecrement64( int64 volatile * );
|
||||
TT_INTERFACE int64 ThreadInterlockedCompareExchange64( int64 volatile *, int64 value, int64 comperand );
|
||||
TT_INTERFACE int64 ThreadInterlockedExchange64( int64 volatile *, int64 value );
|
||||
TT_INTERFACE int64 ThreadInterlockedExchangeAdd64( int64 volatile *, int64 value );
|
||||
TT_INTERFACE bool ThreadInterlockedAssignIf64(volatile int64 *pDest, int64 value, int64 comperand );
|
||||
|
||||
inline unsigned ThreadInterlockedExchangeSubtract( unsigned volatile *p, unsigned value ) { return ThreadInterlockedExchangeAdd( (long volatile *)p, value ); }
|
||||
inline unsigned ThreadInterlockedIncrement( unsigned volatile *p ) { return ThreadInterlockedIncrement( (long volatile *)p ); }
|
||||
@ -307,14 +307,14 @@ template <class T = int>
|
||||
class CThreadLocalInt : public CThreadLocal<T>
|
||||
{
|
||||
public:
|
||||
operator const T() const { return Get(); }
|
||||
operator const T() const { return CThreadLocal<T>::Get(); }
|
||||
int operator=( T i ) { Set( i ); return i; }
|
||||
|
||||
T operator++() { T i = Get(); Set( ++i ); return i; }
|
||||
T operator++(int) { T i = Get(); Set( i + 1 ); return i; }
|
||||
T operator++() { T i = CThreadLocal<T>::Get(); Set( ++i ); return i; }
|
||||
T operator++(int) { T i = CThreadLocal<T>::Get(); Set( i + 1 ); return i; }
|
||||
|
||||
T operator--() { T i = Get(); Set( --i ); return i; }
|
||||
T operator--(int) { T i = Get(); Set( i - 1 ); return i; }
|
||||
T operator--() { T i = CThreadLocal<T>::Get(); Set( --i ); return i; }
|
||||
T operator--(int) { T i = CThreadLocal<T>::Get(); Set( i - 1 ); return i; }
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
@ -979,9 +979,8 @@ private:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define TFRWL_ALIGN ALIGN8
|
||||
|
||||
TFRWL_ALIGN
|
||||
class TT_CLASS CThreadSpinRWLock
|
||||
|
||||
class TFRWL_ALIGN TT_CLASS CThreadSpinRWLock
|
||||
{
|
||||
public:
|
||||
CThreadSpinRWLock() { COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) ); Assert( (int)this % 8 == 0 ); memset( this, 0, sizeof( *this ) ); }
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef min
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
|
@ -605,7 +605,6 @@ protected:
|
||||
|
||||
DBG_INTERFACE CVProfile g_VProfCurrentProfile;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifdef VPROF_VTUNE_GROUP
|
||||
@ -658,9 +657,9 @@ public:
|
||||
|
||||
inline CVProfNode::CVProfNode( const tchar * pszName, int detailLevel, CVProfNode *pParent, const tchar *pBudgetGroupName, int budgetFlags )
|
||||
: m_pszName( pszName ),
|
||||
m_nRecursions( 0 ),
|
||||
m_nCurFrameCalls( 0 ),
|
||||
m_nPrevFrameCalls( 0 ),
|
||||
m_nRecursions( 0 ),
|
||||
m_pParent( pParent ),
|
||||
m_pChild( NULL ),
|
||||
m_pSibling( NULL ),
|
||||
|
@ -20,9 +20,12 @@
|
||||
// Temporarily turn off Valve defines
|
||||
#include "tier0/valve_off.h"
|
||||
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#if defined _WIN32 && !defined _WCHAR_T_DEFINED
|
||||
typedef unsigned short wchar_t;
|
||||
#define _WCHAR_T_DEFINED
|
||||
#elif defined _LINUX && !defined __WCHAR_TYPE__
|
||||
typedef unsigned short wchar_t;
|
||||
#define __WCHAR_TYPE__
|
||||
#endif
|
||||
|
||||
// char8
|
||||
|
@ -120,13 +120,13 @@ private:
|
||||
//-----------------------------------------------------------------------------
|
||||
template <class T, class LessFunc>
|
||||
CUtlSortVector<T, LessFunc>::CUtlSortVector( int nGrowSize, int initSize ) :
|
||||
m_pLessContext(NULL), CUtlVector<T>( nGrowSize, initSize ), m_bNeedsSort( false )
|
||||
CUtlVector<T>( nGrowSize, initSize ), m_pLessContext(NULL), m_bNeedsSort( false )
|
||||
{
|
||||
}
|
||||
|
||||
template <class T, class LessFunc>
|
||||
CUtlSortVector<T, LessFunc>::CUtlSortVector( T* pMemory, int numElements ) :
|
||||
m_pLessContext(NULL), CUtlVector<T>( pMemory, numElements ), m_bNeedsSort( false )
|
||||
CUtlVector<T>( pMemory, numElements ), m_pLessContext(NULL), m_bNeedsSort( false )
|
||||
{
|
||||
}
|
||||
|
||||
@ -148,9 +148,9 @@ int CUtlSortVector<T, LessFunc>::Insert( const T& src )
|
||||
AssertFatal( !m_bNeedsSort );
|
||||
|
||||
int pos = FindLessOrEqual( src ) + 1;
|
||||
GrowVector();
|
||||
ShiftElementsRight(pos);
|
||||
CopyConstruct<T>( &Element(pos), src );
|
||||
CUtlVector<T>::GrowVector();
|
||||
CUtlVector<T>::ShiftElementsRight(pos);
|
||||
CopyConstruct<T>( &CUtlVector<T>::Element(pos), src );
|
||||
return pos;
|
||||
}
|
||||
|
||||
@ -160,9 +160,9 @@ int CUtlSortVector<T, LessFunc>::InsertNoSort( const T& src )
|
||||
m_bNeedsSort = true;
|
||||
int lastElement = CUtlVector<T>::m_Size;
|
||||
// Just stick the new element at the end of the vector, but don't do a sort
|
||||
GrowVector();
|
||||
ShiftElementsRight(lastElement);
|
||||
CopyConstruct( &Element(lastElement), src );
|
||||
CUtlVector<T>::GrowVector();
|
||||
CUtlVector<T>::ShiftElementsRight(lastElement);
|
||||
CopyConstruct( &CUtlVector<T>::Element(lastElement), src );
|
||||
return lastElement;
|
||||
}
|
||||
|
||||
@ -181,14 +181,14 @@ void CUtlSortVector<T, LessFunc>::QuickSort( LessFunc& less, int nLower, int nUp
|
||||
}
|
||||
#else
|
||||
typedef int (__cdecl *QSortCompareFunc_t)( const void *, const void *);
|
||||
if ( Count() > 1 )
|
||||
if ( CUtlVector<T>::Count() > 1 )
|
||||
{
|
||||
QSortContext_t ctx;
|
||||
ctx.m_pLessContext = m_pLessContext;
|
||||
ctx.m_pLessFunc = &less;
|
||||
g_pUtlSortVectorQSortContext = &ctx;
|
||||
|
||||
qsort( Base(), Count(), sizeof(T), (QSortCompareFunc_t)&CUtlSortVector<T, LessFunc>::CompareHelper );
|
||||
qsort( CUtlVector<T>::Base(), CUtlVector<T>::Count(), sizeof(T), (QSortCompareFunc_t)&CUtlSortVector<T, LessFunc>::CompareHelper );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -201,7 +201,7 @@ void CUtlSortVector<T, LessFunc>::RedoSort( bool bForceSort /*= false */ )
|
||||
|
||||
m_bNeedsSort = false;
|
||||
LessFunc less;
|
||||
QuickSort( less, 0, Count() - 1 );
|
||||
QuickSort( less, 0, CUtlVector<T>::Count() - 1 );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -214,15 +214,15 @@ int CUtlSortVector<T, LessFunc>::Find( const T& src ) const
|
||||
|
||||
LessFunc less;
|
||||
|
||||
int start = 0, end = Count() - 1;
|
||||
int start = 0, end = CUtlVector<T>::Count() - 1;
|
||||
while (start <= end)
|
||||
{
|
||||
int mid = (start + end) >> 1;
|
||||
if ( less.Less( Element(mid), src, m_pLessContext ) )
|
||||
if ( less.Less( CUtlVector<T>::Element(mid), src, m_pLessContext ) )
|
||||
{
|
||||
start = mid + 1;
|
||||
}
|
||||
else if ( less.Less( src, Element(mid), m_pLessContext ) )
|
||||
else if ( less.Less( src, CUtlVector<T>::Element(mid), m_pLessContext ) )
|
||||
{
|
||||
end = mid - 1;
|
||||
}
|
||||
@ -244,15 +244,15 @@ int CUtlSortVector<T, LessFunc>::FindLessOrEqual( const T& src ) const
|
||||
AssertFatal( !m_bNeedsSort );
|
||||
|
||||
LessFunc less;
|
||||
int start = 0, end = Count() - 1;
|
||||
int start = 0, end = CUtlVector<T>::Count() - 1;
|
||||
while (start <= end)
|
||||
{
|
||||
int mid = (start + end) >> 1;
|
||||
if ( less.Less( Element(mid), src, m_pLessContext ) )
|
||||
if ( less.Less( CUtlVector<T>::Element(mid), src, m_pLessContext ) )
|
||||
{
|
||||
start = mid + 1;
|
||||
}
|
||||
else if ( less.Less( src, Element(mid), m_pLessContext ) )
|
||||
else if ( less.Less( src, CUtlVector<T>::Element(mid), m_pLessContext ) )
|
||||
{
|
||||
end = mid - 1;
|
||||
}
|
||||
@ -270,11 +270,11 @@ int CUtlSortVector<T, LessFunc>::FindLess( const T& src ) const
|
||||
AssertFatal( !m_bNeedsSort );
|
||||
|
||||
LessFunc less;
|
||||
int start = 0, end = Count() - 1;
|
||||
int start = 0, end = CUtlVector<T>::Count() - 1;
|
||||
while (start <= end)
|
||||
{
|
||||
int mid = (start + end) >> 1;
|
||||
if ( less.Less( Element(mid), src, m_pLessContext ) )
|
||||
if ( less.Less( CUtlVector<T>::Element(mid), src, m_pLessContext ) )
|
||||
{
|
||||
start = mid + 1;
|
||||
}
|
||||
|
@ -35,13 +35,13 @@ public:
|
||||
// Get data by the string's symbol table ID - only used to retrieve a pre-existing symbol, not create a new one!
|
||||
T& operator[]( UtlSymId_t n )
|
||||
{
|
||||
Assert( n >=0 && n <= m_Vector.Count() );
|
||||
Assert( n <= m_Vector.Count() );
|
||||
return m_Vector[n];
|
||||
}
|
||||
|
||||
const T& operator[]( UtlSymId_t n ) const
|
||||
{
|
||||
Assert( n >=0 && n <= m_Vector.Count() );
|
||||
Assert( n <= m_Vector.Count() );
|
||||
return m_Vector[n];
|
||||
}
|
||||
|
||||
|
@ -1042,7 +1042,7 @@ public:
|
||||
|
||||
void StartReading( const void *pData, int nBytes, int iStartBit = 0, int nBits = -1 );
|
||||
|
||||
FORCEINLINE int CBitRead::GetNumBitsRead( void ) const;
|
||||
FORCEINLINE int GetNumBitsRead( void ) const;
|
||||
|
||||
FORCEINLINE void GrabNextDWord( bool bOverFlowImmediately = false );
|
||||
FORCEINLINE void FetchNext( void );
|
||||
|
@ -234,7 +234,7 @@ private:
|
||||
Assert( "Invalid size in CByteswap::LowLevelByteSwap" && 0 );
|
||||
}
|
||||
#else
|
||||
for( int i = 0; i < sizeof(T); i++ )
|
||||
for( int i = 0; i < (int)sizeof(T); i++ )
|
||||
{
|
||||
((unsigned char* )&temp)[i] = ((unsigned char*)input)[sizeof(T)-(i+1)];
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ extern void CharacterSetBuild( characterset_t *pSetBuffer, const char *pSetStrin
|
||||
// character - character to lookup
|
||||
// Output : int - 1 if the character was in the set
|
||||
//-----------------------------------------------------------------------------
|
||||
#define IN_CHARACTERSET( SetBuffer, character ) ((SetBuffer).set[(character)])
|
||||
#define IN_CHARACTERSET( SetBuffer, character ) ((SetBuffer).set[static_cast<size_t>(character)])
|
||||
|
||||
|
||||
#endif // CHARACTERSET_H
|
||||
|
@ -130,6 +130,11 @@ public:
|
||||
// Deal with next pointer
|
||||
const ConCommandBase *GetNext( void ) const;
|
||||
ConCommandBase *GetNext( void );
|
||||
|
||||
inline void SetNext(ConCommandBase *pBase)
|
||||
{
|
||||
m_pNext = pBase;
|
||||
}
|
||||
|
||||
virtual bool IsRegistered( void ) const;
|
||||
|
||||
@ -573,7 +578,9 @@ void ConVar_PrintDescription( const ConCommandBase *pVar );
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Utility class to quickly allow ConCommands to call member methods
|
||||
//-----------------------------------------------------------------------------
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable : 4355 )
|
||||
#endif
|
||||
|
||||
template< class T >
|
||||
class CConCommandMemberAccessor : public ConCommand, public ICommandCallback, public ICommandCompletionCallback
|
||||
@ -620,8 +627,9 @@ private:
|
||||
FnMemberCommandCompletionCallback_t m_CompletionFunc;
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning ( default : 4355 )
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Utility macros to quicky generate a simple console command
|
||||
|
@ -342,8 +342,7 @@ class CMemberFuncProxyBase
|
||||
{
|
||||
protected:
|
||||
CMemberFuncProxyBase( OBJECT_TYPE_PTR pObject, FUNCTION_TYPE pfnProxied )
|
||||
: m_pObject( pObject ),
|
||||
m_pfnProxied( pfnProxied )
|
||||
: m_pfnProxied( pfnProxied ), m_pObject( pObject )
|
||||
{
|
||||
MEM_POLICY::OnAcquire(m_pObject);
|
||||
}
|
||||
|
@ -40,11 +40,18 @@
|
||||
#include <dlfcn.h> // dlopen,dlclose, et al
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef HMODULE
|
||||
#define HMODULE void *
|
||||
#define GetProcAddress dlsym
|
||||
#endif
|
||||
|
||||
#ifndef GetProcAddress
|
||||
#define GetProcAddress dlsym
|
||||
#endif
|
||||
|
||||
#ifndef _snprintf
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// TODO: move interface.cpp into tier0 library.
|
||||
#include "tier0/platform.h"
|
||||
|
@ -355,26 +355,26 @@ public:
|
||||
#ifdef _DEBUG
|
||||
CRefDebug()
|
||||
{
|
||||
AssertMsg( GetRefCount() == 1, "Expected initial ref count of 1" );
|
||||
AssertMsg( this->GetRefCount() == 1, "Expected initial ref count of 1" );
|
||||
DevMsg( "%s:create 0x%x\n", ( pszName ) ? pszName : "", this );
|
||||
}
|
||||
|
||||
virtual ~CRefDebug()
|
||||
{
|
||||
AssertDevMsg( GetRefCount() == FINAL_REFS, "Object still referenced on destroy?" );
|
||||
AssertDevMsg( this->GetRefCount() == FINAL_REFS, "Object still referenced on destroy?" );
|
||||
DevMsg( "%s:destroy 0x%x\n", ( pszName ) ? pszName : "", this );
|
||||
}
|
||||
|
||||
int AddRef()
|
||||
{
|
||||
DevMsg( "%s:(0x%x)->AddRef() --> %d\n", ( pszName ) ? pszName : "", this, GetRefCount() + 1 );
|
||||
DevMsg( "%s:(0x%x)->AddRef() --> %d\n", ( pszName ) ? pszName : "", this, this->GetRefCount() + 1 );
|
||||
return BASE_REFCOUNTED::AddRef();
|
||||
}
|
||||
|
||||
int Release()
|
||||
{
|
||||
DevMsg( "%s:(0x%x)->Release() --> %d\n", ( pszName ) ? pszName : "", this, GetRefCount() - 1 );
|
||||
Assert( GetRefCount() > 0 );
|
||||
DevMsg( "%s:(0x%x)->Release() --> %d\n", ( pszName ) ? pszName : "", this, this->GetRefCount() - 1 );
|
||||
Assert( this->GetRefCount() > 0 );
|
||||
return BASE_REFCOUNTED::Release();
|
||||
}
|
||||
#endif
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
void FreeAll();
|
||||
|
||||
// searches for a string already in the pool
|
||||
const char * CStringPool::Find( const char *pszValue );
|
||||
const char * Find( const char *pszValue );
|
||||
|
||||
protected:
|
||||
typedef CUtlRBTree<const char *, unsigned short> CStrSet;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#elif _LINUX
|
||||
#include <ctype.h>
|
||||
#include <wchar.h>
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
@ -24,6 +25,30 @@
|
||||
template< class T, class I > class CUtlMemory;
|
||||
template< class T, class A > class CUtlVector;
|
||||
|
||||
#ifdef _LINUX
|
||||
inline char *strupr( char *start )
|
||||
{
|
||||
char *str = start;
|
||||
while( str && *str )
|
||||
{
|
||||
*str = (char)toupper(*str);
|
||||
str++;
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
inline char *strlwr( char *start )
|
||||
{
|
||||
char *str = start;
|
||||
while( str && *str )
|
||||
{
|
||||
*str = (char)tolower(*str);
|
||||
str++;
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
#endif // _LINUX
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Portable versions of standard string functions
|
||||
@ -63,31 +88,6 @@ int _V_wcslen ( const char* file, int line, const wchar_t *pwch );
|
||||
|
||||
#else
|
||||
|
||||
#ifdef _LINUX
|
||||
inline char *strupr( char *start )
|
||||
{
|
||||
char *str = start;
|
||||
while( str && *str )
|
||||
{
|
||||
*str = (char)toupper(*str);
|
||||
str++;
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
inline char *strlwr( char *start )
|
||||
{
|
||||
char *str = start;
|
||||
while( str && *str )
|
||||
{
|
||||
*str = (char)tolower(*str);
|
||||
str++;
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
#endif // _LINUX
|
||||
|
||||
inline void V_memset (void *dest, int fill, int count) { memset( dest, fill, count ); }
|
||||
inline void V_memcpy (void *dest, const void *src, int count) { memcpy( dest, src, count ); }
|
||||
inline void V_memmove (void *dest, const void *src, int count) { memmove( dest, src, count ); }
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user