2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 11:47:43 +00:00

GuiSys Image geometry fixes

This commit is contained in:
Jack Andersen
2017-01-29 20:58:59 -10:00
parent e276bd3be9
commit 83baca806d
9 changed files with 38 additions and 36 deletions

View File

@@ -5,16 +5,16 @@ namespace urde
{
CFontImageDef::CFontImageDef(const std::vector<TToken<CTexture>>& texs,
float interval, const zeus::CVector2f& vec)
: x0_fps(interval), x14_pointsPerTexel(vec)
float interval, const zeus::CVector2f& cropFactor)
: x0_fps(interval), x14_cropFactor(cropFactor)
{
x4_texs.reserve(texs.size());
for (const TToken<CTexture>& tok : texs)
x4_texs.push_back(tok);
}
CFontImageDef::CFontImageDef(const TToken<CTexture>& tex, const zeus::CVector2f& vec)
: x0_fps(0.f), x14_pointsPerTexel(vec)
CFontImageDef::CFontImageDef(const TToken<CTexture>& tex, const zeus::CVector2f& cropFactor)
: x0_fps(0.f), x14_cropFactor(cropFactor)
{
x4_texs.push_back(tex);
}
@@ -30,13 +30,13 @@ bool CFontImageDef::IsLoaded() const
s32 CFontImageDef::CalculateBaseline() const
{
const CTexture* tex = x4_texs.front().GetObj();
return s32(tex->GetHeight() * x14_pointsPerTexel.y) * 2.5f / 3.f;
return s32(tex->GetHeight() * x14_cropFactor.y) * 2.5f / 3.f;
}
s32 CFontImageDef::CalculateHeight() const
{
const CTexture* tex = x4_texs.front().GetObj();
s32 scaledH = tex->GetHeight() * x14_pointsPerTexel.y;
s32 scaledH = tex->GetHeight() * x14_cropFactor.y;
return scaledH - (scaledH - CalculateBaseline());
}