From e8faca52a2cdee9bad6e5c5d4a0f823347a29846 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 18 Aug 2020 16:25:12 +1000 Subject: [PATCH] - SW: Prepare draw and panel code for interpolation of weapon's x/y coordinates. --- source/sw/src/draw.cpp | 7 +++---- source/sw/src/panel.cpp | 10 +++++----- source/sw/src/panel.h | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index a7984ac25..330d6db46 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -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 diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 399ab5953..3c04a617b 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -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; diff --git a/source/sw/src/panel.h b/source/sw/src/panel.h index 3c6b92c19..809898639 100644 --- a/source/sw/src/panel.h +++ b/source/sw/src/panel.h @@ -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);