- Standardized use of PClassActor::AllActorClasses for iterating over all classes of actors

instead of PClass::m_Types (now PClass::AllClasses).
- Removed ClassIndex from PClass. It was only needed by FArchive, and maps take care of the
  problem just as well.
- Moved PClass into a larger type system (which is likely to change some/lots once I try and actually use it and have a better feel for what I need from it).

SVN r2281 (scripting)
This commit is contained in:
Randy Heit 2010-04-16 02:57:51 +00:00
commit ee55e0319f
24 changed files with 1200 additions and 346 deletions

View file

@ -53,6 +53,8 @@
extern void LoadActors ();
TArray<PClassActor *> PClassActor::AllActorClasses;
bool FState::CallAction(AActor *self, AActor *stateowner, StateCallData *statecall)
{
if (ActionFunc != NULL)
@ -151,9 +153,9 @@ void PClassActor::StaticSetActorNums()
memset(SpawnableThings, 0, sizeof(SpawnableThings));
DoomEdMap.Empty();
for (unsigned int i = 0; i < PClass::m_RuntimeActors.Size(); ++i)
for (unsigned int i = 0; i < PClassActor::AllActorClasses.Size(); ++i)
{
static_cast<PClassActor *>(PClass::m_RuntimeActors[i])->RegisterIDs();
static_cast<PClassActor *>(PClassActor::AllActorClasses[i])->RegisterIDs();
}
}
@ -195,6 +197,9 @@ PClassActor::PClassActor()
ExplosionRadius = -1;
MissileHeight = 32*FRACUNIT;
MeleeDamage = 0;
// Record this in the master list.
AllActorClasses.Push(this);
}
//==========================================================================
@ -308,7 +313,6 @@ void PClassActor::InitializeNativeDefaults()
{
memset (Defaults, 0, Size);
}
m_RuntimeActors.Push(this);
}
//==========================================================================
@ -585,7 +589,7 @@ static int STACK_ARGS sortnums (const void *a, const void *b)
void FDoomEdMap::DumpMapThings ()
{
TArray<EdSorting> infos (PClass::m_Types.Size());
TArray<EdSorting> infos (PClassActor::AllActorClasses.Size());
int i;
for (i = 0; i < DOOMED_HASHSIZE; ++i)