From 402216447a0324f2590eae2b0a8fac34664e6cae Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 6 Apr 2020 02:15:37 -0400 Subject: [PATCH] CFluidPlane: Make Render() non-const Allows making the shader instances non-mutable. --- Runtime/World/CFluidPlane.hpp | 8 ++++---- Runtime/World/CFluidPlaneCPU.cpp | 4 ++-- Runtime/World/CFluidPlaneCPU.hpp | 4 ++-- Runtime/World/CFluidPlaneDoor.cpp | 4 ++-- Runtime/World/CFluidPlaneDoor.hpp | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Runtime/World/CFluidPlane.hpp b/Runtime/World/CFluidPlane.hpp index a4d848125..9246f9995 100644 --- a/Runtime/World/CFluidPlane.hpp +++ b/Runtime/World/CFluidPlane.hpp @@ -128,9 +128,9 @@ protected: float x48_rippleIntensity; CFluidUVMotion x4c_uvMotion; - mutable std::vector m_verts; - mutable std::vector m_pVerts; - mutable std::optional m_shader; + std::vector m_verts; + std::vector m_pVerts; + std::optional m_shader; float ProjectRippleVelocity(float baseI, float velDot) const; float CalculateRippleIntensity(float baseI) const; @@ -162,7 +162,7 @@ public: virtual void Render(const CStateManager& mgr, float alpha, const zeus::CAABox& aabb, const zeus::CTransform& xf, const zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum, const std::optional& rippleManager, TUniqueId waterId, - const bool* gridFlags, u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) const {} + const bool* gridFlags, u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) {} float GetAlpha() const { return x40_alpha; } EFluidType GetFluidType() const { return x44_fluidType; } diff --git a/Runtime/World/CFluidPlaneCPU.cpp b/Runtime/World/CFluidPlaneCPU.cpp index e9349a5b8..f30ad5efc 100644 --- a/Runtime/World/CFluidPlaneCPU.cpp +++ b/Runtime/World/CFluidPlaneCPU.cpp @@ -125,7 +125,7 @@ static const float* InitializeSineWave() { CFluidPlaneShader::RenderSetupInfo CFluidPlaneCPU::RenderSetup(const CStateManager& mgr, float alpha, const zeus::CTransform& xf, const zeus::CTransform& areaXf, const zeus::CAABox& aabb, - const CScriptWater* water) const { + const CScriptWater* water) { CFluidPlaneShader::RenderSetupInfo out; float uvT = mgr.GetFluidPlaneManager()->GetUVT(); @@ -740,7 +740,7 @@ void CFluidPlaneCPU::Render(const CStateManager& mgr, float alpha, const zeus::C const zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum, const std::optional& rippleManager, TUniqueId waterId, const bool* gridFlags, u32 gridDimX, u32 gridDimY, - const zeus::CVector3f& areaCenter) const { + const zeus::CVector3f& areaCenter) { SCOPED_GRAPHICS_DEBUG_GROUP("CFluidPlaneCPU::Render", zeus::skCyan); TCastToConstPtr water = mgr.GetObjectById(waterId); CFluidPlaneShader::RenderSetupInfo setupInfo = RenderSetup(mgr, alpha, xf, areaXf, aabb, water.GetPtr()); diff --git a/Runtime/World/CFluidPlaneCPU.hpp b/Runtime/World/CFluidPlaneCPU.hpp index 35ef93eca..4a8b9e7f2 100644 --- a/Runtime/World/CFluidPlaneCPU.hpp +++ b/Runtime/World/CFluidPlaneCPU.hpp @@ -96,11 +96,11 @@ public: zeus::CMatrix4f& mtxOut) const; CFluidPlaneShader::RenderSetupInfo RenderSetup(const CStateManager& mgr, float, const zeus::CTransform& xf, const zeus::CTransform& areaXf, const zeus::CAABox& aabb, - const CScriptWater* water) const; + const CScriptWater* water); void Render(const CStateManager& mgr, float alpha, const zeus::CAABox& aabb, const zeus::CTransform& xf, const zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum, const std::optional& rippleManager, TUniqueId waterId, const bool* gridFlags, - u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) const override; + u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) override; float GetReflectionBlend() const { return x114_reflectionBlend; } float GetSpecularMax() const { return x110_specularMax; } float GetSpecularMin() const { return x10c_specularMin; } diff --git a/Runtime/World/CFluidPlaneDoor.cpp b/Runtime/World/CFluidPlaneDoor.cpp index d91d52238..339d321bd 100644 --- a/Runtime/World/CFluidPlaneDoor.cpp +++ b/Runtime/World/CFluidPlaneDoor.cpp @@ -15,7 +15,7 @@ CFluidPlaneDoor::CFluidPlaneDoor(CAssetId patternTex1, CAssetId patternTex2, CAs CFluidPlaneShader::RenderSetupInfo CFluidPlaneDoor::RenderSetup(const CStateManager& mgr, float alpha, const zeus::CTransform& xf, const zeus::CAABox& aabb, - bool noNormals) const { + bool noNormals) { CFluidPlaneShader::RenderSetupInfo out; float uvT = mgr.GetFluidPlaneManager()->GetUVT(); @@ -62,7 +62,7 @@ void CFluidPlaneDoor::Render(const CStateManager& mgr, float alpha, const zeus:: const zeus::CFrustum& frustum, const std::optional& rippleManager, TUniqueId waterId, const bool* gridFlags, u32 gridDimX, u32 gridDimY, - const zeus::CVector3f& areaCenter) const { + const zeus::CVector3f& areaCenter) { SCOPED_GRAPHICS_DEBUG_GROUP("CFluidPlaneDoor::Render", zeus::skCyan); CFluidPlaneShader::RenderSetupInfo setupInfo = RenderSetup(mgr, alpha, xf, aabb, noNormals); diff --git a/Runtime/World/CFluidPlaneDoor.hpp b/Runtime/World/CFluidPlaneDoor.hpp index f3885b59d..32ca87014 100644 --- a/Runtime/World/CFluidPlaneDoor.hpp +++ b/Runtime/World/CFluidPlaneDoor.hpp @@ -12,7 +12,7 @@ class CFluidPlaneDoor final : public CFluidPlane { float xa8_rippleResolution; CFluidPlaneShader::RenderSetupInfo RenderSetup(const CStateManager& mgr, float alpha, const zeus::CTransform& xf, - const zeus::CAABox& aabb, bool noNormals) const; + const zeus::CAABox& aabb, bool noNormals); public: CFluidPlaneDoor(CAssetId patternTex1, CAssetId patternTex2, CAssetId colorTex, float tileSize, u32 tileSubdivisions, @@ -26,7 +26,7 @@ public: void Render(const CStateManager& mgr, float alpha, const zeus::CAABox& aabb, const zeus::CTransform& xf, const zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum, const std::optional& rippleManager, TUniqueId waterId, const bool* gridFlags, - u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) const override; + u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) override; }; } // namespace urde