- SW: fixed interpolation for sector object sprites.

When checking for an existing interpolation it needs to check the actual sprite, not just the interpolation type.
This commit is contained in:
Christoph Oelckers 2021-04-07 15:03:00 +02:00
parent 424c0ce3f4
commit 4a6a999f89

View file

@ -108,8 +108,10 @@ static void so_setpointinterpolation(so_interp *interp, int element)
return; return;
for (i = 0; i < interp->numinterpolations; i++) for (i = 0; i < interp->numinterpolations; i++)
{
if (interp->data[i].curelement == element) if (interp->data[i].curelement == element)
return; return;
}
so_interp::interp_data *data = &interp->data[interp->numinterpolations++]; so_interp::interp_data *data = &interp->data[interp->numinterpolations++];
@ -127,7 +129,7 @@ static void so_setspriteanginterpolation(so_interp *interp, int32_t spritenum)
return; return;
for (i = 0; i < interp->numinterpolations; i++) for (i = 0; i < interp->numinterpolations; i++)
if (interp->data[i].curelement == -1) if (interp->data[i].curelement == -1 && interp->data[i].spriteofang == spritenum)
return; return;
so_interp::interp_data *data = &interp->data[interp->numinterpolations++]; so_interp::interp_data *data = &interp->data[interp->numinterpolations++];
@ -146,9 +148,16 @@ static void so_stopdatainterpolation(so_interp *interp, int element)
int32_t i; int32_t i;
for (i = 0; i < interp->numinterpolations; i++) for (i = 0; i < interp->numinterpolations; i++)
if (interp->data[i].curelement == element) {
if (interp->data[i].curelement == -1)
{
if (interp->data[i].spriteofang == element) break;
}
else if (interp->data[i].curelement == element)
break; break;
}
if (i == interp->numinterpolations) if (i == interp->numinterpolations)
return; return;
@ -217,7 +226,7 @@ void so_setspriteinterpolation(SECTOR_OBJECTp sop, spritetype *sp)
so_setpointinterpolation(interp, snum | soi_spry); so_setpointinterpolation(interp, snum | soi_spry);
if (!interp->hasvator) if (!interp->hasvator)
so_setpointinterpolation(interp, snum | soi_sprz); so_setpointinterpolation(interp, snum | soi_sprz);
so_setspriteanginterpolation(interp, int(sp - sprite)); so_setspriteanginterpolation(interp, snum);
} }
void so_stopspriteinterpolation(SECTOR_OBJECTp sop, spritetype *sp) void so_stopspriteinterpolation(SECTOR_OBJECTp sop, spritetype *sp)