Skip to content

Commit

Permalink
[particles] Use correct return type for particle systems count
Browse files Browse the repository at this point in the history
  • Loading branch information
dimhotepus committed Jan 16, 2025
1 parent b9b4a48 commit a794bcb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions particles/particles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ class CParticleSystemDictionary

CParticleSystemDefinition* AddParticleSystem( CDmxElement *pParticleSystem );
intp Count() const;
intp NameCount() const;
UtlSymId_t NameCount() const;
CParticleSystemDefinition* GetParticleSystem( intp i );
ParticleSystemHandle_t FindParticleSystemHandle( const char *pName );
CParticleSystemDefinition* FindParticleSystem( ParticleSystemHandle_t h );
CParticleSystemDefinition* FindParticleSystem( const char *pName );
CParticleSystemDefinition* FindParticleSystem( const DmObjectId_t &id );

CParticleSystemDefinition* operator[]( intp idx )
CParticleSystemDefinition* operator[]( UtlSymId_t idx )
{
return m_ParticleNameMap[ idx ];
}
Expand Down Expand Up @@ -229,7 +229,7 @@ CParticleSystemDefinition* CParticleSystemDictionary::AddParticleSystem( CDmxEle
return pDef;
}

intp CParticleSystemDictionary::NameCount() const
UtlSymId_t CParticleSystemDictionary::NameCount() const
{
return m_ParticleNameMap.GetNumStrings();
}
Expand Down Expand Up @@ -1021,7 +1021,7 @@ void CParticleCollection::Init( CParticleSystemDefinition *pDef, float flDelay,
}
else
{
m_nRandomSeed = (intp)this;
m_nRandomSeed = static_cast<int>(reinterpret_cast<intp>(this));
#ifndef _DEBUG
// dimhotepus: ms -> mcs to not overflow in 49.7 days.
m_nRandomSeed += static_cast<int>((Plat_USTime() / 1000) % std::numeric_limits<int>::max());
Expand Down Expand Up @@ -3034,8 +3034,8 @@ void CParticleSystemMgr::UncacheAllParticleSystems()
m_pParticleSystemDictionary->GetParticleSystem( i )->Uncache();
}

nCount = m_pParticleSystemDictionary->NameCount();
for ( ParticleSystemHandle_t h = 0; h < nCount; ++h )
UtlSymId_t nNameCount = m_pParticleSystemDictionary->NameCount();
for ( ParticleSystemHandle_t h = 0; h < nNameCount; ++h )
{
m_pParticleSystemDictionary->FindParticleSystem( h )->Uncache();
}
Expand Down Expand Up @@ -3436,7 +3436,7 @@ const char *CParticleSystemMgr::GetParticleSystemNameFromIndex( ParticleSystemHa
return pDef ? pDef->GetName() : "Unknown";
}

intp CParticleSystemMgr::GetParticleSystemCount( void )
UtlSymId_t CParticleSystemMgr::GetParticleSystemCount( void )
{
return m_pParticleSystemDictionary->NameCount();
}
Expand Down Expand Up @@ -3718,7 +3718,7 @@ void CParticleSystemMgr::DumpProfileInformation( void )
FileHandle_t fh = g_pFullFileSystem->Open( "particle_profile.csv", "w" );
g_pFullFileSystem->FPrintf( fh, "numframes,%d\n", m_nNumFramesMeasured );
g_pFullFileSystem->FPrintf( fh, "name, total time, max time, max particles, allocated particles\n");
for( int i=0; i < m_pParticleSystemDictionary->NameCount(); i++ )
for( UtlSymId_t i=0; i < m_pParticleSystemDictionary->NameCount(); i++ )
{
CParticleSystemDefinition *p = ( *m_pParticleSystemDictionary )[ i ];
if ( p->m_nMaximumActiveParticles )
Expand Down Expand Up @@ -3747,7 +3747,7 @@ void CParticleSystemMgr::CommitProfileInformation( bool bCommit )
{
if ( bCommit )
m_nNumFramesMeasured++;
for( int i=0; i < m_pParticleSystemDictionary->NameCount(); i++ )
for( UtlSymId_t i=0; i < m_pParticleSystemDictionary->NameCount(); i++ )
{
CParticleSystemDefinition *p = ( *m_pParticleSystemDictionary )[ i ];
if ( bCommit )
Expand Down
4 changes: 2 additions & 2 deletions public/particles/particles.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class IParticleSystemQuery : public IAppSystem
// separate particle system .libs
//
//-----------------------------------------------------------------------------
typedef intp ParticleSystemHandle_t;
typedef UtlSymId_t ParticleSystemHandle_t;

class CParticleSystemMgr
{
Expand Down Expand Up @@ -344,7 +344,7 @@ class CParticleSystemMgr
const char *GetParticleSystemNameFromIndex( ParticleSystemHandle_t iIndex );

// Return the number of particle systems in our dictionary
intp GetParticleSystemCount( void );
UtlSymId_t GetParticleSystemCount( void );

// call to get available particle operator definitions
// NOTE: FUNCTION_CHILDREN will return a faked one, for ease of writing the editor
Expand Down

0 comments on commit a794bcb

Please sign in to comment.