- SW: Move static function `DoReloadStatus()` into the class as private function

This commit is contained in:
Mitchell Richters 2020-08-28 12:50:51 +10:00 committed by Christoph Oelckers
parent 26ffc82cc0
commit c0374cf890
1 changed files with 22 additions and 16 deletions

View File

@ -65,22 +65,6 @@ static const short icons[] = {
ID_PanelCaltrops, 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 class DSWStatusBar : public DBaseStatusBar
{ {
DHUDFont miniFont, numberFont; 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;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //