mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-01 09:42:27 +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;
|
struct FieldDesc;
|
||||||
AFuncDesc *FindFunction(PContainerType *cls, const char * string);
|
AFuncDesc *FindFunction(PContainerType *cls, const char * string);
|
||||||
FieldDesc *FindField(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)
|
if (part2 == NULL)
|
||||||
{ // Search all lists
|
{ // Search all lists
|
||||||
int max = strict ? 2 : NUM_FLAG_LISTS;
|
int max = strict ? 1 : NUM_FLAG_LISTS;
|
||||||
for (int i = 0; i < max; ++i)
|
for (int i = 0; i < max; ++i)
|
||||||
{
|
{
|
||||||
if ((FlagLists[i].Use & 1) && type->IsDescendantOf (*FlagLists[i].Type))
|
if ((FlagLists[i].Use & 1) && type->IsDescendantOf (*FlagLists[i].Type))
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "zcc_compile.h"
|
#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);
|
void SetImplicitArgs(TArray<PType*>* args, TArray<uint32_t>* argflags, TArray<FName>* argnames, PContainerType* cls, uint32_t funcflags, int useflags);
|
||||||
|
|
||||||
class ZCCRazeCompiler : public ZCCCompiler
|
class ZCCRazeCompiler : public ZCCCompiler
|
||||||
|
@ -12,10 +14,6 @@ public:
|
||||||
int Compile() override;
|
int Compile() override;
|
||||||
protected:
|
protected:
|
||||||
bool PrepareMetaData(PClass *type) override;
|
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:
|
private:
|
||||||
void CompileAllProperties();
|
void CompileAllProperties();
|
||||||
bool CompileProperties(PClass *type, TArray<ZCC_Property *> &Properties, FName prefix);
|
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 ProcessDefaultProperty(PClassActor *cls, ZCC_PropertyStmt *prop, Baggage &bag);
|
||||||
void ProcessDefaultFlag(PClassActor *cls, ZCC_FlagStmt *flg);
|
void ProcessDefaultFlag(PClassActor *cls, ZCC_FlagStmt *flg);
|
||||||
void InitDefaults() override final;
|
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 "filesystem.h"
|
||||||
#include "sc_man.h"
|
#include "sc_man.h"
|
||||||
#include "zcc_parser.h"
|
#include "zcc_parser.h"
|
||||||
#include "zcc_compile.h"
|
#include "zcc_compile_raze.h"
|
||||||
#include "codegen.h"
|
#include "codegen.h"
|
||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
#include "dobject.h"
|
#include "dobject.h"
|
||||||
|
|
||||||
void InitImports();
|
void InitThingdef();
|
||||||
|
void SynthesizeFlagFields();
|
||||||
|
|
||||||
void ParseScripts()
|
void ParseScripts()
|
||||||
{
|
{
|
||||||
|
@ -56,7 +57,7 @@ void ParseScripts()
|
||||||
auto newns = ParseOneScript(lump, state);
|
auto newns = ParseOneScript(lump, state);
|
||||||
PSymbolTable symtable;
|
PSymbolTable symtable;
|
||||||
|
|
||||||
ZCCCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion);
|
ZCCRazeCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion);
|
||||||
cc.Compile();
|
cc.Compile();
|
||||||
|
|
||||||
if (FScriptPosition::ErrorCounter > 0)
|
if (FScriptPosition::ErrorCounter > 0)
|
||||||
|
@ -78,7 +79,7 @@ void LoadScripts()
|
||||||
cycle_t timer;
|
cycle_t timer;
|
||||||
|
|
||||||
PType::StaticInit();
|
PType::StaticInit();
|
||||||
InitImports();
|
InitThingdef();
|
||||||
timer.Reset(); timer.Clock();
|
timer.Reset(); timer.Clock();
|
||||||
FScriptPosition::ResetErrorCounter();
|
FScriptPosition::ResetErrorCounter();
|
||||||
|
|
||||||
|
@ -95,6 +96,7 @@ void LoadScripts()
|
||||||
|
|
||||||
timer.Unclock();
|
timer.Unclock();
|
||||||
if (!batchrun) Printf("script parsing took %.2f ms\n", timer.TimeMS());
|
if (!batchrun) Printf("script parsing took %.2f ms\n", timer.TimeMS());
|
||||||
|
SynthesizeFlagFields();
|
||||||
|
|
||||||
// Now we may call the scripted OnDestroy method.
|
// Now we may call the scripted OnDestroy method.
|
||||||
PClass::bVMOperational = true;
|
PClass::bVMOperational = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue