summaryrefslogtreecommitdiff
path: root/indra/newview/llwaterparammanager.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-03-31 18:46:56 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-03-31 18:46:56 +0300
commit5a0547cdc366678a21c23ac4669d9e1a867ca331 (patch)
tree93664b4de3fdd7993f52150e6ac47c9391830a67 /indra/newview/llwaterparammanager.cpp
parent5c3ae68299f79f3a705fa4b3e9cd262b56695318 (diff)
parent8c04829110028c951d05470d54de5bf3708ff773 (diff)
STORM-1126 merge
Diffstat (limited to 'indra/newview/llwaterparammanager.cpp')
-rw-r--r--indra/newview/llwaterparammanager.cpp37
1 files changed, 7 insertions, 30 deletions
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index d239347810..4e56be5851 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -57,8 +57,6 @@
#include "curl/curl.h"
-LLWaterParamManager * LLWaterParamManager::sInstance = NULL;
-
LLWaterParamManager::LLWaterParamManager() :
mFogColor(22.f/255.f, 43.f/255.f, 54.f/255.f, 0.0f, 0.0f, "waterFogColor", "WaterFogColor"),
mFogDensity(4, "waterFogDensity", 2),
@@ -246,7 +244,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
{
if (shader->mShaderGroup == LLGLSLShader::SG_WATER)
{
- shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::instance()->getRotatedLightDir().mV);
+ shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV);
shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV);
shader->uniform4fv("waterFogColor", 1, LLDrawPoolWater::sWaterFogColor.mV);
shader->uniform4fv("waterPlane", 1, mWaterPlane.mV);
@@ -256,11 +254,11 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
}
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params");
+static LLFastTimer::DeclareTimer FTM_UPDATE_WATERPARAM("Update Water Params");
void LLWaterParamManager::update(LLViewerCamera * cam)
{
- LLFastTimer ftm(FTM_UPDATE_WLPARAM);
+ LLFastTimer ftm(FTM_UPDATE_WATERPARAM);
// update the shaders and the menu
propagateParameters();
@@ -320,19 +318,6 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
}
}
-// static
-void LLWaterParamManager::initClass(void)
-{
- instance();
-}
-
-// static
-void LLWaterParamManager::cleanupClass(void)
-{
- delete sInstance;
- sInstance = NULL;
-}
-
bool LLWaterParamManager::addParamSet(const std::string& name, LLWaterParamSet& param)
{
// add a new one if not one there already
@@ -439,17 +424,9 @@ F32 LLWaterParamManager::getFogDensity(void)
return fogDensity;
}
-// static
-LLWaterParamManager * LLWaterParamManager::instance()
+// virtual static
+void LLWaterParamManager::initSingleton()
{
- if(NULL == sInstance)
- {
- sInstance = new LLWaterParamManager();
-
- sInstance->loadAllPresets(LLStringUtil::null);
-
- sInstance->getParamSet("Default", sInstance->mCurParams);
- }
-
- return sInstance;
+ loadAllPresets(LLStringUtil::null);
+ getParamSet("Default", mCurParams);
}