- Eliminate __interpvalue() and clean up Q16.16 smoothratio values where it made sense to do so.

* Also eliminates a now empty header.
This commit is contained in:
Mitchell Richters 2022-09-07 15:49:17 +10:00 committed by Christoph Oelckers
parent f02035b15a
commit 45d4d3e41a
16 changed files with 50 additions and 99 deletions

View file

@ -4,7 +4,6 @@
#include "maptypes.h" #include "maptypes.h"
#include "build.h" #include "build.h"
#include "actorinfo.h" #include "actorinfo.h"
#include "interphelpers.h"
enum enum
{ {

View file

@ -3,6 +3,7 @@
#include "gamecontrol.h" #include "gamecontrol.h"
#include "build.h" #include "build.h"
#include "coreactor.h" #include "coreactor.h"
#include "fixedhorizon.h"
#include "intrect.h" #include "intrect.h"
extern IntRect viewport3d; extern IntRect viewport3d;

View file

@ -2,7 +2,6 @@
#include "m_fixed.h" #include "m_fixed.h"
#include "fixedhorizon.h" #include "fixedhorizon.h"
#include "interphelpers.h"
#include "gamecvars.h" #include "gamecvars.h"
#include "gamestruct.h" #include "gamestruct.h"
#include "gamefuncs.h" #include "gamefuncs.h"

View file

@ -1,48 +0,0 @@
/*
** interphelpers.h
**
** Interpolation helpers for use throughout Build games.
**
**---------------------------------------------------------------------------
** Copyright 2022 Christoph Oelckers, Mitchell Richters
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#pragma once
#include "fixedhorizon.h"
inline constexpr int32_t __interpvalue(int32_t oval, int32_t val, double const smoothratio, int const scale = 16)
{
return oval + MulScale(val - oval, int(smoothratio), scale);
}
inline constexpr int32_t __interpvalue(int32_t oval, int32_t val, int const smoothratio, int const scale = 16)
{
return oval + MulScale(val - oval, smoothratio, scale);
}

View file

@ -1863,14 +1863,14 @@ void playerProcess(PLAYER* pPlayer)
} }
ProcessInput(pPlayer); ProcessInput(pPlayer);
int nSpeed = approxDist(actor->int_vel().X, actor->int_vel().Y); int nSpeed = approxDist(actor->int_vel().X, actor->int_vel().Y);
pPlayer->zViewVel = __interpvalue(pPlayer->zViewVel, actor->int_vel().Z, 0x7000); pPlayer->zViewVel = interpolatedvalue(pPlayer->zViewVel, actor->int_vel().Z, 0x7000 * (1. / MaxSmoothRatio));
int dz = pPlayer->actor->int_pos().Z - pPosture->eyeAboveZ - pPlayer->zView; int dz = pPlayer->actor->int_pos().Z - pPosture->eyeAboveZ - pPlayer->zView;
if (dz > 0) if (dz > 0)
pPlayer->zViewVel += MulScale(dz << 8, 0xa000, 16); pPlayer->zViewVel += MulScale(dz << 8, 0xa000, 16);
else else
pPlayer->zViewVel += MulScale(dz << 8, 0x1800, 16); pPlayer->zViewVel += MulScale(dz << 8, 0x1800, 16);
pPlayer->zView += pPlayer->zViewVel >> 8; pPlayer->zView += pPlayer->zViewVel >> 8;
pPlayer->zWeaponVel = __interpvalue(pPlayer->zWeaponVel, actor->int_vel().Z, 0x5000); pPlayer->zWeaponVel = interpolatedvalue(pPlayer->zWeaponVel, actor->int_vel().Z, 0x5000 * (1. / MaxSmoothRatio));
dz = pPlayer->actor->int_pos().Z - pPosture->weaponAboveZ - pPlayer->zWeapon; dz = pPlayer->actor->int_pos().Z - pPosture->weaponAboveZ - pPlayer->zWeapon;
if (dz > 0) if (dz > 0)
pPlayer->zWeaponVel += MulScale(dz << 8, 0x8000, 16); pPlayer->zWeaponVel += MulScale(dz << 8, 0x8000, 16);

View file

@ -287,7 +287,7 @@ void fakePlayerProcess(PLAYER* pPlayer, InputPacket* pInput)
int nSpeed = approxDist(predict.xvel, predict.yvel); int nSpeed = approxDist(predict.xvel, predict.yvel);
predict.at3c = __interpvalue(predict.at3c, predict.zvel, 0x7000); predict.at3c = interpolatedvalue(predict.at3c, predict.zvel, 0x7000 * (1. / MaxSmoothRatio));
int dz = predict.z - pPosture->eyeAboveZ - predict.viewz; int dz = predict.z - pPosture->eyeAboveZ - predict.viewz;
if (dz > 0) if (dz > 0)
predict.at3c += MulScale(dz << 8, 0xa000, 16); predict.at3c += MulScale(dz << 8, 0xa000, 16);
@ -295,7 +295,7 @@ void fakePlayerProcess(PLAYER* pPlayer, InputPacket* pInput)
predict.at3c += MulScale(dz << 8, 0x1800, 16); predict.at3c += MulScale(dz << 8, 0x1800, 16);
predict.viewz += predict.at3c >> 8; predict.viewz += predict.at3c >> 8;
predict.at44 = __interpvalue(predict.at44, predict.zvel, 0x5000); predict.at44 = interpolatedvalue(predict.at44, predict.zvel, 0x5000 * (1. / MaxSmoothRatio));
dz = predict.z - pPosture->weaponAboveZ - predict.at40; dz = predict.z - pPosture->weaponAboveZ - predict.at40;
if (dz > 0) if (dz > 0)
predict.at44 += MulScale(dz << 8, 0x8000, 16); predict.at44 += MulScale(dz << 8, 0x8000, 16);

View file

@ -842,14 +842,14 @@ void PathSound(sectortype* pSector, int nSound)
void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, bool bAllWalls) void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, bool bAllWalls)
{ {
XSECTOR* pXSector = &pSector->xs(); XSECTOR* pXSector = &pSector->xs();
int v20 = __interpvalue(a6, a9, a2); int v20 = interpolatedvalue(a6, a9, a2 * (1. / MaxSmoothRatio));
int vc = __interpvalue(a6, a9, a3); int vc = interpolatedvalue(a6, a9, a3 * (1. / MaxSmoothRatio));
int v28 = vc - v20; int v28 = vc - v20;
int v24 = __interpvalue(a7, a10, a2); int v24 = interpolatedvalue(a7, a10, a2 * (1. / MaxSmoothRatio));
int v8 = __interpvalue(a7, a10, a3); int v8 = interpolatedvalue(a7, a10, a3 * (1. / MaxSmoothRatio));
int v2c = v8 - v24; int v2c = v8 - v24;
int v44 = __interpvalue(a8, a11, a2); int v44 = interpolatedvalue(a8, a11, a2 * (1. / MaxSmoothRatio));
int ang = __interpvalue(a8, a11, a3); int ang = interpolatedvalue(a8, a11, a3 * (1. / MaxSmoothRatio));
int v14 = ang - v44; int v14 = ang - v44;
DVector2 pivot = { a4 * inttoworld, a5 * inttoworld }; DVector2 pivot = { a4 * inttoworld, a5 * inttoworld };

View file

@ -472,7 +472,7 @@ static void DrawMap(DBloodActor* view)
tm = 1; tm = 1;
} }
VIEW* pView = &gPrevView[gViewIndex]; VIEW* pView = &gPrevView[gViewIndex];
auto xy = DVector2(__interpvalue(pView->x, view->int_pos().X, gInterpolate), __interpvalue(pView->y, view->int_pos().Y, gInterpolate))* inttoworld; auto xy = DVector2(interpolatedvalue(pView->x, view->int_pos().X, gInterpolate * (1. / MaxSmoothRatio)), interpolatedvalue(pView->y, view->int_pos().Y, gInterpolate * (1. / MaxSmoothRatio)))* inttoworld;
auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate * (1. / MaxSmoothRatio)); auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate * (1. / MaxSmoothRatio));
DrawOverheadMap(xy, ang, gInterpolate); DrawOverheadMap(xy, ang, gInterpolate);
if (tm) if (tm)
@ -494,12 +494,12 @@ void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sectortype
if (numplayers > 1 && gView == gMe && gPrediction && gMe->actor->xspr.health > 0) if (numplayers > 1 && gView == gMe && gPrediction && gMe->actor->xspr.health > 0)
{ {
nSectnum = predict.sectnum; nSectnum = predict.sectnum;
cX = __interpvalue(predictOld.x, predict.x, gInterpolate); cX = interpolatedvalue(predictOld.x, predict.x, gInterpolate * (1. / MaxSmoothRatio));
cY = __interpvalue(predictOld.y, predict.y, gInterpolate); cY = interpolatedvalue(predictOld.y, predict.y, gInterpolate * (1. / MaxSmoothRatio));
cZ = __interpvalue(predictOld.viewz, predict.viewz, gInterpolate); cZ = interpolatedvalue(predictOld.viewz, predict.viewz, gInterpolate * (1. / MaxSmoothRatio));
zDelta = interpolatedvalue(predictOld.weaponZ, predict.weaponZ, gInterpolate * (1. / MaxSmoothRatio)); zDelta = interpolatedvalue(predictOld.weaponZ, predict.weaponZ, gInterpolate * (1. / MaxSmoothRatio));
bobWidth = __interpvalue(predictOld.bobWidth, predict.bobWidth, gInterpolate); bobWidth = interpolatedvalue(predictOld.bobWidth, predict.bobWidth, gInterpolate * (1. / MaxSmoothRatio));
bobHeight = __interpvalue(predictOld.bobHeight, predict.bobHeight, gInterpolate); bobHeight = interpolatedvalue(predictOld.bobHeight, predict.bobHeight, gInterpolate * (1. / MaxSmoothRatio));
shakeX = interpolatedvalue(predictOld.shakeBobX, predict.shakeBobX, gInterpolate * (1. / MaxSmoothRatio)); shakeX = interpolatedvalue(predictOld.shakeBobX, predict.shakeBobX, gInterpolate * (1. / MaxSmoothRatio));
shakeY = interpolatedvalue(predictOld.shakeBobY, predict.shakeBobY, gInterpolate * (1. / MaxSmoothRatio)); shakeY = interpolatedvalue(predictOld.shakeBobY, predict.shakeBobY, gInterpolate * (1. / MaxSmoothRatio));
@ -520,12 +520,12 @@ void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sectortype
#endif #endif
{ {
VIEW* pView = &gPrevView[gViewIndex]; VIEW* pView = &gPrevView[gViewIndex];
cX = __interpvalue(pView->x, gView->actor->int_pos().X, gInterpolate); cX = interpolatedvalue(pView->x, gView->actor->int_pos().X, gInterpolate * (1. / MaxSmoothRatio));
cY = __interpvalue(pView->y, gView->actor->int_pos().Y, gInterpolate); cY = interpolatedvalue(pView->y, gView->actor->int_pos().Y, gInterpolate * (1. / MaxSmoothRatio));
cZ = __interpvalue(pView->viewz, gView->zView, gInterpolate); cZ = interpolatedvalue(pView->viewz, gView->zView, gInterpolate * (1. / MaxSmoothRatio));
zDelta = interpolatedvalue<double>(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), gInterpolate * (1. / MaxSmoothRatio)); zDelta = interpolatedvalue<double>(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), gInterpolate * (1. / MaxSmoothRatio));
bobWidth = __interpvalue(pView->bobWidth, gView->bobWidth, gInterpolate); bobWidth = interpolatedvalue(pView->bobWidth, gView->bobWidth, gInterpolate * (1. / MaxSmoothRatio));
bobHeight = __interpvalue(pView->bobHeight, gView->bobHeight, gInterpolate); bobHeight = interpolatedvalue(pView->bobHeight, gView->bobHeight, gInterpolate * (1. / MaxSmoothRatio));
shakeX = interpolatedvalue<double>(pView->shakeBobX, gView->swayWidth, gInterpolate * (1. / MaxSmoothRatio)); shakeX = interpolatedvalue<double>(pView->shakeBobX, gView->swayWidth, gInterpolate * (1. / MaxSmoothRatio));
shakeY = interpolatedvalue<double>(pView->shakeBobY, gView->swayHeight, gInterpolate * (1. / MaxSmoothRatio)); shakeY = interpolatedvalue<double>(pView->shakeBobY, gView->swayHeight, gInterpolate * (1. / MaxSmoothRatio));
@ -655,7 +655,7 @@ void viewDrawScreen(bool sceneonly)
if (cl_interpolate) if (cl_interpolate)
{ {
DoInterpolations(gInterpolate / MaxSmoothRatio); DoInterpolations(gInterpolate * (1. / MaxSmoothRatio));
} }
if (automapMode != am_full) if (automapMode != am_full)

View file

@ -546,9 +546,9 @@ void UpdateAimVector(PLAYER* pPlayer)
aim2 = aim; aim2 = aim;
RotateVector((int*)&aim2.dx, (int*)&aim2.dy, -plActor->int_ang()); RotateVector((int*)&aim2.dx, (int*)&aim2.dy, -plActor->int_ang());
aim2.dz -= pPlayer->slope; aim2.dz -= pPlayer->slope;
pPlayer->relAim.dx = __interpvalue(pPlayer->relAim.dx, aim2.dx, pWeaponTrack->aimSpeedHorz); pPlayer->relAim.dx = interpolatedvalue(pPlayer->relAim.dx, aim2.dx, pWeaponTrack->aimSpeedHorz * (1. / MaxSmoothRatio));
pPlayer->relAim.dy = __interpvalue(pPlayer->relAim.dy, aim2.dy, pWeaponTrack->aimSpeedHorz); pPlayer->relAim.dy = interpolatedvalue(pPlayer->relAim.dy, aim2.dy, pWeaponTrack->aimSpeedHorz * (1. / MaxSmoothRatio));
pPlayer->relAim.dz = __interpvalue(pPlayer->relAim.dz, aim2.dz, pWeaponTrack->aimSpeedVert); pPlayer->relAim.dz = interpolatedvalue(pPlayer->relAim.dz, aim2.dz, pWeaponTrack->aimSpeedVert * (1. / MaxSmoothRatio));
pPlayer->aim = pPlayer->relAim; pPlayer->aim = pPlayer->relAim;
RotateVector((int*)&pPlayer->aim.dx, (int*)&pPlayer->aim.dy, plActor->int_ang()); RotateVector((int*)&pPlayer->aim.dx, (int*)&pPlayer->aim.dy, plActor->int_ang());
pPlayer->aim.dz += pPlayer->slope; pPlayer->aim.dz += pPlayer->slope;

View file

@ -305,9 +305,9 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, double interp
#if 0 // multiplayer only #if 0 // multiplayer only
if (screenpeek == myconnectindex && numplayers >= 2) if (screenpeek == myconnectindex && numplayers >= 2)
{ {
t->x = __interpvalue(omyx, myx, interpfrac * MaxSmoothRatio); t->x = interpolatedvalue(omyx, myx, interpfrac);
t->y = __interpvalue(omyy, myy, interpfrac * MaxSmoothRatio); t->y = interpolatedvalue(omyy, myy, interpfrac);
t->z = __interpvalue(omyz, myz, interpfrac * MaxSmoothRatio) + gs_playerheight; t->z = interpolatedvalue(omyz, myz, interpfrac) + gs_playerheight;
t->ang = interpolatedvalue(omyang, myang, interpfrac).asbuild(); t->ang = interpolatedvalue(omyang, myang, interpfrac).asbuild();
t->sector = mycursectnum; t->sector = mycursectnum;
} }

View file

@ -347,9 +347,9 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, double interp
#if 0 // multiplayer only #if 0 // multiplayer only
if (screenpeek == myconnectindex && numplayers >= 2) if (screenpeek == myconnectindex && numplayers >= 2)
{ {
t->x = __interpvalue(omyx, myx, interpfrac * MaxSmoothRatio); t->x = interpolatedvalue(omyx, myx, interpfrac);
t->y = __interpvalue(omyy, myy, interpfrac * MaxSmoothRatio); t->y = interpolatedvalue(omyy, myy, interpfrac);
t->z = __interpvalue(omyz, myz, interpfrac * MaxSmoothRatio) + gs.playerheight; t->z = interpolatedvalue(omyz, myz, interpfrac) + gs.playerheight;
t->ang = interpolatedvalue(omyang, myang, interpfrac).asbuild(); t->ang = interpolatedvalue(omyang, myang, interpfrac).asbuild();
t->sector = mycursectnum; t->sector = mycursectnum;
} }

View file

@ -225,7 +225,7 @@ void cameratext(DDukeActor* i);
void dobonus(int bonusonly, const CompletionFunc& completion); void dobonus(int bonusonly, const CompletionFunc& completion);
void drawweapon(double interpfrac); void drawweapon(double interpfrac);
void drawoverlays(double smoothratio); void drawoverlays(double interpfrac);
void drawbackground(void); void drawbackground(void);
void displayrooms(int32_t playerNum, double smoothratio, bool sceneonly); void displayrooms(int32_t playerNum, double smoothratio, bool sceneonly);
void setgamepalette(int palid); void setgamepalette(int palid);

View file

@ -226,7 +226,7 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4])
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void drawoverlays(double smoothratio) void drawoverlays(double interpfrac)
{ {
player_struct* pp; player_struct* pp;
DVector2 cposxy; DVector2 cposxy;
@ -260,19 +260,19 @@ void drawoverlays(double smoothratio)
{ {
if (automapMode != am_off) if (automapMode != am_off)
{ {
DoInterpolations(smoothratio * (1. / MaxSmoothRatio)); DoInterpolations(interpfrac);
if (pp->newOwner == nullptr && playrunning()) if (pp->newOwner == nullptr && playrunning())
{ {
if (screenpeek == myconnectindex && numplayers > 1) if (screenpeek == myconnectindex && numplayers > 1)
{ {
cposxy = DVector2(__interpvalue(omyx, myx, smoothratio), __interpvalue(omyy, myy, smoothratio)) * inttoworld; cposxy = DVector2(interpolatedvalue(omyx, myx, interpfrac), interpolatedvalue(omyy, myy, interpfrac)) * inttoworld;
cang = !SyncInput() ? myang : interpolatedvalue(omyang, myang, smoothratio * (1. / MaxSmoothRatio)); cang = !SyncInput() ? myang : interpolatedvalue(omyang, myang, interpfrac);
} }
else else
{ {
cposxy = interpolatedvalue(pp->opos, pp->pos, smoothratio * (1. / MaxSmoothRatio)).XY(); cposxy = interpolatedvalue(pp->opos, pp->pos, interpfrac).XY();
cang = !SyncInput() ? pp->angle.ang : interpolatedvalue(pp->angle.oang, pp->angle.ang, smoothratio * (1. / MaxSmoothRatio)); cang = !SyncInput() ? pp->angle.ang : interpolatedvalue(pp->angle.oang, pp->angle.ang, interpfrac);
} }
} }
else else
@ -280,7 +280,7 @@ void drawoverlays(double smoothratio)
cposxy = pp->opos.XY(); cposxy = pp->opos.XY();
cang = pp->angle.oang; cang = pp->angle.oang;
} }
DrawOverheadMap(cposxy, cang, smoothratio); DrawOverheadMap(cposxy, cang, interpfrac * MaxSmoothRatio);
RestoreInterpolations(); RestoreInterpolations();
} }
} }
@ -289,7 +289,7 @@ void drawoverlays(double smoothratio)
if (ps[myconnectindex].newOwner == nullptr && ud.cameraactor == nullptr) if (ps[myconnectindex].newOwner == nullptr && ud.cameraactor == nullptr)
{ {
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -pp->angle.look_anghalf(smoothratio * (1. / MaxSmoothRatio)), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1); DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -pp->angle.look_anghalf(interpfrac), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1);
} }
if (paused == 2) if (paused == 2)

View file

@ -134,7 +134,7 @@ void GameInterface::Render()
moveclouds(smoothRatio); moveclouds(smoothRatio);
displayrooms(screenpeek, smoothRatio, false); displayrooms(screenpeek, smoothRatio, false);
drawoverlays(smoothRatio); drawoverlays(smoothRatio * (1. / MaxSmoothRatio));
drawtime.Unclock(); drawtime.Unclock();
} }

View file

@ -286,9 +286,9 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
#if 0 #if 0
if ((snum == myconnectindex) && (numplayers > 1)) if ((snum == myconnectindex) && (numplayers > 1))
{ {
cposx = __interpvalue(omyx, myx, smoothratio); cposx = interpolatedvalue(omyx, myx, smoothratio * (1. / MaxSmoothRatio));
cposy = __interpvalue(omyy, myy, smoothratio); cposy = interpolatedvalue(omyy, myy, smoothratio * (1. / MaxSmoothRatio));
cposz = __interpvalue(omyz, myz, smoothratio); cposz = interpolatedvalue(omyz, myz, smoothratio * (1. / MaxSmoothRatio));
if (SyncInput()) if (SyncInput())
{ {
choriz = interpolatedvalue(omyhoriz + omyhorizoff, myhoriz + myhorizoff, smoothratio * (1. / MaxSmoothRatio)); choriz = interpolatedvalue(omyhoriz + omyhorizoff, myhoriz + myhorizoff, smoothratio * (1. / MaxSmoothRatio));
@ -304,9 +304,9 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
else else
#endif #endif
{ {
cposx = __interpvalue(p->player_int_opos().X, p->player_int_pos().X, smoothratio); cposx = interpolatedvalue(p->player_int_opos().X, p->player_int_pos().X, smoothratio * (1. / MaxSmoothRatio));
cposy = __interpvalue(p->player_int_opos().Y, p->player_int_pos().Y, smoothratio); cposy = interpolatedvalue(p->player_int_opos().Y, p->player_int_pos().Y, smoothratio * (1. / MaxSmoothRatio));
cposz = __interpvalue(p->player_int_opos().Z, p->player_int_pos().Z, smoothratio);; cposz = interpolatedvalue(p->player_int_opos().Z, p->player_int_pos().Z, smoothratio * (1. / MaxSmoothRatio));;
if (SyncInput()) if (SyncInput())
{ {
// Original code for when the values are passed through the sync struct // Original code for when the values are passed through the sync struct

View file

@ -1465,11 +1465,11 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
if (cl_viewbob) if (cl_viewbob)
{ {
tz += bobamt; tz += bobamt;
tz += __interpvalue(pp->obob_z, pp->bob_z, smoothratio) * zworldtoint; tz += interpolatedvalue(pp->obob_z, pp->bob_z, smoothratio * (1. / MaxSmoothRatio)) * zworldtoint;
} }
// recoil only when not in camera // recoil only when not in camera
thoriz = q16horiz(clamp(thoriz.asq16() + __interpvalue(pp->recoil_ohorizoff, pp->recoil_horizoff, smoothratio), gi->playerHorizMin(), gi->playerHorizMax())); thoriz = q16horiz(clamp(thoriz.asq16() + interpolatedvalue(pp->recoil_ohorizoff, pp->recoil_horizoff, smoothratio * (1. / MaxSmoothRatio)), gi->playerHorizMin(), gi->playerHorizMax()));
} }
if (automapMode != am_full) if (automapMode != am_full)