Commit 0f0cc936 authored by NY00123's avatar NY00123 Committed by Evan Ramos
Browse files

SW: While not exactly a favorite of mine, this fixes the floorz updates

of the secret rotating pillar in level 1 with SO interpolation.
The drill in level 2 is also covered. So far, SetVatorActive seems
to be the only place where interpolation of ceiling/floorz
may be set, outside of the SO interpolation code.
parent d473e602
......@@ -127,7 +127,7 @@ SWBOOL Global_PLock = FALSE;
#endif
// 12 was original source release. For future releases increment by two.
int GameVersion = 15;
int GameVersion = 17;
char DemoText[3][64];
int DemoTextYstart = 0;
......
......@@ -30,6 +30,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "game.h"
#include "interp.h"
#include "interpso.h"
#include "names2.h"
#define SO_MAXINTERPOLATIONS MAXINTERPOLATIONS
......@@ -48,6 +49,7 @@ static struct so_interp
int32_t numinterpolations;
int32_t tic, lasttic;
SWBOOL hasvator;
} so_interpdata[MAX_SECTOR_OBJECTS];
static void so_setpointinterpolation(so_interp *interp, int32_t *posptr)
......@@ -112,6 +114,7 @@ void so_addinterpolation(SECTOR_OBJECTp sop)
so_interp *interp = &so_interpdata[sop - SectorObject];
interp->numinterpolations = 0;
interp->hasvator = FALSE;
for (sectp = sop->sectp; *sectp; sectp++)
{
......@@ -132,10 +135,19 @@ void so_addinterpolation(SECTOR_OBJECTp sop)
}
}
so_setpointinterpolation(interp, &(*sectp)->ceilingz);
so_setpointinterpolation(interp, &(*sectp)->floorz);
for (SPRITES_OF_SECT(*sectp - sector, i))
if (sprite[i].statnum == STAT_VATOR && SP_TAG1(sprite+i) == SECT_VATOR)
break;
interp->hasvator |= (i >= 0);
}
if (!interp->hasvator)
for (sectp = sop->sectp; *sectp; sectp++)
{
so_setpointinterpolation(interp, &(*sectp)->ceilingz);
so_setpointinterpolation(interp, &(*sectp)->floorz);
}
// interpolate midpoint, for aiming at a remote controlled SO
so_setpointinterpolation(interp, &sop->xmid);
so_setpointinterpolation(interp, &sop->ymid);
......@@ -151,7 +163,8 @@ void so_setspriteinterpolation(SECTOR_OBJECTp sop, spritetype *sp)
so_setpointinterpolation(interp, &sp->x);
so_setpointinterpolation(interp, &sp->y);
so_setpointinterpolation(interp, &sp->z);
if (!interp->hasvator)
so_setpointinterpolation(interp, &sp->z);
so_setspriteanginterpolation(interp, &sp->ang, sp - sprite);
}
......@@ -161,7 +174,8 @@ void so_stopspriteinterpolation(SECTOR_OBJECTp sop, spritetype *sp)
so_stopdatainterpolation(interp, &sp->x);
so_stopdatainterpolation(interp, &sp->y);
so_stopdatainterpolation(interp, &sp->z);
if (!interp->hasvator)
so_stopdatainterpolation(interp, &sp->z);
so_stopdatainterpolation(interp, &sp->ang);
}
......@@ -312,6 +326,7 @@ SWBOOL so_writeinterpolations(MFILE_WRITE fil)
{
const so_interp::interp_data *data = interp->data;
MWRITE(&interp->numinterpolations,sizeof(interp->numinterpolations),1,fil);
MWRITE(&interp->hasvator,sizeof(interp->hasvator),1,fil);
for (i = 0; i < interp->numinterpolations; i++, data++)
{
saveisshot |= SaveSymDataInfo(fil, data->curipos);
......@@ -336,6 +351,7 @@ SWBOOL so_readinterpolations(MFILE_READ fil)
{
so_interp::interp_data *data = interp->data;
MREAD(&interp->numinterpolations,sizeof(interp->numinterpolations),1,fil);
MREAD(&interp->hasvator,sizeof(interp->hasvator),1,fil);
for (i = 0; i < interp->numinterpolations; i++, data++)
{
saveisshot |= LoadSymDataInfo(fil, (void **)&data->curipos);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment