Lunatic: tweak sector.STAT.* and other names a little.

git-svn-id: https://svn.eduke32.com/eduke32@3851 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-06-06 11:22:35 +00:00
parent 6cc62ea2bf
commit f8c04673b4
2 changed files with 35 additions and 29 deletions

View file

@ -739,56 +739,62 @@ function conststruct(tab)
end end
-- Static, non-instance members. Used to hold constants, for example -- Static, non-instance members. Used to hold constants, for example
-- sprite.CSTAT.TRANSLUCENT1 -- sprite.CSTAT.TRANS1
local static_members = { sector={}, wall={}, sprite={} } local static_members = { sector={}, wall={}, sprite={} }
-- XXX: go over these constant names and see if they can be named better.
static_members.sector.STAT = conststruct static_members.sector.STAT = conststruct
{ {
PARALLAX = 1, PARALLAX = 1,
SLOPED = 2, SLOPE = 2,
XYSWAP = 4, SWAPXY = 4,
SMOOSH = 8, SMOOSH = 8,
XFLIP = 16, FLIPX = 16,
YFLIP = 32, FLIPY = 32,
RELATIVE = 64, RELATIVE = 64,
MASKED = 128, MASK = 128,
-- NOTE the reversed order -- NOTE the reversed order
TRANSLUCENT2 = 128, TRANS2 = 128,
TRANSLUCENT1 = 256, TRANS1 = 256,
TRANSLUCENT_BOTH_BITS = 256+128, BLOCK = 512,
BLOCKING = 512,
HITSCAN = 1024, HITSCAN = 1024,
FLIP_BITMASK = 16+32,
ORIENT_BITMASK = 4+16+32,
TRANS_BITMASK = 128+256,
} }
static_members.wall.CSTAT = conststruct static_members.wall.CSTAT = conststruct
{ {
BLOCKING = 1, BLOCK = 1,
BOTTOMSWAP = 2, BOTTOMSWAP = 2,
BOTTOMALIGN = 4, ALIGNBOTTOM = 4,
XFLIP = 8, FLIPX = 8,
MASKED = 16, MASK = 16,
ONEWAY = 32, ONEWAY = 32,
HITSCAN = 64, HITSCAN = 64,
TRANSLUCENT1 = 128, TRANS1 = 128,
YFLIP = 256, FLIPY = 256,
TRANSLUCENT2 = 512, TRANS2 = 512,
TRANSLUCENT_BOTH_BITS = 512+128,
FLIP_BITMASK = 8+256,
TRANS_BITMASK = 128+512,
} }
static_members.sprite.CSTAT = conststruct static_members.sprite.CSTAT = conststruct
{ {
BLOCKING = 1, BLOCK = 1,
TRANSLUCENT1 = 2, TRANS1 = 2,
XFLIP = 4, XFLIP = 4,
YFLIP = 8, YFLIP = 8,
WALLALIGN = 16, ALIGNWALL = 16,
FLOORALIGN = 32, ALIGNFLOOR = 32,
ONESIDED = 64, ONESIDE = 64,
CENTERED = 128, CENTER = 128,
HITSCAN = 256, HITSCAN = 256,
TRANSLUCENT2 = 512, TRANS2 = 512,
TRANSLUCENT_BOTH_BITS = 512+2,
ALIGN_BITMASK = 16+32,
TRANS_BITMASK = 2+512,
} }
local bitar = require("bitar") local bitar = require("bitar")

View file

@ -52,7 +52,7 @@ for i = 0, gv.numsectors/2 do
local ceil = sec.ceiling local ceil = sec.ceiling
ceil.shade = sector[i].ceiling.shade + 8 ceil.shade = sector[i].ceiling.shade + 8
ceil.statx:flip(SF.SMOOSH) ceil.statx:flip(SF.SMOOSH)
sec.floorstatx:flip(SF.XYSWAP) sec.floorstatx:flip(SF.SWAPXY)
end end
local vol, lev = gv.currentEpisode()+1, gv.currentLevel()+1 local vol, lev = gv.currentEpisode()+1, gv.currentLevel()+1
@ -455,7 +455,7 @@ function(aci)
if (tspr2) then if (tspr2) then
tspr2.x = tspr2.x + 512*math.cos(gv.totalclock/60) tspr2.x = tspr2.x + 512*math.cos(gv.totalclock/60)
tspr2.y = tspr2.y + 512*math.sin(gv.totalclock/60) tspr2.y = tspr2.y + 512*math.sin(gv.totalclock/60)
tspr2.cstatx:set(CS.TRANSLUCENT_BOTH_BITS) tspr2.cstatx:set(CS.TRANS_BITMASK)
end end
end end
end) end)