mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
LunaCON: warn if using reserved bits in 'spriteflags'.
Reserved bits are those that have no predefined SFLAG_* label in CON. git-svn-id: https://svn.eduke32.com/eduke32@4372 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
5cb6e20c63
commit
6908ce6be7
2 changed files with 17 additions and 17 deletions
|
@ -300,9 +300,12 @@ labels =
|
||||||
GAMEFUNC,
|
GAMEFUNC,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user_sflags = 0
|
||||||
-- TWEAK_SFLAG
|
-- TWEAK_SFLAG
|
||||||
for name, flag in pairs(SFLAG) do
|
for name, flag in pairs(SFLAG) do
|
||||||
if (flag < 0) then
|
if (flag > 0) then
|
||||||
|
user_sflags = user_sflags + flag
|
||||||
|
else
|
||||||
SFLAG[name] = -flag
|
SFLAG[name] = -flag
|
||||||
labels[4][name] = nil
|
labels[4][name] = nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -1286,17 +1286,14 @@ function Cmd.defineprojectile(tilenum, what, val)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- flags: if string, look up in ffiC and OR, else set number directly.
|
-- <override>: override-set flags? The default is to bitwise OR with existing.
|
||||||
function Cmd.xspriteflags(tilenum, flags)
|
function Cmd.xspriteflags(tilenum, flags, override)
|
||||||
local ok = check.tile_idx(tilenum)
|
local ok = check.tile_idx(tilenum)
|
||||||
|
check.reserved_bits(flags, conl.user_sflags, "for sprite flags")
|
||||||
|
|
||||||
if (ffi and ok) then
|
if (ffi and ok) then
|
||||||
if (type(flags)=="number") then
|
local tile = ffiC.g_tile[tilenum]
|
||||||
ffiC.g_tile[tilenum]._flags = flags
|
tile._flags = bit.bor(override and 0 or tile._flags, flags)
|
||||||
else
|
|
||||||
assert(type(flags)=="string")
|
|
||||||
ffiC.g_tile[tilenum]._flags = bit.bor(ffiC.g_tile[tilenum]._flags, ffiC[flags])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1304,10 +1301,10 @@ function Cmd.precache(tilenum0, tilenum1, flagnum)
|
||||||
local ok = check.tile_idx(tilenum0) and check.tile_idx(tilenum1)
|
local ok = check.tile_idx(tilenum0) and check.tile_idx(tilenum1)
|
||||||
|
|
||||||
if (ffi and ok) then
|
if (ffi and ok) then
|
||||||
ffiC.g_tile[tilenum0]._cacherange = tilenum1;
|
local tile = ffiC.g_tile[tilenum0]
|
||||||
|
tile._cacherange = tilenum1;
|
||||||
if (flagnum) then
|
if (flagnum) then
|
||||||
ffiC.g_tile[tilenum0]._flags = bit.bor(
|
tile._flags = bit.bor(tile._flags, conl.SFLAG.SFLAG_CACHE)
|
||||||
ffiC.g_tile[tilenum0]._flags, conl.SFLAG.SFLAG_CACHE)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1807,16 +1804,16 @@ local Couter = {
|
||||||
gamestartup = (sp1 * tok.define)^26
|
gamestartup = (sp1 * tok.define)^26
|
||||||
/ Cmd.gamestartup,
|
/ Cmd.gamestartup,
|
||||||
spritenopal = cmd(D)
|
spritenopal = cmd(D)
|
||||||
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, "SFLAG_NOPAL") end,
|
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, conl.SFLAG.SFLAG_NOPAL) end,
|
||||||
spritenoshade = cmd(D)
|
spritenoshade = cmd(D)
|
||||||
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, "SFLAG_NOSHADE") end,
|
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, conl.SFLAG.SFLAG_NOSHADE) end,
|
||||||
spritenvg = cmd(D)
|
spritenvg = cmd(D)
|
||||||
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, "SFLAG_NVG") end,
|
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, conl.SFLAG.SFLAG_NVG) end,
|
||||||
spriteshadow = cmd(D)
|
spriteshadow = cmd(D)
|
||||||
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, "SFLAG_SHADOW") end,
|
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, conl.SFLAG.SFLAG_SHADOW) end,
|
||||||
|
|
||||||
spriteflags = cmd(D,D) -- also see inner
|
spriteflags = cmd(D,D) -- also see inner
|
||||||
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, flags) end,
|
/ function(tilenum, flags) Cmd.xspriteflags(tilenum, flags, true) end,
|
||||||
|
|
||||||
--- 4. Game Variables / Arrays
|
--- 4. Game Variables / Arrays
|
||||||
gamevar = cmd(I,D,D)
|
gamevar = cmd(I,D,D)
|
||||||
|
|
Loading…
Reference in a new issue