mirror of https://github.com/AxioDL/metaforce.git
CModelBoo: Make use of static inline variables
Same behavior, but allows all the initializers to be in one place, rather than throughout the cpp file.
This commit is contained in:
parent
e9084df80b
commit
25c017e0cc
|
@ -184,14 +184,14 @@ private:
|
||||||
void WarmupDrawSurfaces() const;
|
void WarmupDrawSurfaces() const;
|
||||||
void WarmupDrawSurface(const CBooSurface& surf) const;
|
void WarmupDrawSurface(const CBooSurface& surf) const;
|
||||||
|
|
||||||
static zeus::CVector3f g_PlayerPosition;
|
static inline zeus::CVector3f g_PlayerPosition;
|
||||||
static float g_ModSeconds;
|
static inline float g_ModSeconds = 0.0f;
|
||||||
static float g_TransformedTime;
|
static inline float g_TransformedTime = 0.0f;
|
||||||
static float g_TransformedTime2;
|
static inline float g_TransformedTime2 = 0.0f;
|
||||||
static CBooModel* g_LastModelCached;
|
static inline CBooModel* g_LastModelCached = nullptr;
|
||||||
|
|
||||||
static bool g_DummyTextures;
|
static inline bool g_DummyTextures = false;
|
||||||
static bool g_RenderModelBlack;
|
static inline bool g_RenderModelBlack = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~CBooModel();
|
~CBooModel();
|
||||||
|
@ -230,25 +230,25 @@ public:
|
||||||
void ClearUniformCounter() { m_uniUpdateCount = 0; }
|
void ClearUniformCounter() { m_uniUpdateCount = 0; }
|
||||||
static void ClearModelUniformCounters();
|
static void ClearModelUniformCounters();
|
||||||
|
|
||||||
static bool g_DrawingOccluders;
|
static inline bool g_DrawingOccluders = false;
|
||||||
static void SetDrawingOccluders(bool occ) { g_DrawingOccluders = occ; }
|
static void SetDrawingOccluders(bool occ) { g_DrawingOccluders = occ; }
|
||||||
|
|
||||||
static void SetNewPlayerPositionAndTime(const zeus::CVector3f& pos);
|
static void SetNewPlayerPositionAndTime(const zeus::CVector3f& pos);
|
||||||
|
|
||||||
static zeus::CVector3f g_ReflectViewPos;
|
static inline zeus::CVector3f g_ReflectViewPos;
|
||||||
static void KillCachedViewDepState();
|
static void KillCachedViewDepState();
|
||||||
static void EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf, zeus::CMatrix4f* mtxsOut,
|
static void EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf, zeus::CMatrix4f* mtxsOut,
|
||||||
float& alphaOut);
|
float& alphaOut);
|
||||||
|
|
||||||
static boo::ObjToken<boo::ITexture> g_shadowMap;
|
static inline boo::ObjToken<boo::ITexture> g_shadowMap;
|
||||||
static zeus::CTransform g_shadowTexXf;
|
static inline zeus::CTransform g_shadowTexXf;
|
||||||
static void EnableShadowMaps(const boo::ObjToken<boo::ITexture>& map, const zeus::CTransform& texXf);
|
static void EnableShadowMaps(const boo::ObjToken<boo::ITexture>& map, const zeus::CTransform& texXf);
|
||||||
static void DisableShadowMaps();
|
static void DisableShadowMaps();
|
||||||
|
|
||||||
static boo::ObjToken<boo::ITexture> g_disintegrateTexture;
|
static inline boo::ObjToken<boo::ITexture> g_disintegrateTexture;
|
||||||
static void SetDisintegrateTexture(const boo::ObjToken<boo::ITexture>& map) { g_disintegrateTexture = map; }
|
static void SetDisintegrateTexture(const boo::ObjToken<boo::ITexture>& map) { g_disintegrateTexture = map; }
|
||||||
|
|
||||||
static boo::ObjToken<boo::ITextureCubeR> g_reflectionCube;
|
static inline boo::ObjToken<boo::ITextureCubeR> g_reflectionCube;
|
||||||
static void SetReflectionCube(const boo::ObjToken<boo::ITextureCubeR>& map) { g_reflectionCube = map; }
|
static void SetReflectionCube(const boo::ObjToken<boo::ITextureCubeR>& map) { g_reflectionCube = map; }
|
||||||
|
|
||||||
static void SetDummyTextures(bool b) { g_DummyTextures = b; }
|
static void SetDummyTextures(bool b) { g_DummyTextures = b; }
|
||||||
|
|
|
@ -43,8 +43,6 @@ constexpr zeus::CMatrix4f DisintegratePost{
|
||||||
};
|
};
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
bool CBooModel::g_DrawingOccluders = false;
|
|
||||||
|
|
||||||
void CBooModel::Shutdown() {
|
void CBooModel::Shutdown() {
|
||||||
g_shadowMap.reset();
|
g_shadowMap.reset();
|
||||||
g_disintegrateTexture.reset();
|
g_disintegrateTexture.reset();
|
||||||
|
@ -57,10 +55,6 @@ void CBooModel::ClearModelUniformCounters() {
|
||||||
model->ClearUniformCounter();
|
model->ClearUniformCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CBooModel::g_PlayerPosition = {};
|
|
||||||
float CBooModel::g_ModSeconds = 0.f;
|
|
||||||
float CBooModel::g_TransformedTime = 0.f;
|
|
||||||
float CBooModel::g_TransformedTime2 = 0.f;
|
|
||||||
void CBooModel::SetNewPlayerPositionAndTime(const zeus::CVector3f& pos) {
|
void CBooModel::SetNewPlayerPositionAndTime(const zeus::CVector3f& pos) {
|
||||||
g_PlayerPosition = pos;
|
g_PlayerPosition = pos;
|
||||||
KillCachedViewDepState();
|
KillCachedViewDepState();
|
||||||
|
@ -73,14 +67,8 @@ void CBooModel::SetNewPlayerPositionAndTime(const zeus::CVector3f& pos) {
|
||||||
g_TransformedTime2 = 1.f / -(0.015f * std::sin(g_ModSeconds * 1.5f + 1.f) - 1.f);
|
g_TransformedTime2 = 1.f / -(0.015f * std::sin(g_ModSeconds * 1.5f + 1.f) - 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBooModel* CBooModel::g_LastModelCached = nullptr;
|
|
||||||
void CBooModel::KillCachedViewDepState() { g_LastModelCached = nullptr; }
|
void CBooModel::KillCachedViewDepState() { g_LastModelCached = nullptr; }
|
||||||
|
|
||||||
bool CBooModel::g_DummyTextures = false;
|
|
||||||
bool CBooModel::g_RenderModelBlack = false;
|
|
||||||
|
|
||||||
zeus::CVector3f CBooModel::g_ReflectViewPos = {};
|
|
||||||
|
|
||||||
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;
|
||||||
|
@ -146,11 +134,6 @@ void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurfa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boo::ObjToken<boo::ITexture> CBooModel::g_shadowMap;
|
|
||||||
zeus::CTransform CBooModel::g_shadowTexXf;
|
|
||||||
boo::ObjToken<boo::ITexture> CBooModel::g_disintegrateTexture;
|
|
||||||
boo::ObjToken<boo::ITextureCubeR> CBooModel::g_reflectionCube;
|
|
||||||
|
|
||||||
void CBooModel::EnableShadowMaps(const boo::ObjToken<boo::ITexture>& map, const zeus::CTransform& texXf) {
|
void CBooModel::EnableShadowMaps(const boo::ObjToken<boo::ITexture>& map, const zeus::CTransform& texXf) {
|
||||||
g_shadowMap = map;
|
g_shadowMap = map;
|
||||||
g_shadowTexXf = texXf;
|
g_shadowTexXf = texXf;
|
||||||
|
|
Loading…
Reference in New Issue