mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
ACS: interpolate changes to sidedef offsets
This commit is contained in:
parent
de651b6d6c
commit
c9b57548e9
2 changed files with 24 additions and 2 deletions
|
|
@ -49,6 +49,7 @@
|
||||||
#include "../r_draw.h"
|
#include "../r_draw.h"
|
||||||
#include "../k_dialogue.hpp"
|
#include "../k_dialogue.hpp"
|
||||||
#include "../k_hud.h"
|
#include "../k_hud.h"
|
||||||
|
#include "../r_fps.h"
|
||||||
|
|
||||||
#include "call-funcs.hpp"
|
#include "call-funcs.hpp"
|
||||||
|
|
||||||
|
|
@ -2883,10 +2884,28 @@ bool CallFunc_SetSideProperty(ACSVM::Thread *thread, const ACSVM::Word *argV, AC
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto install_interpolator = [side]
|
||||||
|
{
|
||||||
|
if (side->acs_interpolated)
|
||||||
|
return;
|
||||||
|
side->acs_interpolated = true;
|
||||||
|
R_CreateInterpolator_SideScroll(nullptr, side);
|
||||||
|
};
|
||||||
|
|
||||||
switch (property)
|
switch (property)
|
||||||
{
|
{
|
||||||
PROP_INT(SIDE_PROP_XOFFSET, textureoffset)
|
case SIDE_PROP_XOFFSET:
|
||||||
PROP_INT(SIDE_PROP_YOFFSET, rowoffset)
|
{
|
||||||
|
side->textureoffset = static_cast< decltype(side->textureoffset) >(value);
|
||||||
|
install_interpolator();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SIDE_PROP_YOFFSET:
|
||||||
|
{
|
||||||
|
side->rowoffset = static_cast< decltype(side->rowoffset) >(value);
|
||||||
|
install_interpolator();
|
||||||
|
break;
|
||||||
|
}
|
||||||
PROP_TEXTURE(SIDE_PROP_TOPTEXTURE, toptexture)
|
PROP_TEXTURE(SIDE_PROP_TOPTEXTURE, toptexture)
|
||||||
PROP_TEXTURE(SIDE_PROP_BOTTOMTEXTURE, bottomtexture)
|
PROP_TEXTURE(SIDE_PROP_BOTTOMTEXTURE, bottomtexture)
|
||||||
PROP_TEXTURE(SIDE_PROP_MIDTEXTURE, midtexture)
|
PROP_TEXTURE(SIDE_PROP_MIDTEXTURE, midtexture)
|
||||||
|
|
|
||||||
|
|
@ -644,6 +644,9 @@ struct side_t
|
||||||
// We do not maintain names here.
|
// We do not maintain names here.
|
||||||
INT32 toptexture, bottomtexture, midtexture;
|
INT32 toptexture, bottomtexture, midtexture;
|
||||||
|
|
||||||
|
// Interpolator installed? (R_CreateInterpolator_SideScroll)
|
||||||
|
boolean acs_interpolated;
|
||||||
|
|
||||||
// Linedef the sidedef belongs to
|
// Linedef the sidedef belongs to
|
||||||
line_t *line;
|
line_t *line;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue