From 136f1891c19e45509e8755753b2c76ed3de3143c Mon Sep 17 00:00:00 2001 From: wraitii Date: Tue, 21 May 2013 08:55:49 +0000 Subject: [PATCH] Fixes a fix about a fix on the waterManager. Fixes #1891 This was SVN commit r13411. --- source/renderer/WaterManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/renderer/WaterManager.cpp b/source/renderer/WaterManager.cpp index ac355eb68e..f591f49d33 100644 --- a/source/renderer/WaterManager.cpp +++ b/source/renderer/WaterManager.cpp @@ -396,6 +396,8 @@ void WaterManager::CreateSuperfancyInfo(CSimulation2* simulation) m_FoamFactor[j*mapSize + i] = foamAmount; } } + + delete[] waveForceHQ; // TODO: The rest should be cleaned up @@ -430,10 +432,13 @@ void WaterManager::CreateSuperfancyInfo(CSimulation2* simulation) { waterPosition += CVector2D(i*size+xx,j*size+yy); waterTexel++; + avnormal += terrain->CalcExactNormal( (i*size+xx)*4.0f,(j*size+yy)*4.0f); } - avnormal += terrain->CalcExactNormal( (i*size+xx)*4.0f,(j*size+yy)*4.0f); } } + if (landTexel < size/2) + continue; + landPosition /= landTexel; waterPosition /= waterTexel; @@ -441,8 +446,6 @@ void WaterManager::CreateSuperfancyInfo(CSimulation2* simulation) avnormal.Normalize(); avnormal[1] = 0.0f; - if (landTexel < size/2) - continue; // this should help ensure that the shore is pretty flat. if (avnormal.Length() <= 0.2f) continue;