I fully agree with you. In my particle system which involves the use of
STL's linked-list templates, I pre-allocate a big amount of particles when
the client.dll is loaded. When a particle is allocated I just pick
an unused particle from the pre-allocated array and append it to the
linked-list.
Only thing that makes it still slower than I want it, is the iteration that
occurs most of the time to find a free particle in the array. Just think of
_not_ doing it this way:
for (int i=0;iMAX_PARTICLES;i++)
{
if ( !m_pMyArray[i]-bInUse )
return m_pMyArray[i];
}
2 matches
Mail list logo