mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-11 03:01:12 +00:00
- Migrate spritetypebase::interpolatedvec3()
to backend solution.
* Also eliminate unused `interpolatedvec2() method from class.
This commit is contained in:
parent
1e36aa0e7f
commit
e970ed0f27
6 changed files with 11 additions and 25 deletions
|
@ -145,23 +145,9 @@ public:
|
|||
return interpolatedvaluef(opos.Z, spr.pos.Z, smoothratio, scale);
|
||||
}
|
||||
|
||||
DVector2 interpolatedvec2(double const smoothratio, int const scale = 16)
|
||||
DVector3 interpolatedvec3(double const smoothratio)
|
||||
{
|
||||
return
|
||||
{
|
||||
interpolatedx(smoothratio, scale),
|
||||
interpolatedy(smoothratio, scale)
|
||||
};
|
||||
}
|
||||
|
||||
DVector3 interpolatedvec3(double const smoothratio, int const scale = 16)
|
||||
{
|
||||
return
|
||||
{
|
||||
interpolatedx(smoothratio, scale),
|
||||
interpolatedy(smoothratio, scale),
|
||||
interpolatedz(smoothratio, scale)
|
||||
};
|
||||
return ::interpolatedvec3(opos, spr.pos, smoothratio);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -580,7 +580,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
|
|||
|
||||
if (cl_interpolate && owneractor->interpolated && !(pTSprite->flags & 512))
|
||||
{
|
||||
pTSprite->pos = owneractor->interpolatedvec3(gInterpolate);
|
||||
pTSprite->pos = owneractor->interpolatedvec3(gInterpolate / 65536.);
|
||||
pTSprite->angle = owneractor->interpolatedangle(gInterpolate / 65536.);
|
||||
}
|
||||
int nAnim = 0;
|
||||
|
|
|
@ -173,7 +173,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
}
|
||||
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
|
||||
{
|
||||
t->pos = h->interpolatedvec3(smoothratio);
|
||||
t->pos = h->interpolatedvec3(smoothratio / 65536.);
|
||||
}
|
||||
|
||||
auto sectp = h->sector();
|
||||
|
|
|
@ -155,7 +155,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
}
|
||||
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
|
||||
{
|
||||
t->pos = h->interpolatedvec3(smoothratio);
|
||||
t->pos = h->interpolatedvec3(smoothratio / 65536.);
|
||||
}
|
||||
|
||||
auto sectp = h->sector();
|
||||
|
|
|
@ -69,7 +69,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c
|
|||
if (pTSprite->ownerActor)
|
||||
{
|
||||
// interpolate sprite position
|
||||
pTSprite->pos = pTSprite->ownerActor->interpolatedvec3(smoothratio);
|
||||
pTSprite->pos = pTSprite->ownerActor->interpolatedvec3(smoothratio / 65536.);
|
||||
pTSprite->angle = pTSprite->ownerActor->interpolatedangle(smoothratio / 65536.);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -570,7 +570,7 @@ DSWActor* ConnectCopySprite(spritetypebase const* tsp)
|
|||
void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int camang)
|
||||
{
|
||||
int tSpriteNum;
|
||||
int smr4, smr2;
|
||||
double smr4, smr2;
|
||||
static int ang = 0;
|
||||
PLAYER* pp = Player + screenpeek;
|
||||
int newshade=0;
|
||||
|
@ -580,8 +580,8 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
|
|||
|
||||
ang = NORM_ANGLE(ang + 12);
|
||||
|
||||
smr4 = int(smoothratio) + IntToFixed(MoveSkip4);
|
||||
smr2 = int(smoothratio) + IntToFixed(MoveSkip2);
|
||||
smr4 = smoothratio + IntToFixed(MoveSkip4);
|
||||
smr2 = smoothratio + IntToFixed(MoveSkip2);
|
||||
|
||||
for (tSpriteNum = (int)tsprites.Size() - 1; tSpriteNum >= 0; tSpriteNum--)
|
||||
{
|
||||
|
@ -618,7 +618,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
|
|||
{
|
||||
if (tsp->statnum <= STAT_SKIP4_INTERP_END)
|
||||
{
|
||||
tsp->pos = tActor->interpolatedvec3(smr4, 18);
|
||||
tsp->pos = tActor->interpolatedvec3(smr4 / 262144.);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -626,7 +626,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
|
|||
{
|
||||
if (tsp->statnum <= STAT_SKIP2_INTERP_END)
|
||||
{
|
||||
tsp->pos = tActor->interpolatedvec3(smr2, 17);
|
||||
tsp->pos = tActor->interpolatedvec3(smr2 / 131072.);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue