mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-27 22:00:52 +00:00
- animateobjs PUSH, DORMANT, ACTIVE
This commit is contained in:
parent
c1ef05b7a0
commit
95b4c60e44
1 changed files with 22 additions and 21 deletions
|
@ -742,27 +742,28 @@ void animateobjs(PLAYER& plr) {
|
||||||
// PUSH
|
// PUSH
|
||||||
for (i = headspritestat[PUSH]; i >= 0; i = nextsprite) {
|
for (i = headspritestat[PUSH]; i >= 0; i = nextsprite) {
|
||||||
nextsprite = nextspritestat[i];
|
nextsprite = nextspritestat[i];
|
||||||
|
auto& spr = sprite[i];
|
||||||
|
|
||||||
sprite[i].lotag -= TICSPERFRAME;
|
spr.lotag -= TICSPERFRAME;
|
||||||
|
|
||||||
osectnum = sprite[i].sectnum;
|
osectnum = spr.sectnum;
|
||||||
|
|
||||||
getzrange(sprite[i].x, sprite[i].y, sprite[i].z - 1, sprite[i].sectnum, (sprite[i].clipdist) << 2,
|
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2,
|
||||||
CLIPMASK0);
|
CLIPMASK0);
|
||||||
if (sprite[i].z < zr_florz)
|
if (spr.z < zr_florz)
|
||||||
daz = sprite[i].zvel += (TICSPERFRAME << 1);
|
daz = spr.zvel += (TICSPERFRAME << 1);
|
||||||
|
|
||||||
// clip type was 1
|
// clip type was 1
|
||||||
hitobject = (short) movesprite(i, (bcos(sprite[i].ang) * TICSPERFRAME) << 3,
|
hitobject = (short) movesprite(i, (bcos(spr.ang) * TICSPERFRAME) << 3,
|
||||||
(bsin(sprite[i].ang) * TICSPERFRAME) << 3, daz, 4 << 8, 4 << 8, 0);
|
(bsin(spr.ang) * TICSPERFRAME) << 3, daz, 4 << 8, 4 << 8, 0);
|
||||||
|
|
||||||
setsprite(i, sprite[i].x, sprite[i].y, sprite[i].z);
|
setsprite(i, spr.x, spr.y, spr.z);
|
||||||
|
|
||||||
if (sprite[i].lotag < 0 || (hitobject & 0xc000) == 32768) {
|
if (spr.lotag < 0 || (hitobject & 0xc000) == 32768) {
|
||||||
sprite[i].lotag = 0;
|
spr.lotag = 0;
|
||||||
changespritestat(i, (short) 0);
|
changespritestat(i, (short) 0);
|
||||||
if (sprite[i].z < sector[sprite[i].sectnum].floorz) {
|
if (spr.z < sector[spr.sectnum].floorz) {
|
||||||
sprite[i].zvel += 256L;
|
spr.zvel += 256L;
|
||||||
changespritestat(i, FALL);
|
changespritestat(i, FALL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -771,9 +772,9 @@ void animateobjs(PLAYER& plr) {
|
||||||
// DORMANT
|
// DORMANT
|
||||||
for (i = headspritestat[DORMANT]; i >= 0; i = nextsprite) {
|
for (i = headspritestat[DORMANT]; i >= 0; i = nextsprite) {
|
||||||
nextsprite = nextspritestat[i];
|
nextsprite = nextspritestat[i];
|
||||||
|
auto& spr = sprite[i];
|
||||||
|
|
||||||
if (isWh2()) {
|
if (isWh2()) {
|
||||||
SPRITE& spr = sprite[i];
|
|
||||||
osectnum = spr.sectnum;
|
osectnum = spr.sectnum;
|
||||||
j = (torchpattern[PlayClock % 38]);
|
j = (torchpattern[PlayClock % 38]);
|
||||||
sector[osectnum].ceilingshade = (byte) j;
|
sector[osectnum].ceilingshade = (byte) j;
|
||||||
|
@ -787,9 +788,9 @@ void animateobjs(PLAYER& plr) {
|
||||||
newstatus((short) i, ACTIVE);
|
newstatus((short) i, ACTIVE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprite[i].lotag -= TICSPERFRAME;
|
spr.lotag -= TICSPERFRAME;
|
||||||
sprite[i].xrepeat = sprite[i].yrepeat = 2;
|
spr.xrepeat = spr.yrepeat = 2;
|
||||||
if (sprite[i].lotag < 0) {
|
if (spr.lotag < 0) {
|
||||||
newstatus(i, ACTIVE);
|
newstatus(i, ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -798,9 +799,9 @@ void animateobjs(PLAYER& plr) {
|
||||||
// ACTIVE
|
// ACTIVE
|
||||||
for (i = headspritestat[ACTIVE]; i >= 0; i = nextsprite) {
|
for (i = headspritestat[ACTIVE]; i >= 0; i = nextsprite) {
|
||||||
nextsprite = nextspritestat[i];
|
nextsprite = nextspritestat[i];
|
||||||
|
auto& spr = sprite[i];
|
||||||
|
|
||||||
if (isWh2()) {
|
if (isWh2()) {
|
||||||
SPRITE& spr = sprite[i];
|
|
||||||
spr.lotag -= TICSPERFRAME;
|
spr.lotag -= TICSPERFRAME;
|
||||||
osectnum = spr.sectnum;
|
osectnum = spr.sectnum;
|
||||||
j = (torchpattern[PlayClock % 38]);
|
j = (torchpattern[PlayClock % 38]);
|
||||||
|
@ -821,10 +822,10 @@ void animateobjs(PLAYER& plr) {
|
||||||
newstatus((short) i, DORMANT);
|
newstatus((short) i, DORMANT);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprite[i].lotag -= TICSPERFRAME;
|
spr.lotag -= TICSPERFRAME;
|
||||||
sprite[i].xrepeat = 48;
|
spr.xrepeat = 48;
|
||||||
sprite[i].yrepeat = 32;
|
spr.yrepeat = 32;
|
||||||
if (sprite[i].lotag < 0) {
|
if (spr.lotag < 0) {
|
||||||
newstatus(i, DORMANT);
|
newstatus(i, DORMANT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue