2020-11-25 22:22:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-11-18 15:56:40 +00:00
|
|
|
#include "gamefuncs.h"
|
2020-11-25 22:22:13 +00:00
|
|
|
|
|
|
|
enum EInterpolationType
|
|
|
|
{
|
2021-11-24 15:45:31 +00:00
|
|
|
Interp_Invalid = -1,
|
|
|
|
Interp_Sect_Floorz = 0,
|
2020-11-25 22:22:13 +00:00
|
|
|
Interp_Sect_Ceilingz,
|
|
|
|
Interp_Sect_Floorheinum,
|
|
|
|
Interp_Sect_Ceilingheinum,
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-11-25 22:22:13 +00:00
|
|
|
Interp_Wall_X,
|
|
|
|
Interp_Wall_Y,
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2022-01-01 18:50:30 +00:00
|
|
|
Interp_Sprite_Z,
|
|
|
|
|
2020-11-26 16:19:42 +00:00
|
|
|
Interp_Pan_First,
|
2021-12-22 12:57:10 +00:00
|
|
|
// order of the following 4 flags must match the corresponding sector flags.
|
2020-11-26 16:19:42 +00:00
|
|
|
Interp_Sect_FloorPanX = Interp_Pan_First,
|
|
|
|
Interp_Sect_FloorPanY,
|
|
|
|
Interp_Sect_CeilingPanX,
|
|
|
|
Interp_Sect_CeilingPanY,
|
|
|
|
Interp_Wall_PanX,
|
|
|
|
Interp_Wall_PanY,
|
2020-11-25 22:22:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void StartInterpolation(int index, int type);
|
|
|
|
void StopInterpolation(int index, int type);
|
2022-01-01 18:50:30 +00:00
|
|
|
void StartInterpolation(DCoreActor* actor, int type);
|
|
|
|
void StopInterpolation(DCoreActor* actor, int type);
|
2020-11-25 22:22:13 +00:00
|
|
|
void UpdateInterpolations();
|
2020-11-26 07:38:59 +00:00
|
|
|
void ClearInterpolations();
|
2020-11-26 16:19:42 +00:00
|
|
|
void ClearMovementInterpolations();
|
2020-11-25 22:22:13 +00:00
|
|
|
void DoInterpolations(double smoothratio);
|
|
|
|
void RestoreInterpolations();
|
|
|
|
void SerializeInterpolations(FSerializer& arc);
|
2021-11-22 20:03:10 +00:00
|
|
|
void clearsectinterpolate(sectortype* sectnum);
|
|
|
|
void setsectinterpolate(sectortype* sectnum);
|
2021-11-18 15:56:40 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|