EntityManager: Large speed improvement in Debug mode (~50x for projectile updates) by replacing std::vector<bool> with std::bitset.
This was SVN commit r4877.
This commit is contained in:
parent
5e3e78ca78
commit
a734f9ccd7
@ -27,7 +27,6 @@ CEntityManager::CEntityManager()
|
||||
m_nextalloc = 0;
|
||||
m_extant = true;
|
||||
m_death = false;
|
||||
m_refd.resize( MAX_HANDLES );
|
||||
|
||||
// Also load a couple of global entity settings
|
||||
CConfigValue* cfg = g_ConfigDB.GetValue( CFG_USER, "selection.outline.quality" );
|
||||
@ -316,7 +315,9 @@ void CEntityManager::updateAll( size_t timestep )
|
||||
void CEntityManager::interpolateAll( float relativeoffset )
|
||||
{
|
||||
for( int i = 0; i < MAX_HANDLES; i++ )
|
||||
if( isEntityRefd(i) )
|
||||
// This needs to handle all entities, including destroyed/non-extant ones
|
||||
// (mainly dead bodies), so it can't use isEntityRefd
|
||||
if( m_entities[i].m_refcount )
|
||||
m_entities[i].m_entity->interpolate( relativeoffset );
|
||||
}
|
||||
|
||||
@ -326,6 +327,7 @@ void CEntityManager::renderAll()
|
||||
if( isEntityRefd(i) )
|
||||
m_entities[i].m_entity->render();
|
||||
}
|
||||
|
||||
void CEntityManager::conformAll()
|
||||
{
|
||||
PROFILE_START("conform all");
|
||||
|
@ -42,7 +42,7 @@ friend class CEntity;
|
||||
friend class HEntity;
|
||||
friend class CHandle;
|
||||
CHandle m_entities[MAX_HANDLES];
|
||||
std::vector<bool> m_refd;
|
||||
std::bitset<MAX_HANDLES> m_refd;
|
||||
std::vector<CEntity*> m_reaper;
|
||||
std::vector<CEntity*>* m_collisionPatches;
|
||||
int m_nextalloc;
|
||||
|
Loading…
Reference in New Issue
Block a user