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