mirror of https://github.com/AxioDL/metaforce.git
CModelData: Remove usages of const_cast
Allows readers to know that these functions do affect member state.
This commit is contained in:
parent
25c017e0cc
commit
4e9b22962c
|
@ -46,7 +46,7 @@ SAdvancementDeltas CModelData::GetAdvancementDeltas(const CCharAnimTime& a, cons
|
|||
}
|
||||
|
||||
void CModelData::Render(const CStateManager& stateMgr, const zeus::CTransform& xf, const CActorLights* lights,
|
||||
const CModelFlags& drawFlags) const {
|
||||
const CModelFlags& drawFlags) {
|
||||
Render(GetRenderingModel(stateMgr), xf, lights, drawFlags);
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ void CModelData::Touch(EWhichModel which, int shaderIdx) const {
|
|||
}
|
||||
|
||||
void CModelData::Touch(const CStateManager& stateMgr, int shaderIdx) const {
|
||||
Touch(const_cast<CModelData&>(*this).GetRenderingModel(stateMgr), shaderIdx);
|
||||
Touch(GetRenderingModel(stateMgr), shaderIdx);
|
||||
}
|
||||
|
||||
void CModelData::RenderThermal(const zeus::CColor& mulColor, const zeus::CColor& addColor,
|
||||
|
@ -312,10 +312,10 @@ void CModelData::RenderThermal(const zeus::CTransform& xf, const zeus::CColor& m
|
|||
}
|
||||
|
||||
void CModelData::RenderUnsortedParts(EWhichModel which, const zeus::CTransform& xf, const CActorLights* lights,
|
||||
const CModelFlags& drawFlags) const {
|
||||
const CModelFlags& drawFlags) {
|
||||
if ((x14_25_sortThermal && which == EWhichModel::ThermalHot) || x10_animData || !x1c_normalModel ||
|
||||
drawFlags.x0_blendMode > 4) {
|
||||
const_cast<CModelData*>(this)->x14_24_renderSorted = false;
|
||||
x14_24_renderSorted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -333,11 +333,11 @@ void CModelData::RenderUnsortedParts(EWhichModel which, const zeus::CTransform&
|
|||
model->DrawNormal(drawFlags, nullptr, nullptr);
|
||||
// Set ambient to white
|
||||
CGraphics::DisableAllLights();
|
||||
const_cast<CModelData*>(this)->x14_24_renderSorted = true;
|
||||
x14_24_renderSorted = true;
|
||||
}
|
||||
|
||||
void CModelData::Render(EWhichModel which, const zeus::CTransform& xf, const CActorLights* lights,
|
||||
const CModelFlags& drawFlags) const {
|
||||
const CModelFlags& drawFlags) {
|
||||
if (x14_25_sortThermal && which == EWhichModel::ThermalHot) {
|
||||
zeus::CColor mul(drawFlags.x4_color.a(), drawFlags.x4_color.a());
|
||||
RenderThermal(xf, mul, {0.f, 0.f, 0.f, 0.25f}, drawFlags);
|
||||
|
@ -373,7 +373,7 @@ void CModelData::Render(EWhichModel which, const zeus::CTransform& xf, const CAc
|
|||
|
||||
// Set ambient to white
|
||||
CGraphics::DisableAllLights();
|
||||
const_cast<CModelData*>(this)->x14_24_renderSorted = false;
|
||||
x14_24_renderSorted = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
|
||||
SAdvancementDeltas GetAdvancementDeltas(const CCharAnimTime& a, const CCharAnimTime& b) const;
|
||||
void Render(const CStateManager& stateMgr, const zeus::CTransform& xf, const CActorLights* lights,
|
||||
const CModelFlags& drawFlags) const;
|
||||
const CModelFlags& drawFlags);
|
||||
bool IsLoaded(int shaderIdx) const;
|
||||
static EWhichModel GetRenderingModel(const CStateManager& stateMgr);
|
||||
CSkinnedModel& PickAnimatedModel(EWhichModel which) const;
|
||||
|
@ -122,8 +122,8 @@ public:
|
|||
void RenderThermal(const zeus::CTransform& xf, const zeus::CColor& mulColor, const zeus::CColor& addColor,
|
||||
const CModelFlags& flags) const;
|
||||
void RenderUnsortedParts(EWhichModel, const zeus::CTransform& xf, const CActorLights* lights,
|
||||
const CModelFlags& drawFlags) const;
|
||||
void Render(EWhichModel, const zeus::CTransform& xf, const CActorLights* lights, const CModelFlags& drawFlags) const;
|
||||
const CModelFlags& drawFlags);
|
||||
void Render(EWhichModel, const zeus::CTransform& xf, const CActorLights* lights, const CModelFlags& drawFlags);
|
||||
|
||||
void InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, const CActorLights* lights,
|
||||
const zeus::CColor& color0, const zeus::CColor& color1);
|
||||
|
|
|
@ -31,7 +31,7 @@ void CSamusFaceReflection::PreDraw(const CStateManager& mgr) {
|
|||
}
|
||||
}
|
||||
|
||||
void CSamusFaceReflection::Draw(const CStateManager& mgr) const {
|
||||
void CSamusFaceReflection::Draw(const CStateManager& mgr) {
|
||||
if (x70_hidden)
|
||||
return;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class CSamusFaceReflection {
|
|||
public:
|
||||
explicit CSamusFaceReflection(CStateManager& stateMgr);
|
||||
void PreDraw(const CStateManager& stateMgr);
|
||||
void Draw(const CStateManager& stateMgr) const;
|
||||
void Draw(const CStateManager& stateMgr);
|
||||
void Update(float dt, const CStateManager& stateMgr, CRandom16& rand);
|
||||
};
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ void CGunMotion::Update(float dt, CStateManager& mgr) {
|
|||
xb8_24_animPlaying = false;
|
||||
}
|
||||
|
||||
void CGunMotion::Draw(const CStateManager& mgr, const zeus::CTransform& xf) const {
|
||||
void CGunMotion::Draw(const CStateManager& mgr, const zeus::CTransform& xf) {
|
||||
constexpr CModelFlags flags(0, 0, 3, zeus::skWhite);
|
||||
x0_modelData.Render(mgr, xf, nullptr, flags);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
void BasePosition(bool bigStrikeReset);
|
||||
void EnterFidget(CStateManager& mgr, SamusGun::EFidgetType type, s32 parm2);
|
||||
void Update(float dt, CStateManager& mgr);
|
||||
void Draw(const CStateManager& mgr, const zeus::CTransform& xf) const;
|
||||
void Draw(const CStateManager& mgr, const zeus::CTransform& xf);
|
||||
s32 GetFreeLookSetId() const { return x4c_gunController.GetFreeLookSetId(); }
|
||||
CGunController& GunController() { return x4c_gunController; }
|
||||
bool IsAnimPlaying() const { return xb8_24_animPlaying; }
|
||||
|
|
Loading…
Reference in New Issue