- Duke: cleanup on z-checks, part 4.

This commit is contained in:
Christoph Oelckers 2022-02-04 01:00:28 +01:00
parent 665ee69eba
commit 8f64518637
4 changed files with 16 additions and 16 deletions

View file

@ -389,7 +389,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
if (t->sectp->lotag == 2) k += 1795 - 1405;
else if ((h->actor_int_floorz() - h->int_pos().Z) > (64 << 8)) k += 60;
else if ((h->floorz - h->spr.pos.Z) > 64) k += 60;
t->picnum += k;
t->pal = ps[p].palookup;
@ -399,9 +399,9 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (ps[p].on_crane == nullptr && (h->sector()->lotag & 0x7ff) != 1)
{
l = h->int_pos().Z - ps[p].GetActor()->actor_int_floorz() + (3 << 8);
if (l > 1024 && h->spr.yrepeat > 32 && h->spr.extra > 0)
h->spr.yoffset = (int8_t)(l / (h->spr.yrepeat << 2));
double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3;
if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0)
h->spr.yoffset = (int8_t)(v * (1/REPEAT_SCALE) / h->spr.yrepeat);
else h->spr.yoffset = 0;
}
@ -428,8 +428,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (!h->GetOwner()) continue;
if (t->int_pos().Z > h->actor_int_floorz() && t->xrepeat < 32)
t->set_int_z(h->actor_int_floorz());
if (t->pos.Z > h->floorz && t->xrepeat < 32)
t->pos.Z = h->floorz;
break;

View file

@ -435,7 +435,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
}
if (t->sectp->lotag == 2) k += 1795 - 1405;
else if ((h->actor_int_floorz() - h->int_pos().Z) > (64 << 8)) k += 60;
else if ((h->floorz - h->spr.pos.Z) > 64) k += 60;
t->picnum += k;
t->pal = ps[p].palookup;
@ -445,9 +445,9 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (ps[p].on_crane == nullptr && (h->sector()->lotag & 0x7ff) != 1)
{
l = h->int_pos().Z - ps[p].GetActor()->actor_int_floorz() + (3 << 8);
if (l > 1024 && h->spr.yrepeat > 32 && h->spr.extra > 0)
h->spr.yoffset = (int8_t)(l / (h->spr.yrepeat << 2));
double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3;
if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0)
h->spr.yoffset = (int8_t)(v * (1 / REPEAT_SCALE) / h->spr.yrepeat);
else h->spr.yoffset = 0;
}
@ -474,8 +474,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (!h->GetOwner()) continue;
if (t->int_pos().Z > h->actor_int_floorz() && t->xrepeat < 32)
t->set_int_z(h->actor_int_floorz());
if (t->pos.Z > h->floorz && t->xrepeat < 32)
t->pos.Z = h->floorz;
if (ps[p].OnMotorcycle && p == screenpeek)
{

View file

@ -527,7 +527,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == RESPAWNMARKERRED)
{
act->spr.xrepeat = act->spr.yrepeat = 24;
if (actj) act->set_int_z(actj->actor_int_floorz()); // -(1<<4);
if (actj) act->spr.pos.Z = actj->floorz; // -(1<<4);
}
else
{
@ -939,7 +939,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
getglobalz(act);
int j = (act->actor_int_floorz() - act->actor_int_ceilingz()) >> 9;
int j = int((act->floorz - act->ceilingz) * 0.5);
act->spr.yrepeat = j;
act->spr.xrepeat = 25 - (j >> 1);

View file

@ -554,7 +554,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == RESPAWNMARKERRED)
{
act->spr.xrepeat = act->spr.yrepeat = 8;
if (actj) act->set_int_z(actj->actor_int_floorz());
if (actj) act->spr.pos.Z = actj->floorz;
}
else
{
@ -1092,7 +1092,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
getglobalz(act);
int j = (act->actor_int_floorz() - act->actor_int_ceilingz()) >> 9;
int j = int((act->floorz - act->ceilingz) * 0.5);
act->spr.yrepeat = j;
act->spr.xrepeat = 25 - (j >> 1);