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

View file

@ -6706,7 +6706,7 @@ pWeaponBob(PANEL_SPRITEp psp, short condition)
SWBOOL DrawBeforeView = FALSE; SWBOOL DrawBeforeView = FALSE;
void void
pDisplaySprites(PLAYERp pp) pDisplaySprites(PLAYERp pp, double smoothratio)
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
PANEL_SPRITEp psp=NULL, next=NULL; PANEL_SPRITEp psp=NULL, next=NULL;
@ -7087,19 +7087,19 @@ pStateControl(PANEL_SPRITEp psp)
void void
UpdatePanel(void) UpdatePanel(double smoothratio)
{ {
short pnum; short pnum;
TRAVERSE_CONNECT(pnum) TRAVERSE_CONNECT(pnum)
{ {
if (dimensionmode != 2 && pnum == screenpeek) if (dimensionmode != 2 && pnum == screenpeek)
pDisplaySprites(Player + pnum); pDisplaySprites(Player + pnum, smoothratio);
} }
} }
void void
PreUpdatePanel(void) PreUpdatePanel(double smoothratio)
{ {
short pnum; short pnum;
DrawBeforeView = TRUE; DrawBeforeView = TRUE;
@ -7108,7 +7108,7 @@ PreUpdatePanel(void)
TRAVERSE_CONNECT(pnum) TRAVERSE_CONNECT(pnum)
{ {
if (dimensionmode != 2 && pnum == screenpeek) if (dimensionmode != 2 && pnum == screenpeek)
pDisplaySprites(Player + pnum); pDisplaySprites(Player + pnum, smoothratio);
} }
DrawBeforeView = FALSE; 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); PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATEp state, uint8_t priority, int x, int y);
void pSetSuicide(PANEL_SPRITEp psp); void pSetSuicide(PANEL_SPRITEp psp);
SWBOOL pKillScreenSpiteIDs(PLAYERp pp, short id); SWBOOL pKillScreenSpiteIDs(PLAYERp pp, short id);
void PreUpdatePanel(void); void PreUpdatePanel(double smoothratio);
void UpdatePanel(void); void UpdatePanel(double smoothratio);
void PlayerUpdateArmor(PLAYERp pp,short value); void PlayerUpdateArmor(PLAYERp pp,short value);
void pToggleCrosshair(void); void pToggleCrosshair(void);
void pKillSprite(PANEL_SPRITEp psp); void pKillSprite(PANEL_SPRITEp psp);