- started moving stuff out of PClassActor into meta data.

This reinstates the old FActorInfo as part of the meta data a class can have so that the class descriptor itself can be freed from any data not directly relevant for managing the class's type information.
This commit is contained in:
Christoph Oelckers 2017-04-11 19:37:56 +02:00
commit 311ce2362a
8 changed files with 106 additions and 25 deletions

View file

@ -1112,6 +1112,7 @@ ZCC_ExprTypeRef *ZCCCompiler::NodeFromSymbolType(PSymbolType *sym, ZCC_Expressio
// builds the internal structure of all classes and structs
//
//==========================================================================
void AddActorInfo(PClass *cls);
void ZCCCompiler::CompileAllFields()
{
@ -1156,6 +1157,7 @@ void ZCCCompiler::CompileAllFields()
for (unsigned i = 0; i < Classes.Size(); i++)
{
auto type = Classes[i]->Type();
if (type->Size == TentativeClass)
{
if (type->ParentClass->Size == TentativeClass)
@ -1169,7 +1171,12 @@ void ZCCCompiler::CompileAllFields()
type->Size = Classes[i]->Type()->ParentClass->Size;
}
}
if (Classes[i]->Type()->ParentClass)
if (type->TypeName == NAME_Actor)
{
assert(type->MetaSize == 0);
AddActorInfo(type); // AActor needs the actor info manually added to its meta data before adding any scripted fields.
}
else if (Classes[i]->Type()->ParentClass)
type->MetaSize = Classes[i]->Type()->ParentClass->MetaSize;
else
type->MetaSize = 0;