CFluidPlane: Make Render() non-const

Allows making the shader instances non-mutable.
This commit is contained in:
Lioncash 2020-04-06 02:15:37 -04:00
parent 22eb5c837e
commit 402216447a
5 changed files with 12 additions and 12 deletions

View File

@ -128,9 +128,9 @@ protected:
float x48_rippleIntensity; float x48_rippleIntensity;
CFluidUVMotion x4c_uvMotion; CFluidUVMotion x4c_uvMotion;
mutable std::vector<CFluidPlaneShader::Vertex> m_verts; std::vector<CFluidPlaneShader::Vertex> m_verts;
mutable std::vector<CFluidPlaneShader::PatchVertex> m_pVerts; std::vector<CFluidPlaneShader::PatchVertex> m_pVerts;
mutable std::optional<CFluidPlaneShader> m_shader; std::optional<CFluidPlaneShader> m_shader;
float ProjectRippleVelocity(float baseI, float velDot) const; float ProjectRippleVelocity(float baseI, float velDot) const;
float CalculateRippleIntensity(float baseI) 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, 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 zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum,
const std::optional<CRippleManager>& rippleManager, TUniqueId waterId, const std::optional<CRippleManager>& 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; } float GetAlpha() const { return x40_alpha; }
EFluidType GetFluidType() const { return x44_fluidType; } EFluidType GetFluidType() const { return x44_fluidType; }

View File

@ -125,7 +125,7 @@ static const float* InitializeSineWave() {
CFluidPlaneShader::RenderSetupInfo CFluidPlaneCPU::RenderSetup(const CStateManager& mgr, float alpha, CFluidPlaneShader::RenderSetupInfo CFluidPlaneCPU::RenderSetup(const CStateManager& mgr, float alpha,
const zeus::CTransform& xf, const zeus::CTransform& xf,
const zeus::CTransform& areaXf, const zeus::CAABox& aabb, const zeus::CTransform& areaXf, const zeus::CAABox& aabb,
const CScriptWater* water) const { const CScriptWater* water) {
CFluidPlaneShader::RenderSetupInfo out; CFluidPlaneShader::RenderSetupInfo out;
float uvT = mgr.GetFluidPlaneManager()->GetUVT(); 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 zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum,
const std::optional<CRippleManager>& rippleManager, TUniqueId waterId, const std::optional<CRippleManager>& rippleManager, TUniqueId waterId,
const bool* gridFlags, u32 gridDimX, u32 gridDimY, const bool* gridFlags, u32 gridDimX, u32 gridDimY,
const zeus::CVector3f& areaCenter) const { const zeus::CVector3f& areaCenter) {
SCOPED_GRAPHICS_DEBUG_GROUP("CFluidPlaneCPU::Render", zeus::skCyan); SCOPED_GRAPHICS_DEBUG_GROUP("CFluidPlaneCPU::Render", zeus::skCyan);
TCastToConstPtr<CScriptWater> water = mgr.GetObjectById(waterId); TCastToConstPtr<CScriptWater> water = mgr.GetObjectById(waterId);
CFluidPlaneShader::RenderSetupInfo setupInfo = RenderSetup(mgr, alpha, xf, areaXf, aabb, water.GetPtr()); CFluidPlaneShader::RenderSetupInfo setupInfo = RenderSetup(mgr, alpha, xf, areaXf, aabb, water.GetPtr());

View File

@ -96,11 +96,11 @@ public:
zeus::CMatrix4f& mtxOut) const; zeus::CMatrix4f& mtxOut) const;
CFluidPlaneShader::RenderSetupInfo RenderSetup(const CStateManager& mgr, float, const zeus::CTransform& xf, CFluidPlaneShader::RenderSetupInfo RenderSetup(const CStateManager& mgr, float, const zeus::CTransform& xf,
const zeus::CTransform& areaXf, const zeus::CAABox& aabb, 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, 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 zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum,
const std::optional<CRippleManager>& rippleManager, TUniqueId waterId, const bool* gridFlags, const std::optional<CRippleManager>& 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 GetReflectionBlend() const { return x114_reflectionBlend; }
float GetSpecularMax() const { return x110_specularMax; } float GetSpecularMax() const { return x110_specularMax; }
float GetSpecularMin() const { return x10c_specularMin; } float GetSpecularMin() const { return x10c_specularMin; }

View File

@ -15,7 +15,7 @@ CFluidPlaneDoor::CFluidPlaneDoor(CAssetId patternTex1, CAssetId patternTex2, CAs
CFluidPlaneShader::RenderSetupInfo CFluidPlaneDoor::RenderSetup(const CStateManager& mgr, float alpha, CFluidPlaneShader::RenderSetupInfo CFluidPlaneDoor::RenderSetup(const CStateManager& mgr, float alpha,
const zeus::CTransform& xf, const zeus::CAABox& aabb, const zeus::CTransform& xf, const zeus::CAABox& aabb,
bool noNormals) const { bool noNormals) {
CFluidPlaneShader::RenderSetupInfo out; CFluidPlaneShader::RenderSetupInfo out;
float uvT = mgr.GetFluidPlaneManager()->GetUVT(); float uvT = mgr.GetFluidPlaneManager()->GetUVT();
@ -62,7 +62,7 @@ void CFluidPlaneDoor::Render(const CStateManager& mgr, float alpha, const zeus::
const zeus::CFrustum& frustum, const zeus::CFrustum& frustum,
const std::optional<CRippleManager>& rippleManager, TUniqueId waterId, const std::optional<CRippleManager>& rippleManager, TUniqueId waterId,
const bool* gridFlags, u32 gridDimX, u32 gridDimY, const bool* gridFlags, u32 gridDimX, u32 gridDimY,
const zeus::CVector3f& areaCenter) const { const zeus::CVector3f& areaCenter) {
SCOPED_GRAPHICS_DEBUG_GROUP("CFluidPlaneDoor::Render", zeus::skCyan); SCOPED_GRAPHICS_DEBUG_GROUP("CFluidPlaneDoor::Render", zeus::skCyan);
CFluidPlaneShader::RenderSetupInfo setupInfo = RenderSetup(mgr, alpha, xf, aabb, noNormals); CFluidPlaneShader::RenderSetupInfo setupInfo = RenderSetup(mgr, alpha, xf, aabb, noNormals);

View File

@ -12,7 +12,7 @@ class CFluidPlaneDoor final : public CFluidPlane {
float xa8_rippleResolution; float xa8_rippleResolution;
CFluidPlaneShader::RenderSetupInfo RenderSetup(const CStateManager& mgr, float alpha, const zeus::CTransform& xf, 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: public:
CFluidPlaneDoor(CAssetId patternTex1, CAssetId patternTex2, CAssetId colorTex, float tileSize, u32 tileSubdivisions, 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, 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 zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum,
const std::optional<CRippleManager>& rippleManager, TUniqueId waterId, const bool* gridFlags, const std::optional<CRippleManager>& 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 } // namespace urde