mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +00:00
New M32Script command "getspritelinktype" <spritenum> <<linktypevar>>.
This get into the writable variable the "linking type" of the sprite with index <spritenum>. The result is a bit field of ORed values: 1: lotag has linking semantics 2: hitag 4: extra, 8: xvel, 16: yvel, 32: zvel, 64: owner (custom only) Custom setting about which sprites have what kind of linking can be programmed via EVENT_LINKTAGS: it receives a sprite index as the 'current sprite' and is supposed to return the bit field in RETURN. An example which lists sprites and their linking hi- and lotags is provided in the state 'listusedtags' in a.m32. git-svn-id: https://svn.eduke32.com/eduke32@2590 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b85d40ea63
commit
607774a982
4 changed files with 30 additions and 1 deletions
|
@ -1268,6 +1268,22 @@ defstate chselshade
|
||||||
}
|
}
|
||||||
ends
|
ends
|
||||||
|
|
||||||
|
defstate listusedtags
|
||||||
|
for i allsprites
|
||||||
|
{
|
||||||
|
getspritelinktype i k
|
||||||
|
|
||||||
|
ifn k 0
|
||||||
|
{
|
||||||
|
ife k 1
|
||||||
|
qsprintf TQUOTE "sprite %d lotag %d" i sprite[i].lotag
|
||||||
|
else ife k 2
|
||||||
|
qsprintf TQUOTE "sprite %d hitag %d" i sprite[i].hitag
|
||||||
|
quote TQUOTE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ends
|
||||||
|
|
||||||
////////// USER AREA //////////
|
////////// USER AREA //////////
|
||||||
|
|
||||||
// key settings
|
// key settings
|
||||||
|
|
|
@ -303,13 +303,14 @@ const char *keyw[] =
|
||||||
"ifaimingsector",
|
"ifaimingsector",
|
||||||
"ifinteractive",
|
"ifinteractive",
|
||||||
|
|
||||||
// BUILD functions
|
// Mostly BUILD functions
|
||||||
"resetkey",
|
"resetkey",
|
||||||
"setkey",
|
"setkey",
|
||||||
"insertsprite",
|
"insertsprite",
|
||||||
"dupsprite",
|
"dupsprite",
|
||||||
"tdupsprite",
|
"tdupsprite",
|
||||||
"deletesprite",
|
"deletesprite",
|
||||||
|
"getspritelinktype", // not BUILD
|
||||||
"lastwall",
|
"lastwall",
|
||||||
"updatecursectnum",
|
"updatecursectnum",
|
||||||
"updatesector",
|
"updatesector",
|
||||||
|
@ -2845,6 +2846,7 @@ repeatcase:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case CON_SQRT:
|
case CON_SQRT:
|
||||||
|
case CON_GETSPRITELINKTYPE:
|
||||||
{
|
{
|
||||||
// syntax sqrt <invar> <outvar>
|
// syntax sqrt <invar> <outvar>
|
||||||
// gets the sqrt of invar into outvar
|
// gets the sqrt of invar into outvar
|
||||||
|
|
|
@ -458,6 +458,7 @@ enum ScriptKeywords_t
|
||||||
CON_DUPSPRITE,
|
CON_DUPSPRITE,
|
||||||
CON_TDUPSPRITE,
|
CON_TDUPSPRITE,
|
||||||
CON_DELETESPRITE,
|
CON_DELETESPRITE,
|
||||||
|
CON_GETSPRITELINKTYPE,
|
||||||
CON_LASTWALL,
|
CON_LASTWALL,
|
||||||
CON_UPDATECURSECTNUM,
|
CON_UPDATECURSECTNUM,
|
||||||
CON_UPDATESECTOR,
|
CON_UPDATESECTOR,
|
||||||
|
|
|
@ -1733,6 +1733,16 @@ badindex:
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case CON_GETSPRITELINKTYPE:
|
||||||
|
insptr++;
|
||||||
|
{
|
||||||
|
int32_t spritenum=Gv_GetVarX(*insptr++), resvar = *insptr++;
|
||||||
|
|
||||||
|
X_ERROR_INVALIDSPRI(spritenum);
|
||||||
|
Gv_SetVarX(resvar, taglab_linktags(1, spritenum));
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
case CON_LASTWALL:
|
case CON_LASTWALL:
|
||||||
insptr++;
|
insptr++;
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue