From 4078c6d6bdc6b03b45b0469702404124ceaa2714 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Dec 2022 20:20:22 +0100 Subject: [PATCH] - converted several of RR's static init sprite types to the class system. --- source/core/namedef_custom.h | 7 +++++ source/games/duke/src/premap_d.cpp | 2 +- source/games/duke/src/premap_r.cpp | 20 +++++++------- .../static/filter/redneck/engine/engine.def | 8 ++++++ .../zscript/games/duke/actors/controllers.zs | 27 +++++++++++++++++++ 5 files changed, 53 insertions(+), 11 deletions(-) diff --git a/source/core/namedef_custom.h b/source/core/namedef_custom.h index 622c3d5ba..1edd5815c 100644 --- a/source/core/namedef_custom.h +++ b/source/core/namedef_custom.h @@ -27,6 +27,13 @@ xx(DukeNaturalLightning) xx(RedneckBowlingPin) xx(DukeReactor) xx(DukeFootprints) +xx(RedneckMinecartDef) +xx(RedneckMinecartSound) +xx(RedneckMinecartInner) +xx(RedneckJaildoorDef) +xx(RedneckJaildoorSound) +xx(RedneckGeometryEffect) +xx(RedneckKeyinfoSetter) xx(spawnstate) xx(brokenstate) diff --git a/source/games/duke/src/premap_d.cpp b/source/games/duke/src/premap_d.cpp index 29ac670c3..a18513d91 100644 --- a/source/games/duke/src/premap_d.cpp +++ b/source/games/duke/src/premap_d.cpp @@ -338,7 +338,7 @@ void prelevel_d(int g, TArray& actors) DukeStatIterator it1(STAT_EFFECTOR); while (auto ac = it1.Next()) { - if (ac->spr.lotag == 12 && ac->spr.hitag == actor->spr.lotag) + if (ac->spr.lotag == SE_12_LIGHT_SWITCH && ac->spr.hitag == actor->spr.lotag) ac->temp_data[0] = 1; } } diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index 84f029724..651e6a57e 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -457,13 +457,13 @@ void prelevel_r(int g, TArray& actors) dist = 0; while (auto act = it.Next()) { - if (act->spr.picnum == RRJAILDOOR) + if (act->GetClass()->TypeName == NAME_RedneckJaildoorDef) { dist = act->spr.lotag; speed = act->spr.hitag; act->Destroy(); } - if (act->spr.picnum == RRJAILDOORSOUND) + if (act->GetClass()->TypeName == NAME_RedneckJaildoorSound) { sound = act->spr.lotag; act->Destroy(); @@ -497,14 +497,14 @@ void prelevel_r(int g, TArray& actors) DukeSectIterator it(sectp); while (auto act = it.Next()) { - if (act->spr.picnum == RRMINECART) + if (act->GetClass()->TypeName == NAME_RedneckMinecartDef) { dist = act->spr.lotag; speed = act->spr.hitag; DukeSpriteIterator itt; while(auto act1 = itt.Next()) { - if (act1->spr.picnum == RRMINECARTINNER) + if (act1->GetClass()->TypeName == NAME_RedneckMinecartInner) if (act1->spr.lotag == act->sectno()) // bad map format design... Should have used a tag instead... { childsectnum = act1->sector(); @@ -513,7 +513,7 @@ void prelevel_r(int g, TArray& actors) } act->Destroy(); } - if (act->spr.picnum == RRMINECARTSOUND) + if (act->GetClass()->TypeName == NAME_RedneckMinecartSound) { sound = act->spr.lotag; act->Destroy(); @@ -547,7 +547,7 @@ void prelevel_r(int g, TArray& actors) for (auto actor : actors) { if (!actor->exists()) continue; - if (actor->spr.picnum == RRTILE19) + if (actor->GetClass()->TypeName == NAME_RedneckGeometryEffect) { if (geocnt > 64) I_Error("Too many geometry effects"); @@ -556,7 +556,7 @@ void prelevel_r(int g, TArray& actors) geosector[geocnt] = actor->sector(); for (auto actor2 : actors) { - if (actor && actor->spr.lotag == actor2->spr.lotag && actor2 != actor && actor2->spr.picnum == RRTILE19) + if (actor && actor->spr.lotag == actor2->spr.lotag && actor2 != actor && actor2->GetClass() == actor->GetClass()) { if (actor2->spr.hitag == 1) { @@ -595,9 +595,9 @@ void prelevel_r(int g, TArray& actors) { if (iseffector(actor) && actor->spr.lotag == SE_14_SUBWAY_CAR) spriteinit_r(actor, actors); - if (actor->spr.picnum == RRTILE19) + if (actor->GetClass()->TypeName == NAME_RedneckGeometryEffect) actor->Destroy(); - if (actor->spr.picnum == RRTILE34) + if (actor->spr.picnum == NAME_RedneckKeyinfoSetter) { actor->sector()->keyinfo = uint8_t(actor->spr.lotag); actor->Destroy(); @@ -645,7 +645,7 @@ void prelevel_r(int g, TArray& actors) DukeStatIterator it1(STAT_EFFECTOR); while (auto actj = it1.Next()) { - if (actj->spr.lotag == 12 && actj->spr.hitag == ac->spr.lotag) + if (actj->spr.lotag == SE_12_LIGHT_SWITCH && actj->spr.hitag == ac->spr.lotag) actj->temp_data[0] = 1; } } diff --git a/wadsrc/static/filter/redneck/engine/engine.def b/wadsrc/static/filter/redneck/engine/engine.def index b66b05827..7d80021dc 100644 --- a/wadsrc/static/filter/redneck/engine/engine.def +++ b/wadsrc/static/filter/redneck/engine/engine.def @@ -18,6 +18,14 @@ spawnclasses 67 = DukeDummyCtrl 71 = DukeSoundFX + 64 = RedneckMinecartDef + 65 = RedneckMinecartSound + 66 = RedneckMinecartInner + 11 = RedneckJaildoorDef + 38 = RedneckJaildoorSound + 19 = RedneckGeometryEffect + 34 = RedneckKeyinfoSetter + 1298 = DukeCranePole 1299 = DukeCrane 1092 = DukeWaterFountain diff --git a/wadsrc/static/zscript/games/duke/actors/controllers.zs b/wadsrc/static/zscript/games/duke/actors/controllers.zs index 778f2f08d..313bccb85 100644 --- a/wadsrc/static/zscript/games/duke/actors/controllers.zs +++ b/wadsrc/static/zscript/games/duke/actors/controllers.zs @@ -178,3 +178,30 @@ class DukeSoundFX : DukeActor } } +class RedneckMinecartDef : DukeActor +{ +} + +class RedneckMinecartSound : DukeActor +{ +} + +class RedneckMinecartInner : DukeActor +{ +} + +class RedneckJaildoorDef : DukeActor +{ +} + +class RedneckJaildoorSound : DukeActor +{ +} + +class RedneckGeometryEffect : DukeActor +{ +} + +class RedneckKeyinfoSetter : DukeActor +{ +}