mirror of
https://github.com/DrBeef/Raze.git
synced 2025-04-03 14:40:45 +00:00
- Duke: use pointers in interpolation interface.
This commit is contained in:
parent
0d8b380b05
commit
a7634c4cad
5 changed files with 56 additions and 38 deletions
|
@ -180,43 +180,34 @@ void ClearMovementInterpolations()
|
|||
|
||||
void setsectinterpolate(int sectnum)
|
||||
{
|
||||
int j, k, startwall, endwall;
|
||||
auto sect = §or[sectnum];
|
||||
|
||||
startwall = sect->wallptr;
|
||||
endwall = startwall + sect->wallnum;
|
||||
|
||||
for (j = startwall; j < endwall; j++)
|
||||
for (auto&wal : wallsofsector(sectnum))
|
||||
{
|
||||
StartInterpolation(j, Interp_Wall_X);
|
||||
StartInterpolation(j, Interp_Wall_Y);
|
||||
k = wall[j].nextwall;
|
||||
if (k >= 0)
|
||||
StartInterpolation(&wal, Interp_Wall_X);
|
||||
StartInterpolation(&wal, Interp_Wall_Y);
|
||||
auto nwal = wal.nextWall();
|
||||
if (nwal)
|
||||
{
|
||||
StartInterpolation(k, Interp_Wall_X);
|
||||
StartInterpolation(k, Interp_Wall_Y);
|
||||
k = wall[k].point2;
|
||||
StartInterpolation(k, Interp_Wall_X);
|
||||
StartInterpolation(k, Interp_Wall_Y);
|
||||
StartInterpolation(nwal, Interp_Wall_X);
|
||||
StartInterpolation(nwal, Interp_Wall_Y);
|
||||
nwal = nwal->point2Wall();
|
||||
StartInterpolation(nwal, Interp_Wall_X);
|
||||
StartInterpolation(nwal, Interp_Wall_Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void clearsectinterpolate(int sectnum)
|
||||
{
|
||||
short j, startwall, endwall;
|
||||
auto sect = §or[sectnum];
|
||||
|
||||
startwall = sect->wallptr;
|
||||
endwall = startwall + sect->wallnum;
|
||||
for (j = startwall; j < endwall; j++)
|
||||
for (auto& wal : wallsofsector(sectnum))
|
||||
{
|
||||
StopInterpolation(j, Interp_Wall_X);
|
||||
StopInterpolation(j, Interp_Wall_Y);
|
||||
if (wall[j].nextwall >= 0)
|
||||
StopInterpolation(&wal, Interp_Wall_X);
|
||||
StopInterpolation(&wal, Interp_Wall_Y);
|
||||
if (wal.nextwall >= 0)
|
||||
{
|
||||
StopInterpolation(wall[j].nextwall, Interp_Wall_X);
|
||||
StopInterpolation(wall[j].nextwall, Interp_Wall_Y);
|
||||
StopInterpolation(wal.nextWall(), Interp_Wall_X);
|
||||
StopInterpolation(wal.nextWall(), Interp_Wall_Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "gamefuncs.h"
|
||||
|
||||
enum EInterpolationType
|
||||
{
|
||||
|
@ -32,3 +33,29 @@ void RestoreInterpolations();
|
|||
void SerializeInterpolations(FSerializer& arc);
|
||||
void clearsectinterpolate(int sectnum);
|
||||
void setsectinterpolate(int sectnum);
|
||||
|
||||
inline void StartInterpolation(walltype* wall, int type)
|
||||
{
|
||||
assert(type == Interp_Wall_X || type == Interp_Wall_Y || type == Interp_Wall_PanX || type == Interp_Wall_PanY);
|
||||
return StartInterpolation(wallnum(wall), type);
|
||||
}
|
||||
|
||||
inline void StartInterpolation(sectortype* sect, int type)
|
||||
{
|
||||
assert(type == Interp_Sect_Floorz || type == Interp_Sect_Ceilingz || type == Interp_Sect_Floorheinum || type == Interp_Sect_Ceilingheinum ||
|
||||
type == Interp_Sect_FloorPanX || type == Interp_Sect_FloorPanY || type == Interp_Sect_CeilingPanX || type == Interp_Sect_CeilingPanY);
|
||||
return StartInterpolation(sectnum(sect), type);
|
||||
}
|
||||
|
||||
inline void StopInterpolation(walltype* wall, int type)
|
||||
{
|
||||
assert(type == Interp_Wall_X || type == Interp_Wall_Y || type == Interp_Wall_PanX || type == Interp_Wall_PanY);
|
||||
return StopInterpolation(wallnum(wall), type);
|
||||
}
|
||||
|
||||
inline void StopInterpolation(sectortype* sect, int type)
|
||||
{
|
||||
assert(type == Interp_Sect_Floorz || type == Interp_Sect_Ceilingz || type == Interp_Sect_Floorheinum || type == Interp_Sect_Ceilingheinum ||
|
||||
type == Interp_Sect_FloorPanX || type == Interp_Sect_FloorPanY || type == Interp_Sect_CeilingPanX || type == Interp_Sect_CeilingPanY);
|
||||
return StopInterpolation(sectnum(sect), type);
|
||||
}
|
||||
|
|
|
@ -3471,7 +3471,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
|
|||
|
||||
s->z += s->zvel;
|
||||
sc->ceilingz += s->zvel;
|
||||
sector[t[0]].ceilingz += s->zvel;
|
||||
actor->temp_sect->ceilingz += s->zvel;
|
||||
ms(actor);
|
||||
setsprite(actor, s->pos);
|
||||
}
|
||||
|
|
|
@ -1057,7 +1057,7 @@ void enterlevel(MapRecord *mi, int gamemode)
|
|||
for (auto& wal : walls())
|
||||
{
|
||||
if (wal.picnum == 7873 || wal.picnum == 7870)
|
||||
StartInterpolation(wallnum(&wal), Interp_Wall_PanX);
|
||||
StartInterpolation(&wal, Interp_Wall_PanX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -686,7 +686,7 @@ void spawneffector(DDukeActor* actor)
|
|||
t[4] = sectp->ceilingz;
|
||||
|
||||
sectp->ceilingz = sp->z;
|
||||
StartInterpolation(sect, Interp_Sect_Ceilingz);
|
||||
StartInterpolation(sectp, Interp_Sect_Ceilingz);
|
||||
break;
|
||||
case SE_35:
|
||||
sectp->ceilingz = sp->z;
|
||||
|
@ -768,8 +768,8 @@ void spawneffector(DDukeActor* actor)
|
|||
|
||||
if (numplayers < 2)
|
||||
{
|
||||
StartInterpolation(sect, Interp_Sect_Floorz);
|
||||
StartInterpolation(sect, Interp_Sect_Ceilingz);
|
||||
StartInterpolation(sectp, Interp_Sect_Floorz);
|
||||
StartInterpolation(sectp, Interp_Sect_Ceilingz);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -778,11 +778,11 @@ void spawneffector(DDukeActor* actor)
|
|||
break;
|
||||
|
||||
case 34:
|
||||
StartInterpolation(sect, Interp_Sect_FloorPanX);
|
||||
StartInterpolation(sectp, Interp_Sect_FloorPanX);
|
||||
break;
|
||||
|
||||
case SE_24_CONVEYOR:
|
||||
StartInterpolation(sect, Interp_Sect_FloorPanX);
|
||||
StartInterpolation(sectp, Interp_Sect_FloorPanX);
|
||||
sp->yvel <<= 1;
|
||||
case SE_36_PROJ_SHOOTER:
|
||||
break;
|
||||
|
@ -820,8 +820,8 @@ void spawneffector(DDukeActor* actor)
|
|||
}
|
||||
|
||||
actor->temp_walls[1] = closewall;
|
||||
StartInterpolation(sect, Interp_Sect_FloorPanX);
|
||||
StartInterpolation(sect, Interp_Sect_FloorPanY);
|
||||
StartInterpolation(sectp, Interp_Sect_FloorPanX);
|
||||
StartInterpolation(sectp, Interp_Sect_FloorPanY);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -854,7 +854,7 @@ void spawneffector(DDukeActor* actor)
|
|||
for (auto& wal : wallsofsector(sectp))
|
||||
if (wal.hitag == 0) wal.hitag = 9999;
|
||||
|
||||
StartInterpolation(sect, Interp_Sect_Floorz);
|
||||
StartInterpolation(sectp, Interp_Sect_Floorz);
|
||||
|
||||
break;
|
||||
case SE_32_CEILING_RISE_FALL:
|
||||
|
@ -865,7 +865,7 @@ void spawneffector(DDukeActor* actor)
|
|||
for (auto& wal : wallsofsector(sectp))
|
||||
if (wal.hitag == 0) wal.hitag = 9999;
|
||||
|
||||
StartInterpolation(sect, Interp_Sect_Ceilingz);
|
||||
StartInterpolation(sectp, Interp_Sect_Ceilingz);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -1063,8 +1063,8 @@ void spawneffector(DDukeActor* actor)
|
|||
break;
|
||||
|
||||
case SE_29_WAVES:
|
||||
StartInterpolation(actor->s->sectnum, Interp_Sect_Floorheinum);
|
||||
StartInterpolation(actor->s->sectnum, Interp_Sect_Floorz);
|
||||
StartInterpolation(actor->s->sector(), Interp_Sect_Floorheinum);
|
||||
StartInterpolation(actor->s->sector(), Interp_Sect_Floorz);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue