mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
arm64 : fix intptr_t size
This commit is contained in:
@@ -53,8 +53,8 @@ public:
|
||||
DELEGATE_TO_OBJECT_0( int, heapchk, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_0( bool, IsDebugHeap, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_2V( GetActualDbgInfo, const char *&, int &, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_5V( RegisterAllocation, const char *, int, int, int, unsigned, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_5V( RegisterDeallocation, const char *, int, int, int, unsigned, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_5V( RegisterAllocation, const char *, int, size_t, size_t, unsigned, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_5V( RegisterDeallocation, const char *, int, size_t, size_t, unsigned, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_0( int, GetVersion, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_0V( CompactHeap, m_pMemAlloc );
|
||||
DELEGATE_TO_OBJECT_1( MemAllocFailHandler_t, SetAllocFailHandler, MemAllocFailHandler_t, m_pMemAlloc );
|
||||
|
||||
+10
-10
@@ -208,8 +208,8 @@ protected:
|
||||
public:
|
||||
struct ModelFileHandleHash
|
||||
{
|
||||
uint operator()( model_t *p ) const { return Mix32HashFunctor()( (uint32)( p->fnHandle ) ); }
|
||||
uint operator()( FileNameHandle_t fn ) const { return Mix32HashFunctor()( (uint32) fn ); }
|
||||
uint operator()( model_t *p ) const { return PointerHashFunctor()( p->fnHandle ); }
|
||||
uint operator()( FileNameHandle_t fn ) const { return PointerHashFunctor()( fn ); }
|
||||
};
|
||||
struct ModelFileHandleEq
|
||||
{
|
||||
@@ -532,7 +532,7 @@ const studiohdr_t *CModelInfo::FindModel( const studiohdr_t *pStudioHdr, void **
|
||||
//-----------------------------------------------------------------------------
|
||||
const studiohdr_t *CModelInfo::FindModel( void *cache ) const
|
||||
{
|
||||
return g_pMDLCache->GetStudioHdr( (MDLHandle_t)(int)cache&0xffff );
|
||||
return g_pMDLCache->GetStudioHdr( VoidPtrToMDLHandle( cache ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ const studiohdr_t *CModelInfo::FindModel( void *cache ) const
|
||||
//-----------------------------------------------------------------------------
|
||||
virtualmodel_t *CModelInfo::GetVirtualModel( const studiohdr_t *pStudioHdr ) const
|
||||
{
|
||||
MDLHandle_t handle = (MDLHandle_t)(int)pStudioHdr->virtualModel&0xffff;
|
||||
MDLHandle_t handle = VoidPtrToMDLHandle( pStudioHdr->VirtualModel() );
|
||||
return g_pMDLCache->GetVirtualModelFast( pStudioHdr, handle );
|
||||
}
|
||||
|
||||
@@ -550,13 +550,13 @@ virtualmodel_t *CModelInfo::GetVirtualModel( const studiohdr_t *pStudioHdr ) con
|
||||
//-----------------------------------------------------------------------------
|
||||
byte *CModelInfo::GetAnimBlock( const studiohdr_t *pStudioHdr, int nBlock ) const
|
||||
{
|
||||
MDLHandle_t handle = (MDLHandle_t)(int)pStudioHdr->virtualModel&0xffff;
|
||||
MDLHandle_t handle = VoidPtrToMDLHandle( pStudioHdr->VirtualModel() );
|
||||
return g_pMDLCache->GetAnimBlock( handle, nBlock );
|
||||
}
|
||||
|
||||
int CModelInfo::GetAutoplayList( const studiohdr_t *pStudioHdr, unsigned short **pAutoplayList ) const
|
||||
{
|
||||
MDLHandle_t handle = (MDLHandle_t)(int)pStudioHdr->virtualModel&0xffff;
|
||||
MDLHandle_t handle = VoidPtrToMDLHandle( pStudioHdr->VirtualModel() );
|
||||
return g_pMDLCache->GetAutoplayList( handle, pAutoplayList );
|
||||
}
|
||||
|
||||
@@ -576,22 +576,22 @@ virtualmodel_t *studiohdr_t::GetVirtualModel( void ) const
|
||||
{
|
||||
if ( numincludemodels == 0 )
|
||||
return NULL;
|
||||
return g_pMDLCache->GetVirtualModelFast( this, (MDLHandle_t)(int)virtualModel&0xffff );
|
||||
return g_pMDLCache->GetVirtualModelFast( this, VoidPtrToMDLHandle( VirtualModel() ) );
|
||||
}
|
||||
|
||||
byte *studiohdr_t::GetAnimBlock( int i ) const
|
||||
{
|
||||
return g_pMDLCache->GetAnimBlock( (MDLHandle_t)(int)virtualModel&0xffff, i );
|
||||
return g_pMDLCache->GetAnimBlock( VoidPtrToMDLHandle( VirtualModel() ), i );
|
||||
}
|
||||
|
||||
int studiohdr_t::GetAutoplayList( unsigned short **pOut ) const
|
||||
{
|
||||
return g_pMDLCache->GetAutoplayList( (MDLHandle_t)(int)virtualModel&0xffff, pOut );
|
||||
return g_pMDLCache->GetAutoplayList( VoidPtrToMDLHandle( VirtualModel() ), pOut );
|
||||
}
|
||||
|
||||
const studiohdr_t *virtualgroup_t::GetStudioHdr( void ) const
|
||||
{
|
||||
return g_pMDLCache->GetStudioHdr( (MDLHandle_t)(int)cache&0xffff );
|
||||
return g_pMDLCache->GetStudioHdr( VoidPtrToMDLHandle( cache ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1962,7 +1962,7 @@ public:
|
||||
{
|
||||
int m_channelNum;
|
||||
int m_vol; // max volume of sound. -1 means "do not cull, ever, do not even do the math"
|
||||
unsigned int m_nameHash; // a unique id for a sound file
|
||||
uintp m_nameHash; // a unique id for a sound file
|
||||
};
|
||||
protected:
|
||||
sChannelVolData m_channelInfo[MAX_CHANNELS];
|
||||
@@ -1994,7 +1994,7 @@ void CChannelCullList::Initialize( CChannelList &list )
|
||||
{
|
||||
m_channelInfo[i].m_vol = ChannelLoudestCurVolume(ch);
|
||||
AssertMsg(m_channelInfo[i].m_vol >= 0, "Sound channel has a negative volume?");
|
||||
m_channelInfo[i].m_nameHash = (unsigned int) ch->sfx;
|
||||
m_channelInfo[i].m_nameHash = (uintp) ch->sfx;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2029,7 +2029,7 @@ void CChannelCullList::Initialize( CChannelList &list )
|
||||
++j )
|
||||
{
|
||||
// j steps through the sorted list until we find ourselves:
|
||||
if (m_channelInfo[j].m_nameHash == (unsigned int)(ch->sfx))
|
||||
if (m_channelInfo[j].m_nameHash == (uintp)(ch->sfx))
|
||||
{
|
||||
// that's another channel playing this sound but louder than me
|
||||
++howManyLouder;
|
||||
|
||||
@@ -93,7 +93,7 @@ CAudioSourceMP3::CAudioSourceMP3( CSfxTable *pSfx )
|
||||
|
||||
m_dataStart = 0;
|
||||
|
||||
int file = g_pSndIO->open( pSfx->GetFileName() );
|
||||
intp file = g_pSndIO->open( pSfx->GetFileName() );
|
||||
if ( file != -1 )
|
||||
{
|
||||
m_dataSize = g_pSndIO->size( file );
|
||||
@@ -239,7 +239,7 @@ void CAudioSourceMP3::GetCacheData( CAudioSourceCachedInfo *info )
|
||||
info->SetSampleRate( m_sampleRate );
|
||||
info->SetDataStart( 0 );
|
||||
|
||||
int file = g_pSndIO->open( m_pSfx->GetFileName() );
|
||||
intp file = g_pSndIO->open( m_pSfx->GetFileName() );
|
||||
if ( !file )
|
||||
{
|
||||
Warning( "Failed to find file for building soundcache [ %s ]\n", m_pSfx->GetFileName() );
|
||||
|
||||
@@ -723,7 +723,7 @@ bool CAudioSourceWave::GetStartupData( void *dest, int destsize, int& bytesCopie
|
||||
// requesting precache snippet as leader for streaming startup latency
|
||||
if ( destsize )
|
||||
{
|
||||
int file = g_pSndIO->open( m_pSfx->GetFileName() );
|
||||
intp file = g_pSndIO->open( m_pSfx->GetFileName() );
|
||||
if ( !file )
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -141,7 +141,7 @@ bool CMixerControls::GetValue_Float(Control iControl, float &value)
|
||||
case MicVolume:
|
||||
{
|
||||
OSStatus theError = noErr;
|
||||
for ( int iChannel = 0; iChannel < 3; iChannel++ )
|
||||
for ( uint iChannel = 0; iChannel < 3; iChannel++ )
|
||||
{
|
||||
// scan the channel list until you find a channel set to non-zero, then use that
|
||||
Float32 theVolume = 0;
|
||||
|
||||
+1
-1
@@ -645,7 +645,7 @@ void Cmd_Exec_f( const CCommand &args )
|
||||
ConDMsg( "execing %s\n", szFile );
|
||||
|
||||
// check to make sure we're not going to overflow the cmd_text buffer
|
||||
int hCommand = s_CommandBuffer.GetNextCommandHandle();
|
||||
CommandHandle_t hCommand = s_CommandBuffer.GetNextCommandHandle();
|
||||
|
||||
// Execute each command immediately
|
||||
const char *pszDataPtr = f;
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
// Fill out the meshlist for this terrain patch
|
||||
virtual void GetVirtualMesh( void *userData, virtualmeshlist_t *pList )
|
||||
{
|
||||
int index = (int)userData;
|
||||
intp index = (intp)userData;
|
||||
Assert(index >= 0 && index < g_DispCollTreeCount );
|
||||
g_pDispCollTrees[index].GetVirtualMeshList( pList );
|
||||
pList->pHull = NULL;
|
||||
@@ -243,14 +243,14 @@ public:
|
||||
// returns the bounds for the terrain patch
|
||||
virtual void GetWorldspaceBounds( void *userData, Vector *pMins, Vector *pMaxs )
|
||||
{
|
||||
int index = (int)userData;
|
||||
intp index = (intp)userData;
|
||||
*pMins = g_pDispBounds[index].mins;
|
||||
*pMaxs = g_pDispBounds[index].maxs;
|
||||
}
|
||||
// Query against the AABB tree to find the list of triangles for this patch in a sphere
|
||||
virtual void GetTrianglesInSphere( void *userData, const Vector ¢er, float radius, virtualmeshtrianglelist_t *pList )
|
||||
{
|
||||
int index = (int)userData;
|
||||
intp index = (intp)userData;
|
||||
pList->triangleCount = g_pDispCollTrees[index].AABBTree_GetTrisInSphere( center, radius, pList->triangleIndices, ARRAYSIZE(pList->triangleIndices) );
|
||||
}
|
||||
void LevelInit( dphysdisp_t *pLump, int lumpSize )
|
||||
|
||||
@@ -4895,7 +4895,7 @@ void CColorOperationListPanel::PopulateList( )
|
||||
KeyValues *kv = new KeyValues( "operation", "layer", op->GetName() );
|
||||
kv->SetInt( "image", (op->IsEnabled())?1:0 );
|
||||
|
||||
m_pOperationListPanel->AddItem( kv, (unsigned int)op, false, false );
|
||||
m_pOperationListPanel->AddItem( kv, (uintp)op, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -547,9 +547,9 @@ bool CDispInfo::Render( CGroupMesh *pGroup, bool bAllowDebugModes )
|
||||
VectorAdd( bbMin, bbMax, vecCenter );
|
||||
vecCenter *= 0.5f;
|
||||
|
||||
int nInt = ( mat_surfaceid.GetInt() != 2 ) ? (int)m_ParentSurfID : (msurface2_t*)m_ParentSurfID - host_state.worldbrush->surfaces2;
|
||||
intp nInt = ( mat_surfaceid.GetInt() != 2 ) ? (intp)m_ParentSurfID : (msurface2_t*)m_ParentSurfID - host_state.worldbrush->surfaces2;
|
||||
char buf[32];
|
||||
Q_snprintf( buf, sizeof( buf ), "%d", nInt );
|
||||
Q_snprintf( buf, sizeof( buf ), "%d", (int)nInt );
|
||||
CDebugOverlay::AddTextOverlay( vecCenter, 0, buf );
|
||||
}
|
||||
|
||||
|
||||
@@ -764,7 +764,7 @@ void DispInfo_BatchDecals( CDispInfo **pVisibleDisps, int nVisibleDisps )
|
||||
// There is only one group at a time.
|
||||
int iGroup = 0;
|
||||
|
||||
int iPool = g_aDispDecalSortPool.Alloc( true );
|
||||
intp iPool = g_aDispDecalSortPool.Alloc( true );
|
||||
g_aDispDecalSortPool[iPool] = decal.m_pDecal;
|
||||
|
||||
int iSortTree = decal.m_pDecal->m_iSortTree;
|
||||
@@ -773,7 +773,7 @@ void DispInfo_BatchDecals( CDispInfo **pVisibleDisps, int nVisibleDisps )
|
||||
DecalMaterialBucket_t &materialBucket = g_aDispDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iSortMaterial );
|
||||
if ( materialBucket.m_nCheckCount == g_nDispDecalSortCheckCount )
|
||||
{
|
||||
int iHead = materialBucket.m_iHead;
|
||||
intp iHead = materialBucket.m_iHead;
|
||||
g_aDispDecalSortPool.LinkBefore( iHead, iPool );
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ void DispInfo_DrawDecalsGroup( int iGroup, int iTreeType )
|
||||
if ( materialBucketList.Element( iBucket ).m_nCheckCount != g_nDispDecalSortCheckCount )
|
||||
continue;
|
||||
|
||||
int iHead = materialBucketList.Element( iBucket ).m_iHead;
|
||||
intp iHead = materialBucketList.Element( iBucket ).m_iHead;
|
||||
if ( !g_aDispDecalSortPool.IsValidIndex( iHead ) )
|
||||
continue;
|
||||
|
||||
@@ -863,7 +863,7 @@ void DispInfo_DrawDecalsGroup( int iGroup, int iTreeType )
|
||||
bool bBatchInit = true;
|
||||
|
||||
int nCount;
|
||||
int iElement = iHead;
|
||||
intp iElement = iHead;
|
||||
while ( iElement != g_aDispDecalSortPool.InvalidIndex() )
|
||||
{
|
||||
decal_t *pDecal = g_aDispDecalSortPool.Element( iElement );
|
||||
@@ -1300,7 +1300,7 @@ int DispInfo_ComputeIndex( HDISPINFOARRAY hArray, IDispInfo* pInfo )
|
||||
if( !pArray )
|
||||
return NULL;
|
||||
|
||||
int iElement = ((int)pInfo - (int)(pArray->m_pDispInfos)) / sizeof(CDispInfo);
|
||||
intp iElement = ((intp)pInfo - (intp)(pArray->m_pDispInfos)) / sizeof(CDispInfo);
|
||||
|
||||
Assert( iElement >= 0 && iElement < pArray->m_nDispInfos );
|
||||
return iElement;
|
||||
|
||||
+5
-5
@@ -924,12 +924,12 @@ void CDownloadManager::StartNewDownload()
|
||||
m_lastPercent = 0;
|
||||
|
||||
// Start the thread
|
||||
DWORD threadID;
|
||||
uintp threadID;
|
||||
VCRHook_CreateThread(NULL, 0,
|
||||
#ifdef POSIX
|
||||
(void *)
|
||||
#endif
|
||||
DownloadThread, m_activeRequest, 0, (unsigned long int *)&threadID );
|
||||
DownloadThread, m_activeRequest, 0, &threadID );
|
||||
|
||||
ThreadDetach( ( ThreadHandle_t )threadID );
|
||||
}
|
||||
@@ -1070,14 +1070,14 @@ bool CL_IsGamePathValidAndSafeForDownload( const char *pGamePath )
|
||||
class CDownloadSystem : public IDownloadSystem
|
||||
{
|
||||
public:
|
||||
virtual DWORD CreateDownloadThread( RequestContext_t *pContext )
|
||||
virtual uintp CreateDownloadThread( RequestContext_t *pContext )
|
||||
{
|
||||
DWORD nThreadID;
|
||||
uintp nThreadID;
|
||||
VCRHook_CreateThread(NULL, 0,
|
||||
#ifdef POSIX
|
||||
(void*)
|
||||
#endif
|
||||
DownloadThread, pContext, 0, (unsigned long int *)&nThreadID );
|
||||
DownloadThread, pContext, 0, (uintp *)&nThreadID );
|
||||
|
||||
ThreadDetach( ( ThreadHandle_t )nThreadID );
|
||||
return nThreadID;
|
||||
|
||||
@@ -175,12 +175,12 @@ void BuildPropOffsetToIndexMap( CSendTablePrecalc *pPrecalc, const CStandardSend
|
||||
{
|
||||
const SendProp *pProp = pPrecalc->m_Props[i];
|
||||
|
||||
int offset = pProp->GetOffset() + (int)pmStack.GetCurStructBase() - 1;
|
||||
intp offset = pProp->GetOffset() + (intp)pmStack.GetCurStructBase() - 1;
|
||||
int elementCount = 1;
|
||||
int elementStride = 0;
|
||||
if ( pProp->GetType() == DPT_Array )
|
||||
{
|
||||
offset = pProp->GetArrayProp()->GetOffset() + (int)pmStack.GetCurStructBase() - 1;
|
||||
offset = pProp->GetArrayProp()->GetOffset() + (intp)pmStack.GetCurStructBase() - 1;
|
||||
elementCount = pProp->m_nElements;
|
||||
elementStride = pProp->m_ElementStride;
|
||||
}
|
||||
|
||||
+12
-12
@@ -4747,7 +4747,7 @@ struct EnumLeafBoxInfo_t
|
||||
VectorAligned m_vecBoxCenter;
|
||||
VectorAligned m_vecBoxHalfDiagonal;
|
||||
ISpatialLeafEnumerator *m_pIterator;
|
||||
int m_nContext;
|
||||
intp m_nContext;
|
||||
};
|
||||
|
||||
struct EnumLeafSphereInfo_t
|
||||
@@ -4757,7 +4757,7 @@ struct EnumLeafSphereInfo_t
|
||||
Vector m_vecBoxCenter;
|
||||
Vector m_vecBoxHalfDiagonal;
|
||||
ISpatialLeafEnumerator *m_pIterator;
|
||||
int m_nContext;
|
||||
intp m_nContext;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -5094,7 +5094,7 @@ bool EnumerateLeafInSphere_R( mnode_t *node, EnumLeafSphereInfo_t& info, int nTe
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static bool EnumerateLeavesAlongRay_R( mnode_t *node, Ray_t const& ray,
|
||||
float start, float end, ISpatialLeafEnumerator* pEnum, int context )
|
||||
float start, float end, ISpatialLeafEnumerator* pEnum, intp context )
|
||||
{
|
||||
// no polygons in solid nodes (don't report these leaves either)
|
||||
if (node->contents == CONTENTS_SOLID)
|
||||
@@ -5153,7 +5153,7 @@ static bool EnumerateLeavesAlongRay_R( mnode_t *node, Ray_t const& ray,
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static bool EnumerateLeavesAlongExtrudedRay_R( mnode_t *node, Ray_t const& ray,
|
||||
float start, float end, ISpatialLeafEnumerator* pEnum, int context )
|
||||
float start, float end, ISpatialLeafEnumerator* pEnum, intp context )
|
||||
{
|
||||
// no polygons in solid nodes (don't report these leaves either)
|
||||
if (node->contents == CONTENTS_SOLID)
|
||||
@@ -5276,10 +5276,10 @@ public:
|
||||
int LeafCount() const;
|
||||
|
||||
// Enumerates the leaves along a ray, box, etc.
|
||||
bool EnumerateLeavesAtPoint( const Vector& pt, ISpatialLeafEnumerator* pEnum, int context );
|
||||
bool EnumerateLeavesInBox( const Vector& mins, const Vector& maxs, ISpatialLeafEnumerator* pEnum, int context );
|
||||
bool EnumerateLeavesInSphere( const Vector& center, float radius, ISpatialLeafEnumerator* pEnum, int context );
|
||||
bool EnumerateLeavesAlongRay( Ray_t const& ray, ISpatialLeafEnumerator* pEnum, int context );
|
||||
bool EnumerateLeavesAtPoint( const Vector& pt, ISpatialLeafEnumerator* pEnum, intp context );
|
||||
bool EnumerateLeavesInBox( const Vector& mins, const Vector& maxs, ISpatialLeafEnumerator* pEnum, intp context );
|
||||
bool EnumerateLeavesInSphere( const Vector& center, float radius, ISpatialLeafEnumerator* pEnum, intp context );
|
||||
bool EnumerateLeavesAlongRay( Ray_t const& ray, ISpatialLeafEnumerator* pEnum, intp context );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -5304,7 +5304,7 @@ int CEngineBSPTree::LeafCount() const
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool CEngineBSPTree::EnumerateLeavesAtPoint( const Vector& pt,
|
||||
ISpatialLeafEnumerator* pEnum, int context )
|
||||
ISpatialLeafEnumerator* pEnum, intp context )
|
||||
{
|
||||
int leaf = CM_PointLeafnum( pt );
|
||||
return pEnum->EnumerateLeaf( leaf, context );
|
||||
@@ -5315,7 +5315,7 @@ static ConVar opt_EnumerateLeavesFastAlgorithm( "opt_EnumerateLeavesFastAlgorith
|
||||
|
||||
|
||||
bool CEngineBSPTree::EnumerateLeavesInBox( const Vector& mins, const Vector& maxs,
|
||||
ISpatialLeafEnumerator* pEnum, int context )
|
||||
ISpatialLeafEnumerator* pEnum, intp context )
|
||||
{
|
||||
if ( !host_state.worldmodel )
|
||||
return false;
|
||||
@@ -5340,7 +5340,7 @@ bool CEngineBSPTree::EnumerateLeavesInBox( const Vector& mins, const Vector& max
|
||||
|
||||
|
||||
bool CEngineBSPTree::EnumerateLeavesInSphere( const Vector& center, float radius,
|
||||
ISpatialLeafEnumerator* pEnum, int context )
|
||||
ISpatialLeafEnumerator* pEnum, intp context )
|
||||
{
|
||||
EnumLeafSphereInfo_t info;
|
||||
info.m_vecCenter = center;
|
||||
@@ -5354,7 +5354,7 @@ bool CEngineBSPTree::EnumerateLeavesInSphere( const Vector& center, float radius
|
||||
}
|
||||
|
||||
|
||||
bool CEngineBSPTree::EnumerateLeavesAlongRay( Ray_t const& ray, ISpatialLeafEnumerator* pEnum, int context )
|
||||
bool CEngineBSPTree::EnumerateLeavesAlongRay( Ray_t const& ray, ISpatialLeafEnumerator* pEnum, intp context )
|
||||
{
|
||||
if (!ray.m_IsSwept)
|
||||
{
|
||||
|
||||
+2
-2
@@ -872,7 +872,7 @@ public:
|
||||
virtual void SetupLighting( const Vector &vecCenter );
|
||||
virtual void SuppressEngineLighting( bool bSuppress );
|
||||
|
||||
inline vertexFileHeader_t *CacheVertexData() { return g_pMDLCache->GetVertexData( (MDLHandle_t)(int)m_pStudioHdr->virtualModel&0xffff ); }
|
||||
inline vertexFileHeader_t *CacheVertexData() { return g_pMDLCache->GetVertexData( VoidPtrToMDLHandle( m_pStudioHdr->VirtualModel() ) ); }
|
||||
|
||||
bool Init();
|
||||
void Shutdown();
|
||||
@@ -4121,7 +4121,7 @@ bool CModelRender::UpdateStaticPropColorData( IHandleEntity *pProp, ModelInstanc
|
||||
if ( !bDebugColor )
|
||||
{
|
||||
// vertexes must be available for lighting calculation
|
||||
vertexFileHeader_t *pVertexHdr = g_pMDLCache->GetVertexData( (MDLHandle_t)(int)pStudioHdr->virtualModel&0xffff );
|
||||
vertexFileHeader_t *pVertexHdr = g_pMDLCache->GetVertexData( VoidPtrToMDLHandle( pStudioHdr->VirtualModel() ) );
|
||||
if ( !pVertexHdr )
|
||||
{
|
||||
// data not available yet
|
||||
|
||||
+10
-3
@@ -1869,6 +1869,12 @@ void Mod_LoadFaces( void )
|
||||
|
||||
// align these allocations
|
||||
// If you trip one of these, you need to rethink the alignment of the struct
|
||||
#ifdef PLATFORM_64BITS
|
||||
msurface1_t *out1 = Hunk_AllocNameAlignedClear< msurface1_t >( count, alignof(msurface1_t), va( "%s [%s]", lh.GetLoadName(), "surface1" ) );
|
||||
msurface2_t *out2 = Hunk_AllocNameAlignedClear< msurface2_t >( count, alignof(msurface2_t), va( "%s [%s]", lh.GetLoadName(), "surface2" ) );
|
||||
|
||||
msurfacelighting_t *pLighting = Hunk_AllocNameAlignedClear< msurfacelighting_t >( count, alignof(msurfacelighting_t), va( "%s [%s]", lh.GetLoadName(), "surfacelighting" ) );
|
||||
#else
|
||||
Assert( sizeof(msurface1_t) == 16 );
|
||||
Assert( sizeof(msurface2_t) == 32 );
|
||||
Assert( sizeof(msurfacelighting_t) == 32 );
|
||||
@@ -1877,6 +1883,7 @@ void Mod_LoadFaces( void )
|
||||
msurface2_t *out2 = Hunk_AllocNameAlignedClear< msurface2_t >( count, 32, va( "%s [%s]", lh.GetLoadName(), "surface2" ) );
|
||||
|
||||
msurfacelighting_t *pLighting = Hunk_AllocNameAlignedClear< msurfacelighting_t >( count, 32, va( "%s [%s]", lh.GetLoadName(), "surfacelighting" ) );
|
||||
#endif
|
||||
|
||||
lh.GetMap()->surfaces1 = out1;
|
||||
lh.GetMap()->surfaces2 = out2;
|
||||
@@ -2860,7 +2867,7 @@ void Mod_TouchAllData( model_t *pModel, int nServerCount )
|
||||
// skip self, start at children
|
||||
for ( int i=1; i<pVirtualModel->m_group.Count(); ++i )
|
||||
{
|
||||
MDLHandle_t childHandle = (MDLHandle_t)(int)pVirtualModel->m_group[i].cache&0xffff;
|
||||
MDLHandle_t childHandle = (MDLHandle_t)(intp)pVirtualModel->m_group[i].cache&0xffff;
|
||||
model_t *pChildModel = (model_t *)g_pMDLCache->GetUserData( childHandle );
|
||||
if ( pChildModel )
|
||||
{
|
||||
@@ -4325,7 +4332,7 @@ public:
|
||||
m_pShared = pBrush->brush.pShared;
|
||||
m_count = 0;
|
||||
}
|
||||
bool EnumerateLeaf( int leaf, int )
|
||||
bool EnumerateLeaf( int leaf, intp )
|
||||
{
|
||||
// garymcthack - need to test identity brush models
|
||||
int flags = ( m_pShared->leafs[leaf].leafWaterDataID == -1 ) ? SURFDRAW_ABOVEWATER : SURFDRAW_UNDERWATER;
|
||||
@@ -4372,7 +4379,7 @@ static void MarkBrushModelWaterSurfaces( model_t* world,
|
||||
model_t* pTemp = host_state.worldmodel;
|
||||
CBrushBSPIterator brushIterator( world, brush );
|
||||
host_state.SetWorldModel( world );
|
||||
g_pToolBSPTree->EnumerateLeavesInBox( mins, maxs, &brushIterator, (int)brush );
|
||||
g_pToolBSPTree->EnumerateLeavesInBox( mins, maxs, &brushIterator, (intp)brush );
|
||||
brushIterator.CheckSurfaces();
|
||||
host_state.SetWorldModel( pTemp );
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
CPureServerWhitelist::CCommand *pBestEntry );
|
||||
|
||||
unsigned short m_LoadCounter; // Incremented as we load things so their m_LoadOrder increases.
|
||||
volatile long int m_RefCount;
|
||||
volatile int32 m_RefCount;
|
||||
|
||||
// Commands are applied to files in order.
|
||||
CUtlDict<CCommand*,int> m_FileCommands; // file commands
|
||||
|
||||
+8
-8
@@ -2001,9 +2001,9 @@ void R_DrawDecalsAllImmediate_GatherDecals( IMatRenderContext *pRenderContext, i
|
||||
if ( g_aDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iBucket ).m_nCheckCount != nCheckCount )
|
||||
continue;
|
||||
|
||||
int iHead = g_aDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iBucket ).m_iHead;
|
||||
intp iHead = g_aDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iBucket ).m_iHead;
|
||||
|
||||
int iElement = iHead;
|
||||
intp iElement = iHead;
|
||||
while ( iElement != g_aDecalSortPool.InvalidIndex() )
|
||||
{
|
||||
decal_t *pDecal = g_aDecalSortPool.Element( iElement );
|
||||
@@ -2155,10 +2155,10 @@ void R_DrawDecalsAllImmediate( IMatRenderContext *pRenderContext, int iGroup, in
|
||||
if ( g_aDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iBucket ).m_nCheckCount != nCheckCount )
|
||||
continue;
|
||||
|
||||
int iHead = g_aDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iBucket ).m_iHead;
|
||||
intp iHead = g_aDecalSortTrees[iSortTree].m_aDecalSortBuckets[iGroup][iTreeType].Element( iBucket ).m_iHead;
|
||||
|
||||
int nCount;
|
||||
int iElement = iHead;
|
||||
intp iElement = iHead;
|
||||
while ( iElement != g_aDecalSortPool.InvalidIndex() )
|
||||
{
|
||||
decal_t *pDecal = g_aDecalSortPool.Element( iElement );
|
||||
@@ -2330,7 +2330,7 @@ void R_DrawDecalsAll_GatherDecals( IMatRenderContext *pRenderContext, int iGroup
|
||||
if ( bucket.m_nCheckCount != nCheckCount )
|
||||
continue;
|
||||
|
||||
int iHead = bucket.m_iHead;
|
||||
intp iHead = bucket.m_iHead;
|
||||
if ( !g_aDecalSortPool.IsValidIndex( iHead ) )
|
||||
continue;
|
||||
|
||||
@@ -2346,7 +2346,7 @@ void R_DrawDecalsAll_GatherDecals( IMatRenderContext *pRenderContext, int iGroup
|
||||
|
||||
DrawDecals.AddToTail( DECALMARKERS_SWITCHBUCKET );
|
||||
|
||||
int iElement = iHead;
|
||||
intp iElement = iHead;
|
||||
while ( iElement != g_aDecalSortPool.InvalidIndex() )
|
||||
{
|
||||
decal_t *pDecal = g_aDecalSortPool.Element( iElement );
|
||||
@@ -3015,7 +3015,7 @@ void DecalSurfaceAdd( SurfaceHandle_t surfID, int iGroup )
|
||||
}
|
||||
|
||||
pDecal->flags &= ~FDECAL_HASUPDATED;
|
||||
int iPool = g_aDecalSortPool.Alloc( true );
|
||||
intp iPool = g_aDecalSortPool.Alloc( true );
|
||||
if ( iPool != g_aDecalSortPool.InvalidIndex() )
|
||||
{
|
||||
g_aDecalSortPool[iPool] = pDecal;
|
||||
@@ -3024,7 +3024,7 @@ void DecalSurfaceAdd( SurfaceHandle_t surfID, int iGroup )
|
||||
DecalMaterialBucket_t &bucket = sortTree.m_aDecalSortBuckets[iGroup][iTreeType].Element( pDecal->m_iSortMaterial );
|
||||
if ( bucket.m_nCheckCount == nCheckCount )
|
||||
{
|
||||
int iHead = bucket.m_iHead;
|
||||
intp iHead = bucket.m_iHead;
|
||||
g_aDecalSortPool.LinkBefore( iHead, iPool );
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -74,7 +74,7 @@ struct DecalMaterialSortData_t
|
||||
|
||||
struct DecalMaterialBucket_t
|
||||
{
|
||||
int m_iHead;
|
||||
intp m_iHead;
|
||||
int m_nCheckCount;
|
||||
};
|
||||
|
||||
@@ -82,16 +82,16 @@ inline bool DecalSortTreeSortLessFunc( const DecalMaterialSortData_t &decal1, co
|
||||
{
|
||||
if ( ( decal1.m_iLightmapPage == -1 ) || ( decal2.m_iLightmapPage == -1 ) )
|
||||
{
|
||||
return ( ( int )decal1.m_pMaterial < ( int )decal2.m_pMaterial );
|
||||
return ( ( intp )decal1.m_pMaterial < ( intp )decal2.m_pMaterial );
|
||||
}
|
||||
|
||||
if ( ( int )decal1.m_pMaterial == ( int )decal2.m_pMaterial )
|
||||
if ( ( intp )decal1.m_pMaterial == ( intp )decal2.m_pMaterial )
|
||||
{
|
||||
return ( decal1.m_iLightmapPage < decal2.m_iLightmapPage );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( ( int )decal1.m_pMaterial < ( int )decal2.m_pMaterial );
|
||||
return ( ( intp )decal1.m_pMaterial < ( intp )decal2.m_pMaterial );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ private:
|
||||
CSaveDirectory *m_pSaveDirectory;
|
||||
CUtlMap<CUtlSymbol, SaveFile_t> &GetDirectory( void ) { return m_pSaveDirectory->m_Files; }
|
||||
SaveFile_t &GetFile( const int idx ) { return m_pSaveDirectory->m_Files[idx]; }
|
||||
SaveFile_t &GetFile( const FileHandle_t hFile ) { return GetFile( (unsigned int)hFile ); }
|
||||
SaveFile_t &GetFile( const FileHandle_t hFile ) { return GetFile( (uintp)hFile ); }
|
||||
|
||||
FileHandle_t GetFileHandle( const char *pFileName );
|
||||
int GetFileIndex( const char *pFileName );
|
||||
@@ -331,7 +331,7 @@ bool CSaveRestoreFileSystem::FileExists( const char *pFileName, const char *pPat
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CSaveRestoreFileSystem::HandleIsValid( FileHandle_t hFile )
|
||||
{
|
||||
return hFile && GetDirectory().IsValidIndex( (unsigned int)hFile );
|
||||
return hFile && GetDirectory().IsValidIndex( (uintp)hFile );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -588,7 +588,7 @@ FSAsyncStatus_t CSaveRestoreFileSystem::AsyncWrite( const char *pFileName, const
|
||||
FileHandle_t hFile = Open( pFileName, "wb" );
|
||||
if ( hFile )
|
||||
{
|
||||
SaveFile_t &file = GetFile( (unsigned int)hFile );
|
||||
SaveFile_t &file = GetFile( (uintp)hFile );
|
||||
|
||||
if( file.eType == WRITE_ONLY )
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
virtual unsigned short InvalidShadowIndex( );
|
||||
|
||||
// Methods of ISpatialLeafEnumerator
|
||||
virtual bool EnumerateLeaf( int leaf, int context );
|
||||
virtual bool EnumerateLeaf( int leaf, intp context );
|
||||
|
||||
// Sets the texture coordinate range for a shadow...
|
||||
virtual void SetShadowTexCoord( ShadowHandle_t handle, float x, float y, float w, float h );
|
||||
@@ -605,7 +605,7 @@ void CShadowMgr::SetMaterial( Shadow_t& shadow, IMaterial* pMaterial, IMaterial*
|
||||
}
|
||||
|
||||
// Search the sort order handles for an enumeration id match
|
||||
int materialEnum = (int)pMaterial;
|
||||
int materialEnum = (intp)pMaterial;
|
||||
for (unsigned short i = m_SortOrderIds.Head(); i != m_SortOrderIds.InvalidIndex();
|
||||
i = m_SortOrderIds.Next(i) )
|
||||
{
|
||||
@@ -1536,7 +1536,7 @@ void CShadowMgr::ProjectShadow( ShadowHandle_t handle, const Vector &origin,
|
||||
for ( int i = 0; i < nLeafCount; ++i )
|
||||
{
|
||||
// NOTE: Scope specifier eliminates virtual function call
|
||||
CShadowMgr::EnumerateLeaf( pLeafList[i], (int)&build );
|
||||
CShadowMgr::EnumerateLeaf( pLeafList[i], (intp)&build );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1650,7 +1650,7 @@ void CShadowMgr::ProjectFlashlight( ShadowHandle_t handle, const VMatrix& worldT
|
||||
for ( int i = 0; i < nLeafCount; ++i )
|
||||
{
|
||||
// NOTE: Scope specifier eliminates virtual function call
|
||||
CShadowMgr::EnumerateLeaf( pLeafList[i], (int)&build );
|
||||
CShadowMgr::EnumerateLeaf( pLeafList[i], (intp)&build );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1809,7 +1809,7 @@ void CShadowMgr::ApplyShadowToLeaf( const Shadow_t &shadow, mleaf_t* RESTRICT pL
|
||||
//-----------------------------------------------------------------------------
|
||||
// Applies a projected texture to all surfaces in the leaf
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CShadowMgr::EnumerateLeaf( int leaf, int context )
|
||||
bool CShadowMgr::EnumerateLeaf( int leaf, intp context )
|
||||
{
|
||||
VPROF( "CShadowMgr::EnumerateLeaf" );
|
||||
ShadowBuildInfo_t* pBuild = (ShadowBuildInfo_t*)context;
|
||||
|
||||
+13
-13
@@ -20,17 +20,17 @@
|
||||
class COM_IOReadBinary : public IFileReadBinary
|
||||
{
|
||||
public:
|
||||
int open( const char *pFileName );
|
||||
int read( void *pOutput, int size, int file );
|
||||
void seek( int file, int pos );
|
||||
unsigned int tell( int file );
|
||||
unsigned int size( int file );
|
||||
void close( int file );
|
||||
intp open( const char *pFileName );
|
||||
int read( void *pOutput, int size, intp file );
|
||||
void seek( intp file, int pos );
|
||||
unsigned int tell( intp file );
|
||||
unsigned int size( intp file );
|
||||
void close( intp file );
|
||||
};
|
||||
|
||||
|
||||
// prepend sound/ to the filename -- all sounds are loaded from the sound/ directory
|
||||
int COM_IOReadBinary::open( const char *pFileName )
|
||||
intp COM_IOReadBinary::open( const char *pFileName )
|
||||
{
|
||||
char namebuffer[512];
|
||||
FileHandle_t hFile;
|
||||
@@ -46,10 +46,10 @@ int COM_IOReadBinary::open( const char *pFileName )
|
||||
|
||||
hFile = g_pFileSystem->Open( namebuffer, "rb", "GAME" );
|
||||
|
||||
return (int)hFile;
|
||||
return (intp)hFile;
|
||||
}
|
||||
|
||||
int COM_IOReadBinary::read( void *pOutput, int size, int file )
|
||||
int COM_IOReadBinary::read( void *pOutput, int size, intp file )
|
||||
{
|
||||
if ( !file )
|
||||
return 0;
|
||||
@@ -57,7 +57,7 @@ int COM_IOReadBinary::read( void *pOutput, int size, int file )
|
||||
return g_pFileSystem->Read( pOutput, size, (FileHandle_t)file );
|
||||
}
|
||||
|
||||
void COM_IOReadBinary::seek( int file, int pos )
|
||||
void COM_IOReadBinary::seek( intp file, int pos )
|
||||
{
|
||||
if ( !file )
|
||||
return;
|
||||
@@ -65,7 +65,7 @@ void COM_IOReadBinary::seek( int file, int pos )
|
||||
g_pFileSystem->Seek( (FileHandle_t)file, pos, FILESYSTEM_SEEK_HEAD );
|
||||
}
|
||||
|
||||
unsigned int COM_IOReadBinary::tell( int file )
|
||||
unsigned int COM_IOReadBinary::tell( intp file )
|
||||
{
|
||||
if ( !file )
|
||||
return 0;
|
||||
@@ -73,7 +73,7 @@ unsigned int COM_IOReadBinary::tell( int file )
|
||||
return g_pFileSystem->Tell( (FileHandle_t)file );
|
||||
}
|
||||
|
||||
unsigned int COM_IOReadBinary::size( int file )
|
||||
unsigned int COM_IOReadBinary::size( intp file )
|
||||
{
|
||||
if (!file)
|
||||
return 0;
|
||||
@@ -81,7 +81,7 @@ unsigned int COM_IOReadBinary::size( int file )
|
||||
return g_pFileSystem->Size( (FileHandle_t)file );
|
||||
}
|
||||
|
||||
void COM_IOReadBinary::close( int file )
|
||||
void COM_IOReadBinary::close( intp file )
|
||||
{
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
@@ -1099,7 +1099,7 @@ protected:
|
||||
};
|
||||
|
||||
public:
|
||||
static unsigned CallbackThreadProc( void *pvParam ) { ((CAsyncUploaderThread*) pvParam)->ThreadProc(); return 0; }
|
||||
static uintp CallbackThreadProc( void *pvParam ) { ((CAsyncUploaderThread*) pvParam)->ThreadProc(); return 0; }
|
||||
void QueueData( char const *szMapName, uint uiBlobVersion, uint uiBlobSize, const void *pvBlob );
|
||||
void TerminateAndSelfDelete();
|
||||
};
|
||||
|
||||
+1
-1
@@ -2260,7 +2260,7 @@ bool EnableLongTickWatcher()
|
||||
#ifdef POSIX
|
||||
(void*)
|
||||
#endif
|
||||
LongTickWatcherThread, NULL, 0, (unsigned long int *)&nThreadID );
|
||||
LongTickWatcherThread, NULL, 0, (uintp *)&nThreadID );
|
||||
|
||||
bRet = true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -192,7 +192,7 @@ int ParseString( char const *pText, char *buf, size_t bufsize )
|
||||
char const *pStart = pTemp;
|
||||
pTemp = SkipText( pTemp );
|
||||
|
||||
int len = min( pTemp - pStart + 1, (int)bufsize - 1 );
|
||||
intp len = min( pTemp - pStart + 1, (ptrdiff_t)bufsize - 1 );
|
||||
Q_strncpy( buf, pStart, len );
|
||||
buf[ len ] = 0;
|
||||
return 1;
|
||||
|
||||
+2
-2
@@ -523,7 +523,7 @@ public:
|
||||
int m_nLeafWaterDataID;
|
||||
};
|
||||
|
||||
bool EnumerateLeaf( int leaf, int context )
|
||||
bool EnumerateLeaf( int leaf, intp context )
|
||||
{
|
||||
BoxIntersectWaterContext_t *pSearchContext = ( BoxIntersectWaterContext_t * )context;
|
||||
mleaf_t *pLeaf = &host_state.worldmodel->brush.pShared->leafs[leaf];
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
BoxIntersectWaterContext_t context;
|
||||
context.m_bFoundWaterLeaf = false;
|
||||
context.m_nLeafWaterDataID = leafWaterDataID;
|
||||
g_pToolBSPTree->EnumerateLeavesInBox( mins, maxs, this, ( int )&context );
|
||||
g_pToolBSPTree->EnumerateLeavesInBox( mins, maxs, this, ( intp )&context );
|
||||
return context.m_bFoundWaterLeaf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user