mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 04:00:53 +00:00
- SW: let sector objects properly invalidate the sector they are in.
This commit is contained in:
parent
a4174352c7
commit
f6984314b7
1 changed files with 8 additions and 6 deletions
|
@ -69,7 +69,7 @@ static struct so_interp
|
||||||
bool hasvator;
|
bool hasvator;
|
||||||
} so_interpdata[MAX_SECTOR_OBJECTS];
|
} so_interpdata[MAX_SECTOR_OBJECTS];
|
||||||
|
|
||||||
static int &getvalue(int element)
|
static int &getvalue(int element, bool write)
|
||||||
{
|
{
|
||||||
static int scratch;
|
static int scratch;
|
||||||
int index = element & soi_base;
|
int index = element & soi_base;
|
||||||
|
@ -77,8 +77,10 @@ static int &getvalue(int element)
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case soi_wallx:
|
case soi_wallx:
|
||||||
|
if (write) sector[wall[index].sector].dirty = 255;
|
||||||
return wall[index].x;
|
return wall[index].x;
|
||||||
case soi_wally:
|
case soi_wally:
|
||||||
|
if (write) sector[wall[index].sector].dirty = 255;
|
||||||
return wall[index].y;
|
return wall[index].y;
|
||||||
case soi_ceil:
|
case soi_ceil:
|
||||||
return sector[index].ceilingz;
|
return sector[index].ceilingz;
|
||||||
|
@ -116,7 +118,7 @@ static void so_setpointinterpolation(so_interp *interp, int element)
|
||||||
data->curelement = element;
|
data->curelement = element;
|
||||||
data->oldipos =
|
data->oldipos =
|
||||||
data->lastipos =
|
data->lastipos =
|
||||||
data->lastoldipos = getvalue(element);
|
data->lastoldipos = getvalue(element, false);
|
||||||
data->spriteofang = -1;
|
data->spriteofang = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +270,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings
|
||||||
data->oldipos = sprite[data->spriteofang].ang;
|
data->oldipos = sprite[data->spriteofang].ang;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
data->oldipos = getvalue(data->curelement);
|
data->oldipos = getvalue(data->curelement, false);
|
||||||
|
|
||||||
if (!interpolating)
|
if (!interpolating)
|
||||||
data->lastipos = data->lastoldipos = data->oldipos;
|
data->lastipos = data->lastoldipos = data->oldipos;
|
||||||
|
@ -297,7 +299,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
||||||
for (i = 0; i < interp->numinterpolations; i++)
|
for (i = 0; i < interp->numinterpolations; i++)
|
||||||
interp->data[i].bakipos = (interp->data[i].spriteofang >= 0) ?
|
interp->data[i].bakipos = (interp->data[i].spriteofang >= 0) ?
|
||||||
sprite[interp->data[i].spriteofang].ang :
|
sprite[interp->data[i].spriteofang].ang :
|
||||||
getvalue(interp->data[i].curelement);
|
getvalue(interp->data[i].curelement, false);
|
||||||
|
|
||||||
if (interp->tic == 0) // Only if the SO has just moved
|
if (interp->tic == 0) // Only if the SO has just moved
|
||||||
{
|
{
|
||||||
|
@ -361,7 +363,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delta = data->lastipos - data->lastoldipos;
|
delta = data->lastipos - data->lastoldipos;
|
||||||
getvalue(data->curelement) = data->lastoldipos + MulScale(delta, ratio, 16);
|
getvalue(data->curelement, true) = data->lastoldipos + MulScale(delta, ratio, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,7 +387,7 @@ void so_restoreinterpolations(void) // Stick at end of drawscree
|
||||||
if (data->spriteofang >= 0)
|
if (data->spriteofang >= 0)
|
||||||
sprite[data->spriteofang].ang = data->bakipos;
|
sprite[data->spriteofang].ang = data->bakipos;
|
||||||
else
|
else
|
||||||
getvalue(data->curelement) = data->bakipos;
|
getvalue(data->curelement, true) = data->bakipos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue