m32script: in tsprite access, fix checking min/max/RO; tweak RESPAWN preview.

This fixes RESPAWN preview wrongly clamping the previewed tsprite z coords to
[-524288 .. 524288] (x/y limits).
Also, make the previewed tsprites be 33% translucent with the option of 66%
translucency by setting 'showrespawn_fulltrans' to 1 in a.m32.

git-svn-id: https://svn.eduke32.com/eduke32@3699 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-04-21 19:55:32 +00:00
parent 3792cc7312
commit e1a9cadbce
2 changed files with 8 additions and 1 deletions

View file

@ -37,6 +37,8 @@ gamevar use_notebook_keys 0 0
// Whether RESPAWN sprites show the respawned sprite picnum unconditionally instead of // Whether RESPAWN sprites show the respawned sprite picnum unconditionally instead of
// only when aimed at (and locked onto) the RESPAWN sprite in 3D mode. // only when aimed at (and locked onto) the RESPAWN sprite in 3D mode.
gamevar showrespawn_always 0 0 gamevar showrespawn_always 0 0
// When set to 1, previewed sprites are 66% translucent instead of 33%:
gamevar showrespawn_fulltrans 0 0
gamevar move_by_one 0 0 gamevar move_by_one 0 0
@ -1130,6 +1132,11 @@ defstate respawnpreview
set pic sprite[ow].hitag set pic sprite[ow].hitag
ifge pic 0 ifl pic MAXTILES ifge pic 0 ifl pic MAXTILES
set tsprite[k].picnum pic set tsprite[k].picnum pic
and tsprite[k].cstat 0xfffffdff // clear bit 512 (reverse translucency)
or tsprite[k].cstat 2 // set bit 2 (33% translucency)
ifvarn showrespawn_fulltrans 0
or tsprite[k].cstat 512
} }
} }
} }

View file

@ -389,7 +389,7 @@ static int32_t __fastcall VM_AccessTsprite(int32_t how, int32_t lVar1, int32_t l
int32_t lightp = (lLabelID >= LIGHT_X); int32_t lightp = (lLabelID >= LIGHT_X);
int32_t i = (how&ACCESS_USEVARS) ? vm.g_i : lVar1; int32_t i = (how&ACCESS_USEVARS) ? vm.g_i : lVar1;
spritetype *datspr = NULL; spritetype *datspr = NULL;
const memberlabel_t *dalabel = lightp ? &LightLabels[lLabelID-LIGHT_X] : SpriteLabels; const memberlabel_t *dalabel = lightp ? &LightLabels[lLabelID-LIGHT_X] : &SpriteLabels[lLabelID];
if ((how&ACCESS_USEVARS) && lVar1 != M32_THISACTOR_VAR_ID) if ((how&ACCESS_USEVARS) && lVar1 != M32_THISACTOR_VAR_ID)
i = Gv_GetVarX(lVar1); i = Gv_GetVarX(lVar1);