- moved all remaining fields from PClassActor to FActorInfo.

- added a few access functions for FActorInfo variables.

With PClassActor now empty the class descriptors can finally be converted back to static data outside the class hierarchy, like they were before the scripting merge, and untangle the game data from VM internals.
This commit is contained in:
Christoph Oelckers 2017-04-12 00:07:41 +02:00
parent 854053a14f
commit e4d2380775
25 changed files with 122 additions and 118 deletions

View file

@ -10838,16 +10838,16 @@ FxExpression *FxStateByIndex::Resolve(FCompileContext &ctx)
auto aclass = dyn_cast<PClassActor>(ctx.Class);
// This expression type can only be used from actors, for everything else it has already produced a compile error.
assert(aclass != nullptr && aclass->ActorInfo()->NumOwnedStates > 0);
assert(aclass != nullptr && aclass->GetStateCount() > 0);
if (aclass->ActorInfo()->NumOwnedStates <= index)
if (aclass->GetStateCount() <= index)
{
ScriptPosition.Message(MSG_ERROR, "%s: Attempt to jump to non existing state index %d",
ctx.Class->TypeName.GetChars(), index);
delete this;
return nullptr;
}
int symlabel = StateLabels.AddPointer(aclass->ActorInfo()->OwnedStates + index);
int symlabel = StateLabels.AddPointer(aclass->GetStates() + index);
FxExpression *x = new FxConstant(symlabel, ScriptPosition);
x->ValueType = TypeStateLabel;
delete this;
@ -10912,8 +10912,8 @@ FxExpression *FxRuntimeStateIndex::Resolve(FCompileContext &ctx)
SAFE_RESOLVE(Index, ctx);
}
auto aclass = dyn_cast<PClassActor>(ctx.Class);
assert(aclass != nullptr && aclass->ActorInfo()->NumOwnedStates > 0);
symlabel = StateLabels.AddPointer(aclass->ActorInfo()->OwnedStates + ctx.StateIndex);
assert(aclass != nullptr && aclass->GetStateCount() > 0);
symlabel = StateLabels.AddPointer(aclass->GetStates() + ctx.StateIndex);
ValueType = TypeStateLabel;
return this;
}