From 0c1b47faf87e5e6eb83127b638b73318e9ec22bd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 Apr 2020 20:09:12 -0400 Subject: [PATCH] CProjectileWeapon: Remove usages of const_cast Now that the base Render() function was made non-const, it's trivial to apply this to the other classes like CProjectileWeapon. --- Runtime/Weapon/CProjectileWeapon.cpp | 6 +++--- Runtime/Weapon/CProjectileWeapon.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Runtime/Weapon/CProjectileWeapon.cpp b/Runtime/Weapon/CProjectileWeapon.cpp index 31316e3b9..f3b816c04 100644 --- a/Runtime/Weapon/CProjectileWeapon.cpp +++ b/Runtime/Weapon/CProjectileWeapon.cpp @@ -201,7 +201,7 @@ void CProjectileWeapon::RenderParticles() const { x104_->Render(); } -void CProjectileWeapon::AddToRenderer() const { +void CProjectileWeapon::AddToRenderer() { if (xfc_APSMGen) g_Renderer->AddParticleGen(*xfc_APSMGen); if (x100_APS2Gen) @@ -216,7 +216,7 @@ void CProjectileWeapon::AddToRenderer() const { g_Renderer->AddParticleGen(*x104_); } -void CProjectileWeapon::Render() const { +void CProjectileWeapon::Render() { if (xf4_curFrame > xe8_lifetime || !x124_24_active || !x108_model) return; @@ -227,7 +227,7 @@ void CProjectileWeapon::Render() const { std::vector useLights; useLights.push_back(CLight::BuildLocalAmbient({}, xc8_ambientLightColor)); - const_cast(**x108_model).GetInstance().ActivateLights(useLights); + (**x108_model).GetInstance().ActivateLights(useLights); CModelFlags flags(0, 0, 3, zeus::skWhite); (*x108_model)->Draw(flags); } diff --git a/Runtime/Weapon/CProjectileWeapon.hpp b/Runtime/Weapon/CProjectileWeapon.hpp index b24b68433..1b83e1816 100644 --- a/Runtime/Weapon/CProjectileWeapon.hpp +++ b/Runtime/Weapon/CProjectileWeapon.hpp @@ -88,8 +88,8 @@ public: const zeus::CVector3f& target); TLockedToken GetWeaponDescription() const { return x4_weaponDesc; } void RenderParticles() const; - virtual void AddToRenderer() const; - virtual void Render() const; + virtual void AddToRenderer(); + virtual void Render(); bool IsSystemDeletable() const; void UpdateChildParticleSystems(float); void UpdatePSTranslationAndOrientation();