diff --git a/source/core/zcompile.cpp b/source/core/zcompile.cpp index 814cfb6e3..63eff2ed3 100644 --- a/source/core/zcompile.cpp +++ b/source/core/zcompile.cpp @@ -88,6 +88,7 @@ void LoadScripts() FScriptPosition::StrictErrors = true; ParseScripts(); + SynthesizeFlagFields(); FunctionBuildList.Build(); @@ -99,7 +100,6 @@ void LoadScripts() timer.Unclock(); if (!batchrun) Printf("script parsing took %.2f ms\n", timer.TimeMS()); - SynthesizeFlagFields(); for (int i = PClass::AllClasses.Size() - 1; i >= 0; i--) { diff --git a/source/games/duke/src/vmexports.cpp b/source/games/duke/src/vmexports.cpp index f205b579d..a33cffb57 100644 --- a/source/games/duke/src/vmexports.cpp +++ b/source/games/duke/src/vmexports.cpp @@ -664,12 +664,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, insertspriteq, insertspriteq) return 0; } -void DukeActor_operateforcefields(DDukeActor* self, int tag) -{ - operateforcefields(self, tag); -} - -DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, operateforcefields, DukeActor_operateforcefields) +DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, operateforcefields, operateforcefields) { PARAM_SELF_PROLOGUE(DDukeActor); PARAM_INT(tag); @@ -704,29 +699,6 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, subkill, subkill) return 0; } - -// temporary helpers to hide the fact that these flags are not part of the actor yet. -DEFINE_ACTION_FUNCTION(DDukeActor, actorflag1) -{ - PARAM_SELF_PROLOGUE(DDukeActor); - PARAM_INT(mask); - ACTION_RETURN_BOOL(!!(self->flags1 & EDukeFlags1::FromInt(mask))); -} - -DEFINE_ACTION_FUNCTION(DDukeActor, actorflag2) -{ - PARAM_SELF_PROLOGUE(DDukeActor); - PARAM_INT(mask); - ACTION_RETURN_BOOL(!!(self->flags2 & EDukeFlags2::FromInt(mask))); -} - -DEFINE_ACTION_FUNCTION(DDukeActor, actorflag3) -{ - PARAM_SELF_PROLOGUE(DDukeActor); - PARAM_INT(mask); - ACTION_RETURN_BOOL(!!(self->flags3 & EDukeFlags3::FromInt(mask))); -} - //--------------------------------------------------------------------------- // // DukePlayer diff --git a/wadsrc/static/zscript/games/duke/actors/bloodpool.zs b/wadsrc/static/zscript/games/duke/actors/bloodpool.zs index ec4cb2111..066eb6b03 100644 --- a/wadsrc/static/zscript/games/duke/actors/bloodpool.zs +++ b/wadsrc/static/zscript/games/duke/actors/bloodpool.zs @@ -14,12 +14,12 @@ class DukeBloodPool : DukeActor { if (Owner.pal == 1) self.pal = 1; // Blue - else if (Owner.pal == 6 || Owner.actorflag2(SFLAG2_GREENBLOOD)) + else if (Owner.pal == 6 || Owner.bGREENBLOOD) { self.pal = 0; // Green self.temp_data[5] = 1; // this hurts! } - else if (Owner.actorflag3(SFLAG3_BROWNBLOOD)) + else if (Owner.bBROWNBLOOD) self.pal = 7; // Brown else self.pal = 2; // Red diff --git a/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs b/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs index 548df765a..9b645de11 100644 --- a/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs +++ b/wadsrc/static/zscript/games/duke/actors/bloodsplats.zs @@ -98,7 +98,7 @@ class DukeBloodSplat1 : DukeActor spawned.SetPosition(spawned.pos); spawned.cstat2 |= CSTAT2_SPRITE_DECAL; - if (shooter.actorflag2(SFLAG2_GREENBLOOD)) + if (shooter.bGREENBLOOD) spawned.pal = 6; } return true; diff --git a/wadsrc/static/zscript/games/duke/actors/burning.zs b/wadsrc/static/zscript/games/duke/actors/burning.zs index e87807a0a..75b41b0fd 100644 --- a/wadsrc/static/zscript/games/duke/actors/burning.zs +++ b/wadsrc/static/zscript/games/duke/actors/burning.zs @@ -56,7 +56,7 @@ class DukeBurning : DukeActor } t.cstat |= CSTAT_SPRITE_YCENTER; double d; - if (!OwnerAc || !OwnerAc.actorflag1(SFLAG_NOFLOORFIRE)) + if (!OwnerAc || !OwnerAc.bNOFLOORFIRE) [d, t.pos.Z] = t.sector.getSlopes(t.pos.XY); return false; } @@ -84,7 +84,7 @@ class RedneckFire : DukeActor { let OwnerAc = self.ownerActor; double d; - if (!OwnerAc || !OwnerAc.actorflag1(SFLAG_NOFLOORFIRE)) + if (!OwnerAc || !OwnerAc.bNOFLOORFIRE) [d, t.pos.Z] = t.sector.getSlopes(t.pos.XY); return false; } diff --git a/wadsrc/static/zscript/games/duke/actors/cactus.zs b/wadsrc/static/zscript/games/duke/actors/cactus.zs index 37e23116a..5f3fc9249 100644 --- a/wadsrc/static/zscript/games/duke/actors/cactus.zs +++ b/wadsrc/static/zscript/games/duke/actors/cactus.zs @@ -24,7 +24,7 @@ class DukeCactus : DukeCactusBroke override void onHit(DukeActor hitter) { - if (self.spritesetindex == 0 && hitter.actorflag1(SFLAG_INFLAME)) + if (self.spritesetindex == 0 && hitter.bINFLAME) { let scrap = Raze.isRR()? DukeScrap.Scrap6 : DukeScrap.Scrap3; diff --git a/wadsrc/static/zscript/games/duke/actors/crack.zs b/wadsrc/static/zscript/games/duke/actors/crack.zs index 189a93854..ad4b3b80a 100644 --- a/wadsrc/static/zscript/games/duke/actors/crack.zs +++ b/wadsrc/static/zscript/games/duke/actors/crack.zs @@ -37,7 +37,7 @@ class DukeCrack : DukeActor DukeStatIterator it; for(let a1 = it.First(STAT_STANDABLE); a1; a1 = it.Next()) { - if (self.hitag == a1.hitag && a1.actorflag2(SFLAG2_BRIGHTEXPLODE)) + if (self.hitag == a1.hitag && a1.bBRIGHTEXPLODE) if (a1.shade != -32) a1.shade = -32; } diff --git a/wadsrc/static/zscript/games/duke/actors/destructibles.zs b/wadsrc/static/zscript/games/duke/actors/destructibles.zs index 313e4edc5..60ee002d4 100644 --- a/wadsrc/static/zscript/games/duke/actors/destructibles.zs +++ b/wadsrc/static/zscript/games/duke/actors/destructibles.zs @@ -160,7 +160,7 @@ class DukeSatellite : DukeActor } override void OnHit(DukeActor proj) { - if (!proj.actorflag3(SFLAG3_LIGHTDAMAGE)) + if (!proj.bLIGHTDAMAGE) { for (int j = 0; j < 15; j++) { diff --git a/wadsrc/static/zscript/games/duke/actors/fireext.zs b/wadsrc/static/zscript/games/duke/actors/fireext.zs index 849e24a6a..82a7e3b11 100644 --- a/wadsrc/static/zscript/games/duke/actors/fireext.zs +++ b/wadsrc/static/zscript/games/duke/actors/fireext.zs @@ -53,7 +53,7 @@ class DukeFireext : DukeActor DukeStatIterator it; for(let a1 = it.First(STAT_STANDABLE); a1; a1 = it.Next()) { - if (self.hitag == a1.hitag && a1.actorflag2(SFLAG2_BRIGHTEXPLODE)) + if (self.hitag == a1.hitag && a1.bBRIGHTEXPLODE) if (a1.shade != -32) a1.shade = -32; } diff --git a/wadsrc/static/zscript/games/duke/actors/flammables.zs b/wadsrc/static/zscript/games/duke/actors/flammables.zs index 49a37f4a3..f6b302d6e 100644 --- a/wadsrc/static/zscript/games/duke/actors/flammables.zs +++ b/wadsrc/static/zscript/games/duke/actors/flammables.zs @@ -19,7 +19,7 @@ class DukeFlammable : DukeActor self.temp_data[1]++; if ((self.temp_data[1] & 3) > 0) return; - if (self.actorflag1(SFLAG_FLAMMABLEPOOLEFFECT) && self.temp_data[1] == 32) + if (self.bFLAMMABLEPOOLEFFECT && self.temp_data[1] == 32) { self.cstat = 0; let spawned = self.spawn("DukeBloodPool"); @@ -56,7 +56,7 @@ class DukeFlammable : DukeActor } self.scale.Y = scale; } - if (self.actorflag1(SFLAG_FALLINGFLAMMABLE)) + if (self.bFALLINGFLAMMABLE) { self.makeitfall(); self.ceilingz = self.sector.ceilingz; @@ -65,7 +65,7 @@ class DukeFlammable : DukeActor override void onHit(DukeActor hitter) { - if (hitter.actorflag1(SFLAG_INFLAME)) + if (hitter.bINFLAME) { if (self.temp_data[0] == 0) { diff --git a/wadsrc/static/zscript/games/duke/actors/greenslime.zs b/wadsrc/static/zscript/games/duke/actors/greenslime.zs index 94cd58420..d678abef4 100644 --- a/wadsrc/static/zscript/games/duke/actors/greenslime.zs +++ b/wadsrc/static/zscript/games/duke/actors/greenslime.zs @@ -162,7 +162,7 @@ class DukeGreenSlime : DukeActor DukeStatIterator it; for (let ac = it.First(STAT_ACTOR); ac; ac = it.Next()) { - if (ac.actorflag2(SFLAG2_CAMERA)) ac.yint = 0; + if (ac.bCAMERA) ac.yint = 0; } } @@ -306,7 +306,7 @@ class DukeGreenSlime : DukeActor DukeSectIterator it; for (let a2 = it.First(self.sector); a2; a2 = it.Next()) { - if (a2.actorflag1(SFLAG_GREENSLIMEFOOD)) + if (a2.bGREENSLIMEFOOD) { double dist = (self.pos.XY - a2.pos.XY).LengthSquared(); if (dist < 48*48 && (abs(self.pos.Z - a2.pos.Z) < 16)) //Gulp them diff --git a/wadsrc/static/zscript/games/duke/actors/jibs.zs b/wadsrc/static/zscript/games/duke/actors/jibs.zs index 53961702e..130e35617 100644 --- a/wadsrc/static/zscript/games/duke/actors/jibs.zs +++ b/wadsrc/static/zscript/games/duke/actors/jibs.zs @@ -21,7 +21,7 @@ extend class DukeActor if (self.badguy() && self.pal == 6) pal = 6; - else if (!self.actorflag2(SFLAG2_TRANSFERPALTOJIBS)) + else if (!self.bTRANSFERPALTOJIBS) pal = 0; else pal = self.pal; diff --git a/wadsrc/static/zscript/games/duke/actors/masterswitch.zs b/wadsrc/static/zscript/games/duke/actors/masterswitch.zs index f05dc64a2..30c5a3b5c 100644 --- a/wadsrc/static/zscript/games/duke/actors/masterswitch.zs +++ b/wadsrc/static/zscript/games/duke/actors/masterswitch.zs @@ -38,7 +38,7 @@ class DukeMasterSwitch : DukeActor } else //if (effector.statnum == STAT_STANDABLE) this check is not really needed. { - if (effector.actorflag2(SFLAG2_BRIGHTEXPLODE)) // SEENINE and OOZFILTER + if (effector.bBRIGHTEXPLODE) // SEENINE and OOZFILTER { effector.shade = -31; } diff --git a/wadsrc/static/zscript/games/duke/actors/ooz.zs b/wadsrc/static/zscript/games/duke/actors/ooz.zs index f370304aa..010593fdd 100644 --- a/wadsrc/static/zscript/games/duke/actors/ooz.zs +++ b/wadsrc/static/zscript/games/duke/actors/ooz.zs @@ -11,7 +11,7 @@ class DukeOoz : DukeActor if (!self.mapSpawned) { - if (self.actorflag2(SFLAG2_PAL8OOZ)) + if (self.bPAL8OOZ) self.pal = 8; if (!Raze.IsRR()) self.insertspriteq(); } diff --git a/wadsrc/static/zscript/games/duke/actors/oozfilter.zs b/wadsrc/static/zscript/games/duke/actors/oozfilter.zs index 2b7b22883..72693ff21 100644 --- a/wadsrc/static/zscript/games/duke/actors/oozfilter.zs +++ b/wadsrc/static/zscript/games/duke/actors/oozfilter.zs @@ -44,7 +44,7 @@ class DukeOozFilter : DukeActor DukeStatIterator it; for(let act2 = it.first(STAT_STANDABLE); act2; act2 = it.Next()) { - if (self.hitag == act2.hitag && act2.actorflag2(SFLAG2_BRIGHTEXPLODE)) + if (self.hitag == act2.hitag && act2.bBRIGHTEXPLODE) act2.shade = -32; } } diff --git a/wadsrc/static/zscript/games/duke/actors/paper.zs b/wadsrc/static/zscript/games/duke/actors/paper.zs index 4280998f2..6e622a711 100644 --- a/wadsrc/static/zscript/games/duke/actors/paper.zs +++ b/wadsrc/static/zscript/games/duke/actors/paper.zs @@ -64,7 +64,7 @@ class DukeMoney : DukeActor DukeStatIterator it; for (let aa = it.First(STAT_MISC); aa; aa = it.Next()) { - if (aa.actorflag3(SFLAG3_BLOODY)) + if (aa.bBLOODY) { double dist = (aa.pos.XY - self.pos.XY).Length(); if (dist < 348/16.) diff --git a/wadsrc/static/zscript/games/duke/actors/projectiles.zs b/wadsrc/static/zscript/games/duke/actors/projectiles.zs index e516270f6..8cf290ba1 100644 --- a/wadsrc/static/zscript/games/duke/actors/projectiles.zs +++ b/wadsrc/static/zscript/games/duke/actors/projectiles.zs @@ -90,7 +90,7 @@ class DukeProjectile : DukeActor virtual bool weaponhitwall(walltype wal) { - if (self.actorflag2(SFLAG2_MIRRORREFLECT) && dlevel.isMirror(wal)) + if (self.bMIRRORREFLECT && dlevel.isMirror(wal)) { let k = wal.delta().Angle(); self.angle = k * 2 - self.angle; @@ -103,7 +103,7 @@ class DukeProjectile : DukeActor self.SetPosition(oldpos); dlevel.checkhitwall(wal, self, self.pos); - if (self.actorflag2(SFLAG2_REFLECTIVE)) + if (self.bREFLECTIVE) { if (!dlevel.isMirror(wal)) { @@ -149,7 +149,7 @@ class DukeProjectile : DukeActor int p = -1; - if (self.actorflag2(SFLAG2_UNDERWATERSLOWDOWN) && self.sector.lotag == ST_2_UNDERWATER) + if (self.bUNDERWATERSLOWDOWN && self.sector.lotag == ST_2_UNDERWATER) { vel *= 0.5; velz *= 0.5; @@ -348,7 +348,7 @@ class DukeRPG : DukeProjectile override bool premoveeffect() { - if ((!self.ownerActor || !self.ownerActor.actorflag2(SFLAG2_NONSMOKYROCKET)) && self.scale.X >= 0.15625 && self.sector.lotag != ST_2_UNDERWATER) + if ((!self.ownerActor || !self.ownerActor.bNONSMOKYROCKET) && self.scale.X >= 0.15625 && self.sector.lotag != ST_2_UNDERWATER) { let spawned = self.spawn("DukeSmallSmoke"); if (spawned) spawned.pos.Z += 1; @@ -794,7 +794,7 @@ class RedneckDynamiteArrow : DukeRPG override bool weaponhitsprite_pre(DukeActor targ) { - if (targ.actorflag2(SFLAG2_TRANSFERPALTOJIBS) && targ.pal == 19) + if (targ.bTRANSFERPALTOJIBS && targ.pal == 19) { self.PlayActorSound("RPG_EXPLODE"); let spawned = self.spawn("DukeExplosion2"); @@ -966,7 +966,7 @@ class RedneckShitBall : DukeSpit } override bool weaponhitplayer(DukeActor targ) { - if (ownerActor && ownerActor.actorflag2(SFLAG2_SPAWNRABBITGUTS)) + if (ownerActor && ownerActor.bSPAWNRABBITGUTS) rabbitguts(); return Super.weaponhitplayer(targ); @@ -975,7 +975,7 @@ class RedneckShitBall : DukeSpit override bool weaponhitwall(walltype wal) { self.SetPosition(oldpos); - if (ownerActor && ownerActor.actorflag2(SFLAG2_SPAWNRABBITGUTS)) + if (ownerActor && ownerActor.bSPAWNRABBITGUTS) rabbitguts(); return super.weaponhitwall(wal); @@ -984,7 +984,7 @@ class RedneckShitBall : DukeSpit override bool weaponhitsector() { self.setPosition(oldpos); - if (ownerActor && ownerActor.actorflag2(SFLAG2_SPAWNRABBITGUTS)) + if (ownerActor && ownerActor.bSPAWNRABBITGUTS) rabbitguts(); return super.weaponhitsector(); @@ -996,7 +996,7 @@ class RedneckShitBall : DukeSpit if (self.ownerActor) { let OwnerAc = self.ownerActor; - if (OwnerAc.actorflag2(SFLAG2_TRANSFERPALTOJIBS)) + if (OwnerAc.bTRANSFERPALTOJIBS) { if (OwnerAc.pal == 8) { @@ -1008,7 +1008,7 @@ class RedneckShitBall : DukeSpit tspr.shade = -127; } } - else if (OwnerAc.actorflag2(SFLAG2_SPAWNRABBITGUTS)) + else if (OwnerAc.bSPAWNRABBITGUTS) { tspr.clipdist |= TSPR_ROTATE8FRAMES; sprite = 14; @@ -1043,7 +1043,7 @@ class RedneckSawBlade : DukeProjectile { self.pos += self.angle.ToVector() * 8; let Owner = self.ownerActor; - if (!Owner || !(Owner.actorflag2(SFLAG2_ALTPROJECTILESPRITE))) // depends on the shooter. Urgh... + if (!Owner || !(Owner.bALTPROJECTILESPRITE)) // depends on the shooter. Urgh... { let j = self.spawn("RedneckCircleStuck"); if (j) @@ -1071,7 +1071,7 @@ class RedneckSawBlade : DukeProjectile override bool animate(tspritetype tspr) { int frame; - if (!OwnerActor || !(OwnerActor.actorflag2(SFLAG2_ALTPROJECTILESPRITE))) frame = ((PlayClock >> 4) & 7); + if (!OwnerActor || !(OwnerActor.bALTPROJECTILESPRITE)) frame = ((PlayClock >> 4) & 7); else frame = 8 + ((PlayClock >> 4) & 3); tspr.SetSpritePic(self, frame); return true; diff --git a/wadsrc/static/zscript/games/duke/actors/viewscreen.zs b/wadsrc/static/zscript/games/duke/actors/viewscreen.zs index 5823f86fe..f351a0b33 100644 --- a/wadsrc/static/zscript/games/duke/actors/viewscreen.zs +++ b/wadsrc/static/zscript/games/duke/actors/viewscreen.zs @@ -39,7 +39,7 @@ class DukeViewscreen : DukeActor DukeStatIterator it; for(let acti = it.First(STAT_ACTOR); acti; acti = it.Next()) { - if (acti.actorflag2(SFLAG2_CAMERA) && acti.yint == 0 && self.hitag == acti.lotag) + if (acti.bCAMERA && acti.yint == 0 && self.hitag == acti.lotag) { acti.yint = 1; //Using this camera if (user == Duke.GetViewPlayer()) Duke.PlaySound("MONITOR_ACTIVE"); diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index 78ee4728f..0486029f0 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -232,11 +232,6 @@ class DukeActor : CoreActor native native void subkill(); - // temporary flag accessors - need to be eliminated once we can have true actor flags - native int actorflag1(int mask); - native int actorflag2(int mask); - native int actorflag3(int mask); - virtual void Initialize()