Skip to content

Commit 56267ec

Browse files
committed
Read line vertices from system bus
1 parent 04c4ee3 commit 56267ec

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

Assets/Lua/Doom/dsda-data.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,18 @@ dsda.sector = dsda.struct_layout(nil, dsda.SECTOR_SIZE, "Sectors")
445445
.s32 ("ceiling_xscale")
446446
.s32 ("ceiling_yscale")
447447

448+
-- vertex_t https://github.com/TASEmulators/dsda-doom/blob/623068c33f6bf21239c6c6941f221011b08b6bb9/prboom2/src/r_defs.h#L70-L80
449+
dsda.vertex = dsda.struct_layout()
450+
.s32 ("x")
451+
.s32 ("y")
452+
.s32 ("px")
453+
.s32 ("py")
454+
448455
-- line_t https://github.com/TASEmulators/dsda-doom/blob/5608ee441410ecae10a17ecdbe1940bd4e1a2856/prboom2/src/r_defs.h#L312-L347
449-
-- followed by v1, v2 coords
450456
dsda.line = dsda.struct_layout(nil, dsda.LINE_SIZE, "Lines")
451457
.s32 ("iLineID")
452-
.ptr ("v1")
453-
.ptr ("v2")
458+
.ptrto("v1", dsda.vertex)
459+
.ptrto("v2", dsda.vertex)
454460
.s32 ("dx")
455461
.s32 ("dy")
456462
.float("texel_length")
@@ -484,12 +490,6 @@ dsda.line = dsda.struct_layout(nil, dsda.LINE_SIZE, "Lines")
484490
.s32 ("healthgroup")
485491
.ptr ("tranmap")
486492
.float("alpha")
487-
.align(8)
488-
-- BizHawk
489-
.s32 ("v1_x")
490-
.s32 ("v1_y")
491-
.s32 ("v2_x")
492-
.s32 ("v2_y")
493493

494494

495495

Assets/Lua/Doom/things-lines.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,12 @@ local function iterate()
228228
-- when moving so this is a decent way of cutting down on memory reads
229229
local validcount = line.validcount
230230
if validcount ~= line._validcount then
231+
local v1, v2 = line.v1, line.v2
231232
line._validcount = validcount
232-
line._v1 = { x = line.v1_x,
233-
y = -line.v1_y, }
234-
line._v2 = { x = line.v2_x,
235-
y = -line.v2_y, }
233+
line._v1 = { x = v1.x,
234+
y = -v1.y, }
235+
line._v2 = { x = v2.x,
236+
y = -v2.y, }
236237
end
237238
local v1, v2 = line._v1, line._v2
238239
local special = line.special

0 commit comments

Comments
 (0)