Marked DrawPowerup as ui, still compiles and somewhat works :D

This commit is contained in:
ZZYZX 2017-02-18 07:30:08 +02:00
parent afc9050a43
commit dbc595f886
5 changed files with 12 additions and 12 deletions

View File

@ -6750,7 +6750,7 @@ bool FxStructMember::RequestAddress(FCompileContext &ctx, bool *writable)
if (ctx.Function)
{
outerflags = ctx.Function->Variants[0].Flags;
if ((outerflags & (VARF_VirtualScope | VARF_Virtual)) && ctx.Class)
if (((outerflags & (VARF_VirtualScope | VARF_Virtual)) == (VARF_VirtualScope | VARF_Virtual)) && ctx.Class)
outerflags = FScopeBarrier::FlagsFromSide(FScopeBarrier::SideFromObjectFlags(ctx.Class->ObjectFlags));
}
FScopeBarrier scopeBarrier(outerflags, FScopeBarrier::FlagsFromSide(BarrierSide), "<unknown>");
@ -6794,7 +6794,7 @@ FxExpression *FxStructMember::Resolve(FCompileContext &ctx)
if (ctx.Function)
{
outerflags = ctx.Function->Variants[0].Flags;
if ((outerflags & (VARF_VirtualScope | VARF_Virtual)) && ctx.Class)
if (((outerflags & (VARF_VirtualScope | VARF_Virtual)) == (VARF_VirtualScope | VARF_Virtual)) && ctx.Class)
outerflags = FScopeBarrier::FlagsFromSide(FScopeBarrier::SideFromObjectFlags(ctx.Class->ObjectFlags));
}
FScopeBarrier scopeBarrier(outerflags, membervar->Flags, membervar->SymbolName.GetChars());
@ -8065,7 +8065,7 @@ isresolved:
if (ctx.Function)
{
outerflags = ctx.Function->Variants[0].Flags;
if ((outerflags & (VARF_VirtualScope | VARF_Virtual)) && ctx.Class)
if (((outerflags & (VARF_VirtualScope | VARF_Virtual)) == (VARF_VirtualScope | VARF_Virtual)) && ctx.Class)
outerflags = FScopeBarrier::FlagsFromSide(FScopeBarrier::SideFromObjectFlags(ctx.Class->ObjectFlags));
}
int innerflags = afd->Variants[0].Flags;

View File

@ -708,7 +708,7 @@ public:
bool Final = false; // cannot be overridden
bool Unsafe = false; // Contains references to class fields that are unsafe for psp and item state calls.
bool FuncConst = false; // [ZZ] readonly function
int BarrierSide = -1; // [ZZ] FScopeBarrier::Side
int BarrierSide = 0; // [ZZ] FScopeBarrier::Side
BYTE ImplicitArgs = 0; // either 0 for static, 1 for method or 3 for action
unsigned VirtualIndex = ~0u;
FName Name;

View File

@ -1081,8 +1081,8 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray<ZCC_VarDeclarator *> &Fiel
// For structs only allow 'deprecated', for classes exclude function qualifiers.
int notallowed = forstruct?
ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Meta | ZCC_Extension :
ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Extension;
ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Meta | ZCC_Extension | ZCC_VirtualScope :
ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Extension | ZCC_VirtualScope;
if (field->Flags & notallowed)
{
@ -1102,11 +1102,11 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray<ZCC_VarDeclarator *> &Fiel
if (type->ObjectFlags & OF_Play)
varflags |= VARF_Play;
if (field->Flags & ZCC_UIFlag)
varflags = (varflags&~VARF_Play) | VARF_UI;
varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_UI);
if (field->Flags & ZCC_Play)
varflags = (varflags&~VARF_UI) | VARF_Play;
varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_Play);
if (field->Flags & ZCC_ClearScope)
varflags = (varflags&~(VARF_UI | VARF_Play));
varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_PlainData);
if (field->Flags & ZCC_Native)
{
@ -2128,7 +2128,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
if (c->Type()->ObjectFlags & OF_Play)
varflags |= VARF_Play;
if (f->Flags & ZCC_FuncConst)
varflags = (varflags&~(VARF_Play | VARF_UI)); // const implies clearscope. this is checked a bit later to also not have ZCC_Play/ZCC_UIFlag.
varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_PlainData); // const implies clearscope. this is checked a bit later to also not have ZCC_Play/ZCC_UIFlag.
if (f->Flags & ZCC_UIFlag)
varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_UI);
if (f->Flags & ZCC_Play)

View File

@ -813,7 +813,7 @@ class Inventory : Actor native
//
//===========================================================================
virtual bool DrawPowerup(int x, int y) { return false; }
virtual ui bool DrawPowerup(int x, int y) { return false; }
//===========================================================================
//

View File

@ -934,7 +934,7 @@ class PowerFlight : Powerup
+INVENTORY.HUBPOWER
}
bool HitCenterFrame;
ui bool HitCenterFrame;
//===========================================================================
//