2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:07:42 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -1,43 +1,37 @@
#include "CFontImageDef.hpp"
#include "Graphics/CTexture.hpp"
namespace urde
{
namespace urde {
CFontImageDef::CFontImageDef(const std::vector<TToken<CTexture>>& texs,
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 std::vector<TToken<CTexture>>& texs, 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& cropFactor)
: x0_fps(0.f), x14_cropFactor(cropFactor)
{
x4_texs.push_back(tex);
: x0_fps(0.f), x14_cropFactor(cropFactor) {
x4_texs.push_back(tex);
}
bool CFontImageDef::IsLoaded() const
{
for (const TToken<CTexture>& tok : x4_texs)
if (!tok.IsLoaded())
return false;
return true;
bool CFontImageDef::IsLoaded() const {
for (const TToken<CTexture>& tok : x4_texs)
if (!tok.IsLoaded())
return false;
return true;
}
s32 CFontImageDef::CalculateBaseline() const
{
const CTexture* tex = x4_texs.front().GetObj();
return s32(tex->GetHeight() * x14_cropFactor.y()) * 2.5f / 3.f;
s32 CFontImageDef::CalculateBaseline() const {
const CTexture* tex = x4_texs.front().GetObj();
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_cropFactor.y();
return scaledH - (scaledH - CalculateBaseline());
s32 CFontImageDef::CalculateHeight() const {
const CTexture* tex = x4_texs.front().GetObj();
s32 scaledH = tex->GetHeight() * x14_cropFactor.y();
return scaledH - (scaledH - CalculateBaseline());
}
}
} // namespace urde