Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
- Added the fabrication of support pillars to the fences created for …
Browse files Browse the repository at this point in the history
…porches.
  • Loading branch information
GTD-Carthage committed May 24, 2019
1 parent 3b66903 commit b938d0c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 17 deletions.
9 changes: 9 additions & 0 deletions src/games/doom/fabs/fence/gtd_pillar.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- pillar do a pretty good job

PREFABS.Fence_pillar =
{
file = "fence/gtd_pillar.wad"
map = "MAP01"

where = "point"
}
Binary file added src/games/doom/fabs/fence/gtd_pillar.wad
Binary file not shown.
40 changes: 24 additions & 16 deletions src/scripts/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 12 additions & 1 deletion src/scripts/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit b938d0c

Please sign in to comment.