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 000000000..ef284a8cf Binary files /dev/null and b/src/games/doom/fabs/fence/gtd_pillar.wad differ 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