mirror of https://github.com/AxioDL/metaforce.git
CModelBoo: Make static data constexpr where applicable
Gets rid of potential runtime-initializers.
This commit is contained in:
parent
2f9dd38bbe
commit
3c4e25062d
|
@ -18,10 +18,32 @@
|
||||||
#include <logvisor/logvisor.hpp>
|
#include <logvisor/logvisor.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
static logvisor::Module Log("urde::CBooModel");
|
namespace {
|
||||||
bool CBooModel::g_DrawingOccluders = false;
|
logvisor::Module Log("urde::CBooModel");
|
||||||
|
CBooModel* g_FirstModel = nullptr;
|
||||||
|
|
||||||
static CBooModel* g_FirstModel = nullptr;
|
constexpr zeus::CMatrix4f ReflectBaseMtx{
|
||||||
|
0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f,
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr zeus::CMatrix4f ReflectPostGL{
|
||||||
|
1.f, 0.f, 0.f, 0.f, 0.f, -1.f, 0.f, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f,
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr zeus::CMatrix4f MBShadowPost0{
|
||||||
|
1.f, 0.f, 0.f, 0.f, 0.f, -1.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f,
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr zeus::CMatrix4f MBShadowPost1{
|
||||||
|
0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 1.f, -0.0625f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f,
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr zeus::CMatrix4f DisintegratePost{
|
||||||
|
1.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f,
|
||||||
|
};
|
||||||
|
} // Anonymous namespace
|
||||||
|
|
||||||
|
bool CBooModel::g_DrawingOccluders = false;
|
||||||
|
|
||||||
void CBooModel::Shutdown() {
|
void CBooModel::Shutdown() {
|
||||||
g_shadowMap.reset();
|
g_shadowMap.reset();
|
||||||
|
@ -59,12 +81,6 @@ bool CBooModel::g_RenderModelBlack = false;
|
||||||
|
|
||||||
zeus::CVector3f CBooModel::g_ReflectViewPos = {};
|
zeus::CVector3f CBooModel::g_ReflectViewPos = {};
|
||||||
|
|
||||||
static const zeus::CMatrix4f ReflectBaseMtx = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f,
|
|
||||||
0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f};
|
|
||||||
|
|
||||||
static const zeus::CMatrix4f ReflectPostGL = {1.f, 0.f, 0.f, 0.f, 0.f, -1.f, 0.f, 1.f,
|
|
||||||
0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f};
|
|
||||||
|
|
||||||
void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf, zeus::CMatrix4f* mtxsOut,
|
void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf, zeus::CMatrix4f* mtxsOut,
|
||||||
float& alphaOut) {
|
float& alphaOut) {
|
||||||
zeus::CVector3f modelToPlayer = g_PlayerPosition - CGraphics::g_GXModelMatrix.origin;
|
zeus::CVector3f modelToPlayer = g_PlayerPosition - CGraphics::g_GXModelMatrix.origin;
|
||||||
|
@ -747,17 +763,6 @@ void CBooModel::UVAnimationBuffer::PadOutBuffer(u8*& bufStart, u8*& bufOut) {
|
||||||
bufOut = bufStart + ROUND_UP_256(bufOut - bufStart);
|
bufOut = bufStart + ROUND_UP_256(bufOut - bufStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const zeus::CMatrix4f MBShadowPost0(1.f, 0.f, 0.f, 0.f,
|
|
||||||
0.f, -1.f, 0.f, 1.f,
|
|
||||||
0.f, 0.f, 0.f, 1.f,
|
|
||||||
0.f, 0.f, 0.f, 1.f);
|
|
||||||
|
|
||||||
static const zeus::CMatrix4f MBShadowPost1(0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 1.f, -0.0625f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f,
|
|
||||||
0.f, 1.f);
|
|
||||||
|
|
||||||
static const zeus::CMatrix4f DisintegratePost(1.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f,
|
|
||||||
1.f);
|
|
||||||
|
|
||||||
void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet, const CModelFlags& flags,
|
void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet, const CModelFlags& flags,
|
||||||
const CBooModel* parent) {
|
const CBooModel* parent) {
|
||||||
u8* start = bufOut;
|
u8* start = bufOut;
|
||||||
|
|
Loading…
Reference in New Issue