- consolidated the 3 nearly identical code fragments handling the weapon's YAdjust for the different renderers into a utility function in DPSprite.
This commit is contained in:
parent
4392b4e96d
commit
ead28db007
5 changed files with 31 additions and 39 deletions
|
|
@ -44,6 +44,7 @@
|
|||
#include "cmdlib.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "vm.h"
|
||||
#include "sbar.h"
|
||||
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
|
@ -1348,6 +1349,32 @@ void DPSprite::OnDestroy()
|
|||
//
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
float DPSprite::GetYAdjust(bool fullscreen)
|
||||
{
|
||||
AWeapon *weapon = dyn_cast<AWeapon>(GetCaller());
|
||||
if (weapon != nullptr)
|
||||
{
|
||||
float fYAd = weapon->YAdjust;
|
||||
if (fYAd != 0)
|
||||
{
|
||||
if (fullscreen)
|
||||
{
|
||||
return fYAd;
|
||||
}
|
||||
else
|
||||
{
|
||||
return StatusBar->GetDisplacement() * fYAd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
ADD_STAT(psprites)
|
||||
{
|
||||
FString out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue