- use the smooth ratio from the game logic in the renderer instead of calling I_GetTimeFrac again.

Unlike the higher level code this does not check for game over conditions.
This commit is contained in:
Christoph Oelckers 2021-04-14 21:17:32 +02:00
parent 2b1072eb91
commit f83e678ea0
6 changed files with 7 additions and 7 deletions

View file

@ -275,7 +275,7 @@ static void CheckTimer(FRenderState &state, uint64_t ShaderStartTime)
void animatecamsprite(double s);
void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang)
void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang, double smoothratio)
{
checkRotatedWalls();
@ -295,7 +295,7 @@ void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sect
// Get this before everything else
FRenderViewpoint r_viewpoint = SetupViewpoint(playersprite, position, sectnum, angle, horizon, rollang);
if (cl_capfps) r_viewpoint.TicFrac = 1.;
else r_viewpoint.TicFrac = I_GetTimeFrac();
else r_viewpoint.TicFrac = smoothratio * (1/65536.);
screen->mLights->Clear();
screen->mViewpoints->Clear();

View file

@ -4,7 +4,7 @@
class FSerializer;
struct IntRect;
void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang);
void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang, double smoothratio);
void render_camtex(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang, FGameTexture* camtex, IntRect& rect, double smoothratio);
struct PortalDesc

View file

@ -772,7 +772,7 @@ void viewDrawScreen(bool sceneonly)
fixedhoriz deliriumPitchI = q16horiz(interpolatedvalue(IntToFixed(deliriumPitchO), IntToFixed(deliriumPitch), gInterpolate));
int bakCstat = gView->pSprite->cstat;
gView->pSprite->cstat |= (gViewPos == 0) ? CSTAT_SPRITE_INVISIBLE : CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANSLUCENT_INVERT;
render_drawrooms(gView->pSprite, { cX, cY, cZ }, nSectnum, cA, cH + deliriumPitchI, rotscrnang);
render_drawrooms(gView->pSprite, { cX, cY, cZ }, nSectnum, cA, cH + deliriumPitchI, rotscrnang, gInterpolate);
gView->pSprite->cstat = bakCstat;
}
else

View file

@ -83,7 +83,7 @@ void renderView(spritetype* playersprite, int sectnum, int x, int y, int z, bina
}
else
{
render_drawrooms(playersprite, { x, y, z }, sectnum, a, h, rotscrnang);
render_drawrooms(playersprite, { x, y, z }, sectnum, a, h, rotscrnang, smoothratio);
}
}

View file

@ -367,7 +367,7 @@ void DrawView(double smoothRatio, bool sceneonly)
}
else
{
render_drawrooms(nullptr, { nCamerax, nCameray, viewz }, nSector, nCameraa, nCamerapan, rotscrnang);
render_drawrooms(nullptr, { nCamerax, nCameray, viewz }, nSector, nCameraa, nCamerapan, rotscrnang, smoothRatio);
}
if (HavePLURemap())

View file

@ -1615,7 +1615,7 @@ drawscreen(PLAYERp pp, double smoothratio)
else
{
UpdateWallPortalState();
render_drawrooms(pp->SpriteP, { tx, ty, tz }, tsectnum, tang, thoriz, trotscrnang);
render_drawrooms(pp->SpriteP, { tx, ty, tz }, tsectnum, tang, thoriz, trotscrnang, smoothratio);
RestorePortalState();
}