From b938d0c561b5756955ea1f3213ecbbc0b0e7fe2a Mon Sep 17 00:00:00 2001 From: GTD-Carthage Date: Fri, 24 May 2019 20:04:40 +0800 Subject: [PATCH] - Added the fabrication of support pillars to the fences created for porches. --- src/games/doom/fabs/fence/gtd_pillar.lua | 9 +++++ src/games/doom/fabs/fence/gtd_pillar.wad | Bin 0 -> 1368 bytes src/scripts/layout.lua | 40 ++++++++++++++--------- src/scripts/render.lua | 13 +++++++- 4 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 src/games/doom/fabs/fence/gtd_pillar.lua create mode 100644 src/games/doom/fabs/fence/gtd_pillar.wad diff --git a/src/games/doom/fabs/fence/gtd_pillar.lua b/src/games/doom/fabs/fence/gtd_pillar.lua new file mode 100644 index 000000000..224c935b3 --- /dev/null +++ b/src/games/doom/fabs/fence/gtd_pillar.lua @@ -0,0 +1,9 @@ +-- pillar do a pretty good job + +PREFABS.Fence_pillar = +{ + file = "fence/gtd_pillar.wad" + map = "MAP01" + + where = "point" +} \ No newline at end of file diff --git a/src/games/doom/fabs/fence/gtd_pillar.wad b/src/games/doom/fabs/fence/gtd_pillar.wad new file mode 100644 index 0000000000000000000000000000000000000000..ef284a8cfbce8af0e2424df0b442ab1db357df8a GIT binary patch literal 1368 zcmdT^OK#La5PklQJ)UIbB|;zti3JiM1)&HDA(0_A$&g_@8V@8pSaOU$0w+K$a{vy& zf`f1bFK1`ot8NRiV8@1Tb#=X}>R6;_mq9yWFI$ZZtCu!d|A7Au0R0vIl}hTC_4bu<-IO#n{Uh?~hNbBy^wu?C`Q2!*@uh7qq=^w!7xK>8^3QD y&GDqxk#N_X?b>bki1-Kbx~&@p^u)L2_imIT3(K~7LkoFI{Dt_{sy(~pCVv4Ar0-t< literal 0 HcmV?d00001 diff --git a/src/scripts/layout.lua b/src/scripts/layout.lua index ff13f9c04..4d201b47e 100644 --- a/src/scripts/layout.lua +++ b/src/scripts/layout.lua @@ -2328,33 +2328,41 @@ function Layout_handle_corners() -- see if we have multiple railings at different heights, and -- if so then determine highest one. - local rail_z + local post_top_z local need_post each junc in corner.junctions do if junc.A2 == "map_edge" then return end if not junc.E1 then continue end - if junc.E1.kind != "railing" then continue end + if junc.E1.kind == "railing" then - local cur_z = assert(junc.E1.rail_z) - cur_z = int(cur_z) + local cur_z = assert(junc.E1.rail_z) + cur_z = int(cur_z) - if not rail_z then - rail_z = cur_z - continue - end + if not post_top_z then + post_top_z = cur_z + continue + end - if cur_z ~= rail_z then - need_post = true - end + if cur_z ~= post_top_z then + need_post = true + end - rail_z = math.max(rail_z, cur_z) - end + post_top_z = math.max(post_top_z, cur_z) - if need_post then - corner.kind = "post" - corner.post_top_h = rail_z + (corner.areas[1].room.scenic_fence.rail_h or 72) + -- Use the defined heights in the scenic fence + -- materials for the post height offset -MSSP + post_top_z = post_top_z + (corner.areas[1].room.scenic_fence.rail_h or 72) + + corner.kind = "post" + corner.post_top_h = post_top_z + end + + if junc.E1.kind == "fence" and junc.E1.area.is_porch then + corner.kind = "pillar" + corner.mat = assert(junc.E1.area.room.zone.fence_mat or junc.E1.area.room.main_tex) + end end end diff --git a/src/scripts/render.lua b/src/scripts/render.lua index 06b655395..bf8868b84 100644 --- a/src/scripts/render.lua +++ b/src/scripts/render.lua @@ -955,7 +955,18 @@ function Render_corner(cx, cy) local function make_pillar() - -- TODO + -- MSSP-TODO: we need this to get some nicer transitions + -- between porch fences and stairs! + local mx, my = corner.x, corner.y + local mat = corner.mat + + local def = PREFABS.Fence_pillar + + local T = Trans.spot_transform(mx, my, 1024, dir) + + local skin = {wall=mat} + + Fabricate(nil, def, T, {skin}) end