- do proper interpolation of the snorkel in RR.

This commit is contained in:
Christoph Oelckers 2020-08-31 19:06:53 +02:00
parent 03aad6559b
commit 45a22eb3cd
5 changed files with 10 additions and 8 deletions

View file

@ -107,8 +107,8 @@ void processinput_d(int snum);
void processinput_r(int snum);
void displayweapon_d(int snum, double smoothratio);
void displayweapon_r(int snum, double smoothratio);
void displaymasks_d(int snum);
void displaymasks_r(int snum);
void displaymasks_d(int snum, double smoothratio);
void displaymasks_r(int snum, double smoothratio);
void think_d();
void think_r();
void animatesprites_d(int x, int y, int a, int smoothratio);

View file

@ -111,7 +111,7 @@ struct Dispatcher
void (*checkweapons)(struct player_struct* p);
void (*processinput)(int snum);
void (*displayweapon)(int snum, double smoothratio);
void (*displaymasks)(int snum);
void (*displaymasks)(int snum, double smoothratio);
void (*animatesprites)(int x, int y, int a, int smoothratio);

View file

@ -271,7 +271,7 @@ void drawoverlays(double smoothratio)
{
fi.displayweapon(screenpeek, smoothratio);
if (pp->over_shoulder_on == 0)
fi.displaymasks(screenpeek);
fi.displaymasks(screenpeek, smoothratio);
}
if (!isRR())
moveclouds();

View file

@ -188,7 +188,7 @@ int animateknuckles(int gs, int snum, double hard_landing, double look_anghalf,
//
//---------------------------------------------------------------------------
void displaymasks_d(int snum)
void displaymasks_d(int snum, double)
{
int p;

View file

@ -64,7 +64,7 @@ inline static void rd3myospal(double x, double y, int tilenum, int shade, int or
//
//---------------------------------------------------------------------------
void displaymasks_r(int snum)
void displaymasks_r(int snum, double smoothratio)
{
short p;
@ -76,8 +76,10 @@ void displaymasks_r(int snum)
if (ps[snum].scuba_on)
{
int pin = 0;
// to get the proper clock value with regards to interpolation we have add a smoothratio based offset to the value.
double interpclock = ud.levelclock + (TICSPERFRAME/65536.) * smoothratio;
if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_STRETCH;
hud_drawsprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15), (200 - (tilesiz[SCUBAMASK].y >> 1) + (calcSinTableValue(gameclock) / 1024.)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin);
hud_drawsprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15), (200 - (tilesiz[SCUBAMASK].y >> 1) + (calcSinTableValue(interpclock) / 1024.)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin);
hud_drawsprite((320 - tilesiz[SCUBAMASK + 4].x), (200 - tilesiz[SCUBAMASK + 4].y), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin);
hud_drawsprite(tilesiz[SCUBAMASK + 4].x, (200 - tilesiz[SCUBAMASK + 4].y), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 4 + 16 + pin);
hud_drawsprite(35, (-1), 65536, 0, SCUBAMASK + 3, 0, p, 2 + 16 + pin);
@ -928,4 +930,4 @@ void displayweapon_r(int snum, double smoothratio)
}
}
END_DUKE_NS
END_DUKE_NS