diff --git a/include/Kyoto/Particles/CParticleGen.hpp b/include/Kyoto/Particles/CParticleGen.hpp index 71be9c1d..b36c7c6c 100644 --- a/include/Kyoto/Particles/CParticleGen.hpp +++ b/include/Kyoto/Particles/CParticleGen.hpp @@ -12,7 +12,7 @@ class CParticleGen { public: virtual ~CParticleGen() = 0; virtual void Update(double) = 0; - virtual void Render() = 0; + virtual void Render() const = 0; virtual void SetOrientation(const CTransform4f& orientation) = 0; virtual void SetTranslation(const CVector3f& translation) = 0; virtual void SetGlobalOrientation(const CTransform4f& orientation) = 0; diff --git a/include/Weapons/IWeaponRenderer.hpp b/include/Weapons/IWeaponRenderer.hpp index 4b60badb..faecc2fc 100644 --- a/include/Weapons/IWeaponRenderer.hpp +++ b/include/Weapons/IWeaponRenderer.hpp @@ -1,22 +1,22 @@ #ifndef __IWEAPONRENDERER_HPP__ #define __IWEAPONRENDERER_HPP__ -class CParticleGen; +#include "Kyoto/Alloc/CMemory.hpp" +#include "Kyoto/Particles/CParticleGen.hpp" + class IWeaponRenderer { public: - virtual ~IWeaponRenderer() {} + virtual ~IWeaponRenderer() {}; virtual void AddParticleGen(const CParticleGen& gen) = 0; - static void SetRenderer(IWeaponRenderer* renderer) { sWeaponRenderer = renderer; } private: static IWeaponRenderer* sWeaponRenderer; }; - -class CDefaultRenderer : public IWeaponRenderer { +class CDefaultWeaponRenderer : public IWeaponRenderer { public: - ~CDefaultRenderer(); - void AddParticleGen(const CParticleGen& gen); + virtual ~CDefaultWeaponRenderer() {}; + void AddParticleGen(const CParticleGen& gen) { gen.Render(); } }; #endif //__IWEAPONRENDERER_HPP__ diff --git a/src/Weapons/IWeaponRenderer.cpp b/src/Weapons/IWeaponRenderer.cpp index c7808b38..34fc81d0 100644 --- a/src/Weapons/IWeaponRenderer.cpp +++ b/src/Weapons/IWeaponRenderer.cpp @@ -1,15 +1,4 @@ #include "Weapons/IWeaponRenderer.hpp" -#include "Kyoto/Particles/CParticleGen.hpp" -#include "Kyoto/Alloc/CMemory.hpp" - -static CDefaultRenderer sDefaultRenderer = CDefaultRenderer(); +static CDefaultWeaponRenderer sDefaultRenderer; IWeaponRenderer* IWeaponRenderer::sWeaponRenderer = &sDefaultRenderer; - - -CDefaultRenderer::~CDefaultRenderer() { -} - -void CDefaultRenderer::AddParticleGen(const CParticleGen& gen) { - const_cast(gen).Render(); -}