From 2d22c2b2652b068925fb438cd7a6178e0e1a4662 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Wed, 27 Aug 2025 21:18:23 +0200 Subject: [PATCH] Rework rendertimefrac and gate it behind a function Fixes intermission background shifting when toggling fullscreen (yup) and fixes audio caption text losing interp when paused --- src/d_main.c | 28 ++++------------------ src/f_finale.c | 12 ++++++---- src/hardware/hw_main.cpp | 40 +++++--------------------------- src/hardware/hw_md2.c | 15 ++++-------- src/hardware/r_opengl/r_opengl.c | 4 +++- src/hu_stuff.c | 2 +- src/k_hud.c | 21 +++++++++-------- src/lua_hudlib_drawlist.c | 2 +- src/m_menu.c | 2 +- src/r_fps.c | 38 ++++++++++++++++++++---------- src/r_fps.h | 12 +++++++++- src/r_main.cpp | 14 +---------- src/r_main.h | 9 ------- src/r_plane.cpp | 2 +- src/r_things.cpp | 19 +++------------ src/st_stuff.c | 2 +- src/v_video.c | 7 +++--- src/y_inter.c | 6 +++-- 18 files changed, 89 insertions(+), 146 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index f191a546c..680e1cd87 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -326,7 +326,7 @@ static void D_Renderview(void) if (automapactive) return; - R_ApplyLevelInterpolators(rendertimefrac); + R_ApplyLevelInterpolators(R_GetTimeFrac(RTF_LEVEL)); if (rendermode == render_soft) { @@ -448,7 +448,7 @@ static boolean D_Display(void) if (rendermode == render_soft && !splitscreen) { - R_InterpolateViewRollAngle(rendertimefrac_unpaused); + R_InterpolateViewRollAngle(R_GetTimeFrac(RTF_LEVEL)); R_CheckViewMorph(); } @@ -808,7 +808,7 @@ void D_SRB2Loop(void) debugload--; #endif - interp = (R_UsingFrameInterpolation() && !dedicated); + interp = !dedicated && R_UsingFrameInterpolation(); doDisplay = false; renderisnewtic = (realtics > 0 || singletics); @@ -871,29 +871,11 @@ void D_SRB2Loop(void) const boolean lagging = ((deltatics >= 1.0) || hu_stopped); - if (!(paused || P_AutoPause()) && !lagging) - { - rendertimefrac = g_time.timefrac; - } - else - { - rendertimefrac = FRACUNIT; - } - - if (!lagging) - { - rendertimefrac_unpaused = g_time.timefrac; - } - else - { - rendertimefrac_unpaused = FRACUNIT; - } + R_SetTimeFrac(lagging ? FRACUNIT : g_time.timefrac); } else { - renderdeltatics = realtics * FRACUNIT; - rendertimefrac = FRACUNIT; - rendertimefrac_unpaused = FRACUNIT; + R_SetTimeFrac(FRACUNIT); } if (interp || doDisplay) diff --git a/src/f_finale.c b/src/f_finale.c index 6d062af11..17b174d02 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -34,6 +34,8 @@ #include "y_inter.h" #include "m_cond.h" +#include "r_fps.h" // R_GetTimeFrac + // Stage of animation: // 0 = text, 1 = art screen static INT32 finalecount; @@ -170,8 +172,8 @@ static void F_SkyScroll(INT32 scrollspeed) w = (vid.width / vid.dupx)<width*16))<width<width*16))<width*16))<width<width*16))<= 20) V_DrawSmallScaledPatch(84, 87, 0, ttkart); else if (finalecount >= 10) - V_DrawSciencePatch((84<mobj)) + if (precip) { - if (precip) - { - R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, rendertimefrac, &interp); - } - else - { - R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp); - } + R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, R_CheckInterpDist(spr->mobj) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); } else { - if (precip) - { - R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, FRACUNIT, &interp); - } - else - { - R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp); - } + R_InterpolateMobjState(spr->mobj, R_CheckInterpDist(spr->mobj) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); } if (!precip && P_MobjFlip(spr->mobj) == -1) // precip doesn't have eflags so they can't flip @@ -4714,14 +4700,7 @@ static void HWR_ProjectSprite(mobj_t *thing) // uncapped/interpolation interpmobjstate_t interp = {}; - if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist(thing)) - { - R_InterpolateMobjState(thing, rendertimefrac, &interp); - } - else - { - R_InterpolateMobjState(thing, FRACUNIT, &interp); - } + R_InterpolateMobjState(thing, R_CheckInterpDist(thing) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); if (interp.spritexscale < 1 || interp.spriteyscale < 1) return; @@ -5069,14 +5048,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) interpmobjstate_t interp = {}; // do interpolation - if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist((mobj_t*)thing)) - { - R_InterpolatePrecipMobjState(thing, rendertimefrac, &interp); - } - else - { - R_InterpolatePrecipMobjState(thing, FRACUNIT, &interp); - } + R_InterpolatePrecipMobjState(thing, R_CheckInterpDist((mobj_t*)thing) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); // Visibility check by the blend mode. if (thing->frame & FF_TRANSMASK) @@ -6071,7 +6043,7 @@ static void HWR_DoPostProcessor(player_t *player) { // 10 by 10 grid. 2 coordinates (xy) float v[SCREENVERTS][SCREENVERTS][2]; - float disStart = (leveltime-1) + FixedToFloat(rendertimefrac); + float disStart = (leveltime-1) + FixedToFloat(R_GetTimeFrac(RTF_LEVEL)); UINT8 x, y; INT32 WAVELENGTH; diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 2f4b341ed..9f0145e84 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1176,6 +1176,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr) // Look at HWR_ProjectSprite for more { + md2_t *md2s; + int skinnum; patch_t *gpatch, *blendgpatch; GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL; INT32 durs = spr->mobj->state->tics; @@ -1188,16 +1190,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr) spriteinfo_t *sprinfo; interpmobjstate_t interp; - if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist(spr->mobj)) - { - R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp); - } - else - { - R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp); - } - md2_t *md2s; - int skinnum; + R_InterpolateMobjState(spr->mobj, R_CheckInterpDist(spr->mobj) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); // Apparently people don't like jump frames like that, so back it goes //if (tics > durs) @@ -1375,7 +1368,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr) #ifdef USE_MODEL_NEXTFRAME // Interpolate the model interpolation. (lol) - tics -= FixedToFloat(rendertimefrac); + tics -= FixedToFloat(R_GetTimeFrac(RTF_LEVEL)); if (cv_glmdls.value == 1 && tics <= durs) { diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 4dcd1253b..c47d4fe23 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -27,6 +27,8 @@ #if defined (HWRENDER) && !defined (NOROPENGL) +#include "../../r_fps.h" // For R_GetTimeFrac, used for the leveltime shader uniform + #include "r_opengl.h" #include "r_vbo.h" @@ -889,7 +891,7 @@ void GL_SetShaderInfo(hwdshaderinfo_t info, INT32 value) switch (info) { case HWD_SHADERINFO_LEVELTIME: - shader_leveltime = (((float)(value-1)) + FIXED_TO_FLOAT(rendertimefrac)) / TICRATE; + shader_leveltime = (((float)(value-1)) + FIXED_TO_FLOAT(R_GetTimeFrac(RTF_LEVEL))) / TICRATE; break; case HWD_SHADERINFO_LIGHT_X: shader_light_x = FixedToFloat(value); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 062abd0d2..47c71d8e8 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2304,7 +2304,7 @@ static void HU_DrawSongCreditsBox(void) INT32 t = cursongcredit.anim; INT32 bgt; - fixed_t interpoffset = FixedMul(BOXCREDITHEIGHT*dup*FRACUNIT/(TICRATE/2), R_GetHudUncap()); + fixed_t interpoffset = FixedMul(BOXCREDITHEIGHT*dup*FRACUNIT/(TICRATE/2), R_GetTimeFrac(RTF_MENU)); if (t > BOXCREDITSLIDEIN) { diff --git a/src/k_hud.c b/src/k_hud.c index 7ed3e81cf..b9c8452e3 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -1073,7 +1073,7 @@ static void K_initKartHUD(void) // K_GetScreenCoords needs the right view* variables R_SetViewContext(stplyrnum); - R_InterpolateView(rendertimefrac_unpaused, !cv_uncappedhud.value); + R_InterpolateView(R_GetTimeFrac(RTF_LEVEL), !cv_uncappedhud.value); } UINT8 K_GetHudColor(void) @@ -1766,7 +1766,7 @@ static void K_drawKartItem(void) if (cv_fancyroulette.value && stplyr->kartstuff[k_itemroulette] && !stplyr->deadtimer) { - fixed_t frac = R_GetHudUncap(); + fixed_t frac = R_GetTimeFrac(RTF_LEVEL); UINT8 fancystep = (offset ? 6 : 10); fixed_t fancyoffset = (stplyr->kartstuff[k_itemroulette] % 3)-1; @@ -2825,7 +2825,7 @@ static void K_drawKartBumpersOrKarma(void) } } -#define lerp(from, to) cv_uncappedhud.value ? from + FixedMul(rendertimefrac, to - from) : to +#define lerp(from, to) cv_uncappedhud.value ? from + FixedMul(R_GetTimeFrac(RTF_LEVEL), to - from) : to // converts mobj coordinates into screen coordinates // NOTE: use with V_NOSCALESTART! @@ -3872,7 +3872,7 @@ static void K_drawKartFinish(void) x = ((vid.width<width<kartstuff[k_cardanimation])< x ? xval : x))/TICRATE; + x = (FixedMul(((TICRATE - stplyr->kartstuff[k_cardanimation])< x ? xval : x))/TICRATE; if (splitscreen && stplyrnum == 1) x = -x; @@ -3891,7 +3891,8 @@ static void K_drawBattleFullscreen(void) // fill in the fractional bits if (cardanim && cardanim != 164*FRACUNIT) { - INT32 frac = R_GetHudUncap() * ((164 - stplyr->kartstuff[k_cardanimation])/8 + 1); + INT32 frac = R_GetTimeFrac(RTF_LEVEL) * ((164 - stplyr->kartstuff[k_cardanimation])/8 + 1); + if (stplyr->exiting) cardanim += frac; else @@ -4188,7 +4189,7 @@ static void K_drawInput(void) if (timeinmap < 113) { INT32 count = ((INT32)(timeinmap) - 105); - INT32 frac = count > 0 && count < 6 ? R_GetHudUncap() << (FRACBITS - count - 11) : 0; + INT32 frac = count > 0 && count < 6 ? R_GetTimeFrac(RTF_LEVEL) << (FRACBITS - count - 11) : 0; offs = 64*FRACUNIT; while (count-- > 0) @@ -4378,8 +4379,8 @@ static void K_drawLapStartAnim(void) UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE); INT32 vflags = V_SNAPTOTOP|V_HUDTRANS; - fixed_t slideout = max(0, 32*(((progress - 76)*FRACUNIT) + R_GetHudUncap())); - fixed_t slidein = max(0, 32*(((stplyr->kartstuff[k_lapanimation] - 76)*FRACUNIT) - R_GetHudUncap())); + fixed_t slideout = max(0, 32*(((progress - 76)*FRACUNIT) + R_GetTimeFrac(RTF_LEVEL))); + fixed_t slidein = max(0, 32*(((stplyr->kartstuff[k_lapanimation] - 76)*FRACUNIT) - R_GetTimeFrac(RTF_LEVEL))); // First, draw the emblem and hand INT32 emblemx = (BASEVIDWIDTH << (FRACBITS - 1)) + slidein; @@ -4390,7 +4391,7 @@ static void K_drawLapStartAnim(void) INT32 hand = stplyr->kartstuff[k_laphand]; if (hand >= 1 && hand <= 3) { - y += 4*FRACUNIT - abs((int)(leveltime % 8)*FRACUNIT + R_GetHudUncap() - 4*FRACUNIT); + y += 4*FRACUNIT - abs((int)(leveltime % 8)*FRACUNIT + R_GetTimeFrac(RTF_LEVEL) - 4*FRACUNIT); V_DrawFixedPatch(emblemx, y, FRACUNIT, vflags, kp_lapanim_hand[hand - 1], NULL); } @@ -4716,7 +4717,7 @@ void K_drawKartHUD(void) if (timeinmap < 113) { INT32 count = ((INT32)(timeinmap) - 104); - INT32 frac = count > 0 ? R_GetHudUncap() << max(0, FRACBITS - count - 9) : 0; + INT32 frac = count > 0 ? R_GetTimeFrac(RTF_LEVEL) << max(0, FRACBITS - count - 9) : 0; offs = 256*FRACUNIT; while (count-- > 0) diff --git a/src/lua_hudlib_drawlist.c b/src/lua_hudlib_drawlist.c index 9a9e472aa..e13e4e099 100644 --- a/src/lua_hudlib_drawlist.c +++ b/src/lua_hudlib_drawlist.c @@ -576,7 +576,7 @@ void LUA_HUD_DrawList(huddrawlist_h list) { size_t i; size_t j = 0; - fixed_t frac = R_UsingFrameInterpolation() ? rendertimefrac : FRACUNIT; + fixed_t frac = R_GetTimeFrac(RTF_INTER); fixed_t lerpx = 0, lerpy = 0; drawitem_t *latchitem = NULL; drawitem_t *oldlatchitem = NULL; diff --git a/src/m_menu.c b/src/m_menu.c index ca9f6e175..6f06adb04 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6732,7 +6732,7 @@ static void M_DrawConnectMenu(void) { const float ease = serverlistslidex / 2.f; const INT32 offx = serverlistslidex > 0 ? BASEVIDWIDTH : -(BASEVIDWIDTH); - const INT32 x = (FLOAT_TO_FIXED(serverlistslidex) + ease * rendertimefrac) / FRACUNIT; + const INT32 x = (FLOAT_TO_FIXED(serverlistslidex) + ease * R_GetTimeFrac(RTF_MENU)) / FRACUNIT; M_DrawServerLines(currentMenu->x + x - offx, oldserverlistpage); M_DrawServerLines(currentMenu->x + x, serverlistpage); diff --git a/src/r_fps.c b/src/r_fps.c index 96a4ab190..40c096e28 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -29,6 +29,9 @@ #include "hardware/hw_main.h" // for cv_grshearing #endif +// The fraction of a tic being drawn (for interpolation between two tics) +static fixed_t rendertimefrac; + static CV_PossibleValue_t fpscap_cons_t[] = { #ifdef DEVELOP // Lower values are actually pretty useful for debugging interp problems! @@ -106,6 +109,27 @@ boolean R_UsingFrameInterpolation(void) return (R_GetFramerateCap() != TICRATE || cv_timescale.value < FRACUNIT); } +// this wacky function exists now because rendertimefrac is stopped outside levels +// just for the sake of the intermission background... +fixed_t R_GetTimeFrac(timefrac_e level) +{ + // level interp. pauses if level isn't ticking + if (level <= RTF_LEVEL && gamestate != GS_LEVEL) // !G_GamestateUsesLevel() + return FRACUNIT; + + // intermission interp. keeps interp even if level isn't ticking, but pauses if game is paused + if (level <= RTF_INTER && (paused || P_AutoPause())) + return FRACUNIT; + + // menu interp. interpolates no matter what + return rendertimefrac; +} + +void R_SetTimeFrac(fixed_t frac) +{ + rendertimefrac = frac; +} + static viewvars_t pview_old[MAXSPLITSCREENPLAYERS]; static viewvars_t pview_new[MAXSPLITSCREENPLAYERS]; static viewvars_t skyview_old[MAXSPLITSCREENPLAYERS]; @@ -301,22 +325,12 @@ void R_SetViewContext(enum viewcontext_e _viewcontext) /*fixed_t R_InterpolateFixed(fixed_t from, fixed_t to) { - if (!R_UsingFrameInterpolation()) - { - return to; - } - - return (R_LerpFixed(from, to, rendertimefrac)); + return R_LerpFixed(from, to, R_GetTimeFrac(RTF_LEVEL)); }*/ angle_t R_InterpolateAngle(angle_t from, angle_t to) { - if (!R_UsingFrameInterpolation()) - { - return to; - } - - return (R_LerpAngle(from, to, rendertimefrac)); + return R_LerpAngle(from, to, R_GetTimeFrac(RTF_LEVEL)); } void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out) diff --git a/src/r_fps.h b/src/r_fps.h index cbcde0db8..5302da6d1 100644 --- a/src/r_fps.h +++ b/src/r_fps.h @@ -30,9 +30,19 @@ extern consvar_t cv_precipinterp; extern ps_metric_t ps_interp_frac; extern ps_metric_t ps_interp_lag; -UINT32 R_GetFramerateCap(void); +typedef enum +{ + RTF_LEVEL, + RTF_INTER, + RTF_MENU, +} timefrac_e; + boolean R_UsingFrameInterpolation(void); +UINT32 R_GetFramerateCap(void); +fixed_t R_GetTimeFrac(timefrac_e level); +void R_SetTimeFrac(fixed_t frac); + enum viewcontext_e { VIEWCONTEXT_PLAYER1 = 0, diff --git a/src/r_main.cpp b/src/r_main.cpp index 1bc38548c..0a7596fa3 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -70,8 +70,6 @@ boolean skyVisiblePerPlayer[MAXSPLITSCREENPLAYERS]; // saved values of skyVisibl sector_t *viewsector; player_t *viewplayer; -fixed_t rendertimefrac; -fixed_t rendertimefrac_unpaused; fixed_t renderdeltatics; boolean renderisnewtic; @@ -414,16 +412,6 @@ angle_t R_PlayerSliptideAngle(player_t *player) return FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), mo->player->sliproll * mo->player->kartstuff[k_aizdriftstrat]); } -INT32 R_GetHudUncap(void) -{ - return cv_uncappedhud.value ? rendertimefrac & FRACMASK : 0; -} - -INT32 R_GetMenuUncap(void) -{ - return cv_uncappedhud.value ? rendertimefrac_unpaused & FRACMASK : 0; -} - // // R_ScaleFromGlobalAngle // Returns the texture mapping scale for the current line (horizontal span) @@ -1100,7 +1088,7 @@ static void R_SetupCommonFrame(player_t * player, sector_t * sector) else newview->sector = R_PointInSubsectorFast(newview->x, newview->y)->sector; - R_InterpolateView(rendertimefrac_unpaused, false); + R_InterpolateView(R_GetTimeFrac(RTF_LEVEL), false); } static void R_SetupAimingFrame(player_t *player, camera_t *thiscam) diff --git a/src/r_main.h b/src/r_main.h index 3f815d083..af77a4ecd 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -38,10 +38,6 @@ extern fixed_t fovtan; // field of view extern size_t validcount, linecount, loopcount, framecount; -// The fraction of a tic being drawn (for interpolation between two tics) -extern fixed_t rendertimefrac; -// Same as rendertimefrac but not suspended when the game is paused -extern fixed_t rendertimefrac_unpaused; // Evaluated delta tics for this frame (how many tics since the last frame) extern fixed_t renderdeltatics; // The current render is a new logical tic @@ -230,11 +226,6 @@ void R_RenderPlayerView(player_t *player); // add commands related to engine, at game startup void R_RegisterEngineStuff(void); -// return multiplier for HUD uncap -INT32 R_GetHudUncap(void); -// same as above but keeps interpolation during pause -INT32 R_GetMenuUncap(void); - #ifdef __cplusplus } // extern "C" #endif diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 94fbcae4b..0ccf1cc48 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -165,7 +165,7 @@ static void R_CalculatePlaneRipple(drawspandata_t* ds, angle_t angle) static void R_UpdatePlaneRipple(drawspandata_t* ds) { ds->waterofs = (leveltime & 1)*16384; - ds->planeripple.offset = ((leveltime-1)*140) + ((rendertimefrac*140) / FRACUNIT); + ds->planeripple.offset = ((leveltime-1)*140) + ((R_GetTimeFrac(RTF_LEVEL)*140) / FRACUNIT); } static bool R_CheckMapPlane(const char* funcname, INT32 y, INT32 x1, INT32 x2) diff --git a/src/r_things.cpp b/src/r_things.cpp index 9ece0d515..3fdc74f4f 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1148,6 +1148,7 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope) *shadowslope = groundslope; return groundz; + #undef CHECKZ } @@ -1241,14 +1242,7 @@ static void R_ProjectSprite(mobj_t *thing) interpmobjstate_t interp = {}; // do interpolation - if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist(oldthing)) - { - R_InterpolateMobjState(oldthing, rendertimefrac, &interp); - } - else - { - R_InterpolateMobjState(oldthing, FRACUNIT, &interp); - } + R_InterpolateMobjState(oldthing, R_CheckInterpDist(oldthing) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); this_scale = interp.scale; @@ -1879,14 +1873,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing) interpmobjstate_t interp = {}; // do interpolation - if (R_UsingFrameInterpolation() && !paused && R_CheckInterpDist((mobj_t*)thing)) - { - R_InterpolatePrecipMobjState(thing, rendertimefrac, &interp); - } - else - { - R_InterpolatePrecipMobjState(thing, FRACUNIT, &interp); - } + R_InterpolatePrecipMobjState(thing, R_CheckInterpDist((mobj_t*)thing) ? R_GetTimeFrac(RTF_LEVEL) : FRACUNIT, &interp); this_scale = interp.scale; diff --git a/src/st_stuff.c b/src/st_stuff.c index aa1d6a81e..976de5686 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -478,7 +478,7 @@ static void ST_drawLevelTitle(void) // uh... "fill in the bits" of sub, or something... no idea what I came up with // VERY janky, but doesn't require m_easing - INT32 frac = (FixedMul(R_GetHudUncap(), FixedDiv(dupcalc, BASEVIDWIDTH)) >> (count + 4))/13; // these two magic numbers seem to do the trick + INT32 frac = (FixedMul(R_GetTimeFrac(RTF_LEVEL), FixedDiv(dupcalc, BASEVIDWIDTH)) >> (count + 4))/13; // these two magic numbers seem to do the trick sub = dupcalc; while (count-- > 0) diff --git a/src/v_video.c b/src/v_video.c index e9404d391..bc626c16f 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1764,9 +1764,8 @@ void V_DrawVhsEffect(boolean rewind) if (rewind) V_DrawVhsEffect(false); // experimentation - fixed_t frac = R_UsingFrameInterpolation() ? renderdeltatics : FRACUNIT; - upbary -= frac * (vid.dupy * (rewind ? 3 : 1.8f)); - downbary += frac * (vid.dupy * (rewind ? 2 : 1)); + upbary -= renderdeltatics * (vid.dupy * (rewind ? 3 : 1.8f)); + downbary += renderdeltatics * (vid.dupy * (rewind ? 2 : 1)); if (upbary < -barsize*FRACUNIT) upbary = vid.height< vid.height<>FRACBITS) / (8 * vid.dupx); + x -= ((((count<>FRACBITS) / (8 * vid.dupx); else if (count < 16) - x += (((((16 - count)<>FRACBITS) / (8 * vid.dupx); + x += (((((16 - count)<>FRACBITS) / (8 * vid.dupx); } if (intertype == int_race || intertype == int_match)