mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- hooked up the compiler extension and the static actor data setup.
This commit is contained in:
parent
0398ba4ff0
commit
e035ce00b6
4 changed files with 10 additions and 11 deletions
|
@ -272,4 +272,4 @@ struct AFuncDesc;
|
|||
struct FieldDesc;
|
||||
AFuncDesc *FindFunction(PContainerType *cls, const char * string);
|
||||
FieldDesc *FindField(PContainerType *cls, const char * string);
|
||||
void SetImplicitArgs(TArray<PType*>* args, TArray<uint32_t>* argflags, TArray<FName>* argnames, PContainerType* cls, uint32_t funcflags, int useflags);
|
||||
//void SetImplicitArgs(TArray<PType*>* args, TArray<uint32_t>* argflags, TArray<FName>* argnames, PContainerType* cls, uint32_t funcflags, int useflags);
|
||||
|
|
|
@ -183,7 +183,7 @@ FFlagDef *FindFlag (const PClass *type, const char *part1, const char *part2, bo
|
|||
|
||||
if (part2 == NULL)
|
||||
{ // Search all lists
|
||||
int max = strict ? 2 : NUM_FLAG_LISTS;
|
||||
int max = strict ? 1 : NUM_FLAG_LISTS;
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
if ((FlagLists[i].Use & 1) && type->IsDescendantOf (*FlagLists[i].Type))
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
#include "zcc_compile.h"
|
||||
|
||||
class DCoreActor;
|
||||
|
||||
void SetImplicitArgs(TArray<PType*>* args, TArray<uint32_t>* argflags, TArray<FName>* argnames, PContainerType* cls, uint32_t funcflags, int useflags);
|
||||
|
||||
class ZCCRazeCompiler : public ZCCCompiler
|
||||
|
@ -12,10 +14,6 @@ public:
|
|||
int Compile() override;
|
||||
protected:
|
||||
bool PrepareMetaData(PClass *type) override;
|
||||
void SetImplicitArgs(TArray<PType*>* args, TArray<uint32_t>* argflags, TArray<FName>* argnames, PContainerType* cls, uint32_t funcflags, int useflags) override
|
||||
{
|
||||
::SetImplicitArgs(args, argflags, argnames, cls, funcflags, useflags);
|
||||
}
|
||||
private:
|
||||
void CompileAllProperties();
|
||||
bool CompileProperties(PClass *type, TArray<ZCC_Property *> &Properties, FName prefix);
|
||||
|
@ -25,7 +23,6 @@ private:
|
|||
void ProcessDefaultProperty(PClassActor *cls, ZCC_PropertyStmt *prop, Baggage &bag);
|
||||
void ProcessDefaultFlag(PClassActor *cls, ZCC_FlagStmt *flg);
|
||||
void InitDefaults() override final;
|
||||
int CheckActionKeyword(ZCC_FuncDeclarator *f, uint32_t &varflags, int useflags, ZCC_StructWork *c);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -37,13 +37,14 @@
|
|||
#include "filesystem.h"
|
||||
#include "sc_man.h"
|
||||
#include "zcc_parser.h"
|
||||
#include "zcc_compile.h"
|
||||
#include "zcc_compile_raze.h"
|
||||
#include "codegen.h"
|
||||
#include "stats.h"
|
||||
#include "printf.h"
|
||||
#include "dobject.h"
|
||||
|
||||
void InitImports();
|
||||
void InitThingdef();
|
||||
void SynthesizeFlagFields();
|
||||
|
||||
void ParseScripts()
|
||||
{
|
||||
|
@ -56,7 +57,7 @@ void ParseScripts()
|
|||
auto newns = ParseOneScript(lump, state);
|
||||
PSymbolTable symtable;
|
||||
|
||||
ZCCCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion);
|
||||
ZCCRazeCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion);
|
||||
cc.Compile();
|
||||
|
||||
if (FScriptPosition::ErrorCounter > 0)
|
||||
|
@ -78,7 +79,7 @@ void LoadScripts()
|
|||
cycle_t timer;
|
||||
|
||||
PType::StaticInit();
|
||||
InitImports();
|
||||
InitThingdef();
|
||||
timer.Reset(); timer.Clock();
|
||||
FScriptPosition::ResetErrorCounter();
|
||||
|
||||
|
@ -95,6 +96,7 @@ void LoadScripts()
|
|||
|
||||
timer.Unclock();
|
||||
if (!batchrun) Printf("script parsing took %.2f ms\n", timer.TimeMS());
|
||||
SynthesizeFlagFields();
|
||||
|
||||
// Now we may call the scripted OnDestroy method.
|
||||
PClass::bVMOperational = true;
|
||||
|
|
Loading…
Reference in a new issue