diff --git a/doc/reference.adoc b/doc/reference.adoc index 634e372..4f6bae1 100644 --- a/doc/reference.adoc +++ b/doc/reference.adoc @@ -647,6 +647,13 @@ width, i.e. if width = 128, then subdivision = 64 gives you sectors of 2 units w Arch adds to xoff automatically to reduce funny texturing. On the y axis it is best if you precede arch by unpegged. + + archclip(height,width,depth,subdivision,floor,lightlevel,clip) + +This is a special-case version of arch which has an additional parameter, clip, to +cut short generating the arch. This can be used to create structures such as gothic +arches. + mergesectors turns sector merge mode on. In this mode WadC will check for existing sectors diff --git a/doc/release_notes.adoc b/doc/release_notes.adoc index f6de3dd..f53b19b 100644 --- a/doc/release_notes.adoc +++ b/doc/release_notes.adoc @@ -20,6 +20,9 @@ Thank you Kayvan, for introducing me to Doom, amongst many other things. === Language features + * New (experimental) built-in `archclip`: behaves the same as `arch`, + but stops generating the arch after N units, where N is the seventh + parameter supplied * Two new built-ins: `getx` and `gety` return the cursor's current X/Y position. diff --git a/src/main/java/org/redmars/wadc/Builtin.java b/src/main/java/org/redmars/wadc/Builtin.java index 9a6064c..2a8fe0f 100644 --- a/src/main/java/org/redmars/wadc/Builtin.java +++ b/src/main/java/org/redmars/wadc/Builtin.java @@ -18,6 +18,7 @@ class Builtin { Exp eval(Exp a, Exp b, Exp c, Exp d) { return null; } Exp eval(Exp a, Exp b, Exp c, Exp d, Exp e) { return null; } Exp eval(Exp a, Exp b, Exp c, Exp d, Exp e, Exp f) { return null; } + Exp eval(Exp a, Exp b, Exp c, Exp d, Exp e, Exp f, Exp g) { return null; } Exp eval(Exp a, Exp b, Exp c, Exp d, Exp e, Exp f, Exp g, Exp h) { return null; } }; diff --git a/src/main/java/org/redmars/wadc/WadRun.java b/src/main/java/org/redmars/wadc/WadRun.java index e484e04..2462798 100644 --- a/src/main/java/org/redmars/wadc/WadRun.java +++ b/src/main/java/org/redmars/wadc/WadRun.java @@ -177,6 +177,38 @@ void addBuiltins() { return n; }}); + builtin("archclip", 7, new Builtin() { Exp eval(Exp a, Exp b, Exp c, Exp d, Exp e, Exp f, Exp g) { + int height = a.ival(); + int width = b.ival(); + int depth = c.ival(); + int steps = d.ival(); + int step = width/steps; + floor = e.ival(); + lightlevel = f.ival(); + + int maxLength = g.ival(); // maximum length we will generate, to make shortened arches + int curLength = 0; + + for(int i = 0; i