- SW: Prepare draw and panel code for interpolation of weapon's x/y coordinates.

This commit is contained in:
Mitchell Richters 2020-08-18 16:25:12 +10:00
parent a535f62d4a
commit e8faca52a2
3 changed files with 10 additions and 11 deletions

View file

@ -1714,13 +1714,12 @@ drawscreen(PLAYERp pp)
DrawScreen = TRUE;
PreDraw();
PreUpdatePanel();
smoothratio = CalcSmoothRatio(totalclock, ototalclock, 120 / synctics);
if (paused && !ReloadPrompt) // The checks were brought over from domovethings
smoothratio = 65536;
PreUpdatePanel(smoothratio);
if (!ScreenSavePic)
{
dointerpolations(smoothratio); // Stick at beginning of drawscreen
@ -1871,7 +1870,7 @@ drawscreen(PLAYERp pp)
UpdateStatusBar(totalclock);
UpdatePanel();
UpdatePanel(smoothratio);
#define SLIME 2305
// Only animate lava if its picnum is on screen

View file

@ -6706,7 +6706,7 @@ pWeaponBob(PANEL_SPRITEp psp, short condition)
SWBOOL DrawBeforeView = FALSE;
void
pDisplaySprites(PLAYERp pp)
pDisplaySprites(PLAYERp pp, double smoothratio)
{
USERp u = User[pp->PlayerSprite];
PANEL_SPRITEp psp=NULL, next=NULL;
@ -7087,19 +7087,19 @@ pStateControl(PANEL_SPRITEp psp)
void
UpdatePanel(void)
UpdatePanel(double smoothratio)
{
short pnum;
TRAVERSE_CONNECT(pnum)
{
if (dimensionmode != 2 && pnum == screenpeek)
pDisplaySprites(Player + pnum);
pDisplaySprites(Player + pnum, smoothratio);
}
}
void
PreUpdatePanel(void)
PreUpdatePanel(double smoothratio)
{
short pnum;
DrawBeforeView = TRUE;
@ -7108,7 +7108,7 @@ PreUpdatePanel(void)
TRAVERSE_CONNECT(pnum)
{
if (dimensionmode != 2 && pnum == screenpeek)
pDisplaySprites(Player + pnum);
pDisplaySprites(Player + pnum, smoothratio);
}
DrawBeforeView = FALSE;

View file

@ -183,8 +183,8 @@ enum BorderTypes
PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATEp state, uint8_t priority, int x, int y);
void pSetSuicide(PANEL_SPRITEp psp);
SWBOOL pKillScreenSpiteIDs(PLAYERp pp, short id);
void PreUpdatePanel(void);
void UpdatePanel(void);
void PreUpdatePanel(double smoothratio);
void UpdatePanel(double smoothratio);
void PlayerUpdateArmor(PLAYERp pp,short value);
void pToggleCrosshair(void);
void pKillSprite(PANEL_SPRITEp psp);