- Changed state label storage so that each actor owns all the state labels itself

and doesn't have to traverse parent lists to find them. This is required for
  Dehacked actors that inherit states (e.g. NonsolidMeat and Spectre) but it also
  makes the data much easier to handle.


SVN r413 (trunk)
This commit is contained in:
Christoph Oelckers 2006-12-16 12:50:36 +00:00
commit 979dfdf4cf
6 changed files with 92 additions and 131 deletions

View file

@ -70,12 +70,6 @@ void FActorInfo::BuildDefaults ()
{
memset (Class->Defaults + parent->Size, 0, Class->Size - parent->Size);
}
if (parent == RUNTIME_CLASS(AActor) && OwnedStates == NULL)
{ // Stateless actors that are direct subclasses of AActor
// have their spawnstate default to something that won't
// immediately destroy them.
((AActor *)(Class->Defaults))->SpawnState = &AActor::States[0];
}
}
ApplyDefaults (Class->Defaults);
}
@ -358,7 +352,14 @@ void FActorInfo::ApplyDefaults (BYTE *defaults)
sgClass = Class;
sgDefaults = defaults;
ClearStateLabels();
if (Class != RUNTIME_CLASS(AActor))
{
MakeStateDefines(Class->ParentClass->ActorInfo->StateList);
}
else
{
ClearStateLabels();
}
#if _MSC_VER
const BYTE *parser = DefaultList;