mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 05:48:03 -04:00
fix interpolation of floor/ceil scrollers (#1793)
This commit is contained in:
parent
7ce3a50625
commit
395feb24dd
@ -357,7 +357,8 @@ void P_LoadSectors (int lump)
|
||||
// [FG] inhibit sector interpolation during the 0th gametic
|
||||
ss->oldceilgametic = -1;
|
||||
ss->oldfloorgametic = -1;
|
||||
ss->oldscrollgametic = -1;
|
||||
ss->old_ceil_offs_gametic = -1;
|
||||
ss->old_floor_offs_gametic = -1;
|
||||
}
|
||||
|
||||
Z_Free (data);
|
||||
|
@ -2676,11 +2676,11 @@ void T_Scroll(scroll_t *s)
|
||||
|
||||
case sc_floor: // killough 3/7/98: Scroll floor texture
|
||||
sec = sectors + s->affectee;
|
||||
if (sec->oldscrollgametic != gametic)
|
||||
if (sec->old_floor_offs_gametic != gametic)
|
||||
{
|
||||
sec->old_floor_xoffs = sec->base_floor_xoffs;
|
||||
sec->old_floor_yoffs = sec->base_floor_yoffs;
|
||||
sec->oldscrollgametic = gametic;
|
||||
sec->old_floor_offs_gametic = gametic;
|
||||
}
|
||||
sec->base_floor_xoffs += dx;
|
||||
sec->base_floor_yoffs += dy;
|
||||
@ -2690,11 +2690,11 @@ void T_Scroll(scroll_t *s)
|
||||
|
||||
case sc_ceiling: // killough 3/7/98: Scroll ceiling texture
|
||||
sec = sectors + s->affectee;
|
||||
if (sec->oldscrollgametic != gametic)
|
||||
if (sec->old_ceil_offs_gametic != gametic)
|
||||
{
|
||||
sec->old_ceiling_xoffs = sec->base_ceiling_xoffs;
|
||||
sec->old_ceiling_yoffs = sec->base_ceiling_yoffs;
|
||||
sec->oldscrollgametic = gametic;
|
||||
sec->old_ceil_offs_gametic = gametic;
|
||||
}
|
||||
sec->base_ceiling_xoffs += dx;
|
||||
sec->base_ceiling_yoffs += dy;
|
||||
|
@ -306,10 +306,13 @@ static void R_MaybeInterpolateSector(sector_t* sector)
|
||||
sector->interpceilingheight = sector->ceilingheight;
|
||||
}
|
||||
|
||||
if (sector->oldscrollgametic == gametic - 1)
|
||||
if (sector->old_floor_offs_gametic == gametic - 1)
|
||||
{
|
||||
sector->floor_xoffs = LerpFixed(sector->old_floor_xoffs, sector->base_floor_xoffs);
|
||||
sector->floor_yoffs = LerpFixed(sector->old_floor_yoffs, sector->base_floor_yoffs);
|
||||
}
|
||||
if (sector->old_ceil_offs_gametic == gametic - 1)
|
||||
{
|
||||
sector->ceiling_xoffs = LerpFixed(sector->old_ceiling_xoffs, sector->base_ceiling_xoffs);
|
||||
sector->ceiling_yoffs = LerpFixed(sector->old_ceiling_yoffs, sector->base_ceiling_yoffs);
|
||||
}
|
||||
|
@ -150,7 +150,8 @@ typedef struct sector_s
|
||||
// if old values were not updated recently.
|
||||
int oldceilgametic;
|
||||
int oldfloorgametic;
|
||||
int oldscrollgametic;
|
||||
int old_ceil_offs_gametic;
|
||||
int old_floor_offs_gametic;
|
||||
|
||||
// [AM] Interpolated floor and ceiling height.
|
||||
// Calculated once per tic and used inside
|
||||
|
Loading…
x
Reference in New Issue
Block a user