From c0374cf890891001e71c225caf537a424996686d Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 28 Aug 2020 12:50:51 +1000 Subject: [PATCH] - SW: Move static function `DoReloadStatus()` into the class as private function --- source/sw/src/sbar.cpp | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/source/sw/src/sbar.cpp b/source/sw/src/sbar.cpp index 5addc629d..451433576 100644 --- a/source/sw/src/sbar.cpp +++ b/source/sw/src/sbar.cpp @@ -65,22 +65,6 @@ static const short icons[] = { ID_PanelCaltrops, }; -static bool DoReloadStatus(char *reloadstate, int ammo) -{ - bool reloading = ammo == 0 && *reloadstate != 2; - - if (ammo == 0 && *reloadstate == 0) - { - *reloadstate = 1; - } - if (ammo) - { - *reloadstate = 0; - } - - return reloading; -} - class DSWStatusBar : public DBaseStatusBar { DHUDFont miniFont, numberFont; @@ -719,6 +703,28 @@ private: } } + //--------------------------------------------------------------------------- + // + // Used in DrawHUD2() for determining whether a reloadable weapon is reloading. + // + //--------------------------------------------------------------------------- + + bool DoReloadStatus(char *reloadstate, int ammo) + { + bool reloading = ammo == 0 && *reloadstate != 2; + + if (ammo == 0 && *reloadstate == 0) + { + *reloadstate = 1; + } + else if (ammo) + { + *reloadstate = 0; + } + + return reloading; + } + //--------------------------------------------------------------------------- // //