Classic: implement horiz. tex panning for sprites (spriteext[].xpanning).

Known as getactor/sprite[].xpanning from CON, values are 0-255. It should be
assumed that this is only valid for wall-aligned sprites (currently, face
sprites also pan).

A test is provided in lunatic/test/animatesprites.con. It should be run in E1L2
and only with the Lunatic build.

git-svn-id: https://svn.eduke32.com/eduke32@4170 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-22 19:26:21 +00:00
parent bc54631888
commit fd978ced59
2 changed files with 25 additions and 1 deletions

View file

@ -5498,7 +5498,8 @@ static void setup_globals_sprite1(const spritetype *tspr, const sectortype *sec,
globalorientation = 0; globalorientation = 0;
globalpicnum = tilenum; globalpicnum = tilenum;
if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0; if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0;
globalxpanning = 0; // sprite panning
globalxpanning = (((256-spriteext[tspr->owner].xpanning)&255) * tilesizx[globalpicnum])>>8;
globalypanning = 0; globalypanning = 0;
globvis = globalvisibility; globvis = globalvisibility;

View file

@ -13,6 +13,9 @@ gamevar florz 0 0
gamevar florhit 0 0 gamevar florhit 0 0
gamevar pi 0 0 gamevar pi 0 0
gamevar doxp 0 0
gamevar xp 0 0
define Q 500 define Q 500
gamevar pdist 0 2 gamevar pdist 0 2
@ -20,6 +23,25 @@ gamevar pdist 0 2
onevent EVENT_GAME onevent EVENT_GAME
ifactor LIZTROOP ifactor LIZTROOP
findplayer pdist findplayer pdist
// Test both view/wall/floor sprites for
// spriteext[].xpanning (Polymost only)
setvar doxp 0
ifactor 937 // --- vvv --- E2L1
setvar doxp 1
else ifactor FEMMAG1
setvar doxp 1
else ifactor PIGCOP
setvar doxp 1
else ifactor 849 // 64x24: in classic, better than nonpow2-x tile 937
setvar doxp 1
ifvarn doxp 0
{
getactor[THISACTOR].xpanning xp
addvar xp 1
setactor[THISACTOR].xpanning xp
}
endevent endevent
onevent EVENT_ANIMATESPRITES onevent EVENT_ANIMATESPRITES
@ -43,6 +65,7 @@ onevent EVENT_DISPLAYREST
} }
getplayer[THISACTOR].i pi getplayer[THISACTOR].i pi
// This blows up on C-CON:
getzrange sprite[pi].x sprite[pi].y sprite[pi].z player[THISACTOR].cursectnum getzrange sprite[pi].x sprite[pi].y sprite[pi].z player[THISACTOR].cursectnum
/*out:*/ ceilz ceilhit florz florhit /*out:*/ ceilz ceilhit florz florhit
/*in:*/ 128 CLIPMASK0 /*in:*/ 128 CLIPMASK0