LunaCON: implement 'ssp' command.

git-svn-id: https://svn.eduke32.com/eduke32@4149 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-12 21:03:11 +00:00
parent b1d6a97db4
commit 78d30bee9b
3 changed files with 25 additions and 2 deletions

View file

@ -1498,6 +1498,17 @@ function _movesprite(spritenum, x, y, z, cliptype)
return ffiC.A_MoveSprite(spritenum, vel, cliptype)
end
-- Also known as A_SetSprite().
function _ssp(i, cliptype)
check_sprite_idx(i)
local spr = ffiC.sprite[i]
local vec = spr.xvel * bangvec(spr.ang) -- XXX: slightly different rounding?
local ivec = vec:toivec3()
ivec.z = spr.zvel
return (ffiC.A_MoveSprite(i, ivec, cliptype)==0)
end
-- CON's 'setsprite' function on top of the Lunatic-provided ones.
-- (Lunatic's sprite setting functions have slightly different semantics.)
local updatesect = sprite.updatesect

View file

@ -303,7 +303,7 @@ local function new_initial_codetab()
"local _div, _mod, _mulTR, _mulWR = _con._div, _con._mod, _con._mulTR, _con._mulWR",
"local _band, _bor, _bxor = _bit.band, _bit.bor, _bit.bxor",
"local _lsh, _rsh, _arsh = _bit.lshift, _bit.rshift, _bit.arshift",
"local _setsprite = _con._setsprite",
"local _setsprite,_ssp = _con._setsprite,_con._ssp",
-- * CON "states" (subroutines) and
-- * Switch function table, indexed by global switch sequence number:
@ -2751,7 +2751,7 @@ local Cinner = {
spriteflags = cmd(R) -- also see outer
/ ACS".flags=%1",
ssp = cmd(R,R)
/ handle.NYI,
/ "_ssp(%1,%2)",
setsprite = cmd(R,R,R,R)
/ "_setsprite(%1,_IV(1,%2,%3,%4))",
updatesector = cmd(R,R,W)

View file

@ -42,3 +42,15 @@ eventloadactor GPSPEED
mulvar ra_temp 4
setactor[THISACTOR].lotag ra_temp
enda
gamevar ii 0 0
onevent EVENT_PROCESSINPUT
setvar ii 0
whilevarvarn ii MAXSPRITES
{
ifvare sprite[ii].picnum 58 // space suit
ssp ii CLIPMASK0
addvar ii 1
}
endevent