2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-04-13 16:07:18 -07:00
|
|
|
|
2019-06-11 19:05:17 -07:00
|
|
|
#include <optional>
|
2019-09-27 19:53:03 -07:00
|
|
|
|
|
|
|
#include "Runtime/CToken.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-04-13 16:07:18 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2016-04-13 16:07:18 -07:00
|
|
|
class CCharLayoutInfo;
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CLayoutDescription {
|
2016-04-13 16:07:18 -07:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
class CScaledLayoutDescription {
|
2016-04-13 16:07:18 -07:00
|
|
|
TLockedToken<CCharLayoutInfo> x0_layoutToken;
|
2020-04-07 09:34:12 -07:00
|
|
|
float xc_scale = 0.0f;
|
2019-06-11 19:05:17 -07:00
|
|
|
std::optional<zeus::CVector3f> x10_scaleVec;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
|
|
|
public:
|
|
|
|
const TLockedToken<CCharLayoutInfo>& ScaledLayout() const { return x0_layoutToken; }
|
|
|
|
float GlobalScale() const { return xc_scale; }
|
2019-06-11 19:05:17 -07:00
|
|
|
const std::optional<zeus::CVector3f>& GetScaleVec() const { return x10_scaleVec; }
|
2018-12-07 21:30:43 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
TLockedToken<CCharLayoutInfo> x0_layoutToken;
|
2019-06-11 19:05:17 -07:00
|
|
|
std::optional<CScaledLayoutDescription> xc_scaled;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
2016-04-13 16:07:18 -07:00
|
|
|
public:
|
2020-03-30 20:52:22 -07:00
|
|
|
explicit CLayoutDescription(const TLockedToken<CCharLayoutInfo>& token) : x0_layoutToken(token) {}
|
2016-04-13 16:07:18 -07:00
|
|
|
|
2019-06-11 19:05:17 -07:00
|
|
|
const std::optional<CScaledLayoutDescription>& GetScaledLayoutDescription() const { return xc_scaled; }
|
2018-12-07 21:30:43 -08:00
|
|
|
|
|
|
|
const TLockedToken<CCharLayoutInfo>& GetCharLayoutInfo() const { return x0_layoutToken; }
|
|
|
|
bool UsesScale() const { return bool(xc_scaled); }
|
|
|
|
const TLockedToken<CCharLayoutInfo>& ScaledLayout() const {
|
|
|
|
if (UsesScale())
|
|
|
|
return xc_scaled->ScaledLayout();
|
|
|
|
return x0_layoutToken;
|
|
|
|
}
|
|
|
|
};
|
2016-04-13 16:07:18 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|