apply weaponscale relative to baseline

This commit is contained in:
Xaser Acheron 2021-11-15 01:52:49 -06:00
parent 0b93aef776
commit 441b70022d
2 changed files with 5 additions and 2 deletions

View file

@ -411,6 +411,7 @@ bool HUDSprite::GetWeaponRect(HWDrawInfo *di, DPSprite *psp, float sx, float sy,
float tx;
float scale;
float scalex;
float ftextureadj;
float ftexturemid;
// decide which patch to use
@ -445,7 +446,8 @@ bool HUDSprite::GetWeaponRect(HWDrawInfo *di, DPSprite *psp, float sx, float sy,
x2 += viewwindowx;
// killough 12/98: fix psprite positioning problem
ftexturemid = 100.f - sy - r.top - psp->GetYAdjust(screenblocks >= 11);
ftextureadj = (120.0f / psp->baseScale.Y) - 100.0f; // [XA] scale relative to weapon baseline
ftexturemid = 100.f - sy - r.top - psp->GetYAdjust(screenblocks >= 11) - ftextureadj;
// [XA] note: Doom's native 1.2x aspect ratio was originally
// handled here by multiplying SCREENWIDTH by 200 instead of

View file

@ -293,7 +293,8 @@ namespace swrenderer
vis.renderflags = owner->renderflags;
FSoftwareTexture* stex = GetSoftwareTexture(tex);
vis.texturemid = (BASEYCENTER - sy) * stex->GetScale().Y + stex->GetTopOffset(0);
double textureadj = (120.0f / pspr->baseScale.Y) - BASEYCENTER; // [XA] scale relative to weapon baseline
vis.texturemid = (BASEYCENTER - sy - textureadj) * stex->GetScale().Y + stex->GetTopOffset(0);
// Force it to use software rendering when drawing to a canvas texture.
bool renderToCanvas = viewport->RenderingToCanvas;