- separated the code generation from the DECORATE parser and cleaned up the interface to the code generator. Most importantly, the VMScriptFunctions are now preallocated when being added to the list of functions to compile and will be filled in later by the code generator. This allowed the removal of some ugly maintenance code.

This commit is contained in:
Christoph Oelckers 2016-10-13 00:53:59 +02:00
parent 59ed26c0b6
commit a72fbb771f
16 changed files with 287 additions and 274 deletions

View file

@ -47,6 +47,7 @@
#include "p_lnspec.h"
#include "gdtoa.h"
#include "codegeneration/thingdef_exp.h"
#include "vmbuilder.h"
#define DEFINING_CONST ((PSymbolConst *)(void *)1)
@ -2165,12 +2166,7 @@ void ZCCCompiler::CompileStates()
auto code = SetupActionFunction(static_cast<PClassActor *>(c->Type()), sl->Action);
if (code != nullptr)
{
auto tcall = new FStateTempCall;
tcall->Code = code;
tcall->ActorClass = static_cast<PClassActor *>(c->Type());
tcall->FirstState = statedef.GetStateCount() - count;
tcall->NumStates = count;
StateTempCalls.Push(tcall);
state.ActionFunc = FunctionBuildList.AddFunction(c->Type(), code, FStringf("%s.StateFunction.%d", c->Type()->TypeName.GetChars(), statedef.GetStateCount()), true);
}
}
break;