summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r--indra/newview/llvosky.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 3ec043eb39..c3366cad90 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -213,7 +213,7 @@ void LLSkyTex::init()
for (S32 i = 0; i < 2; ++i)
{
mImageGL[i] = new LLImageGL(FALSE);
- mImageGL[i]->setClamp(TRUE, TRUE);
+ mImageGL[i]->setAddressMode(LLTexUnit::TAM_CLAMP);
mImageRaw[i] = new LLImageRaw(sResolution, sResolution, sComponents);
initEmpty(i);
@@ -231,7 +231,7 @@ void LLSkyTex::restoreGL()
for (S32 i = 0; i < 2; i++)
{
mImageGL[i] = new LLImageGL(FALSE);
- mImageGL[i]->setClamp(TRUE, TRUE);
+ mImageGL[i]->setAddressMode(LLTexUnit::TAM_CLAMP);
}
}
@@ -290,7 +290,7 @@ void LLSkyTex::create(const F32 brightness)
void LLSkyTex::createGLImage(S32 which)
{
mImageGL[which]->createGLTexture(0, mImageRaw[which]);
- mImageGL[which]->setClamp(TRUE, TRUE);
+ mImageGL[which]->setAddressMode(LLTexUnit::TAM_CLAMP);
}
void LLSkyTex::bindTexture(BOOL curr)
@@ -377,11 +377,12 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
mMoon.setIntensity(0.1f * SUN_INTENSITY);
mSunTexturep = gImageList.getImage(gSunTextureID, TRUE, TRUE);
- mSunTexturep->setClamp(TRUE, TRUE);
+ mSunTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
mMoonTexturep = gImageList.getImage(gMoonTextureID, TRUE, TRUE);
- mMoonTexturep->setClamp(TRUE, TRUE);
+ mMoonTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
mBloomTexturep = gImageList.getImage(IMG_BLOOM1);
- mBloomTexturep->setClamp(TRUE, TRUE);
+ mBloomTexturep->setNoDelete() ;
+ mBloomTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
mHeavenlyBodyUpdated = FALSE ;
}
@@ -447,6 +448,7 @@ void LLVOSky::initCubeMap()
mCubeMap = new LLCubeMap();
mCubeMap->init(images);
}
+ gGL.getTexUnit(0)->disable();
}
@@ -471,11 +473,12 @@ void LLVOSky::restoreGL()
mSkyTex[i].restoreGL();
}
mSunTexturep = gImageList.getImage(gSunTextureID, TRUE, TRUE);
- mSunTexturep->setClamp(TRUE, TRUE);
+ mSunTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
mMoonTexturep = gImageList.getImage(gMoonTextureID, TRUE, TRUE);
- mMoonTexturep->setClamp(TRUE, TRUE);
+ mMoonTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
mBloomTexturep = gImageList.getImage(IMG_BLOOM1);
- mBloomTexturep->setClamp(TRUE, TRUE);
+ mBloomTexturep->setNoDelete() ;
+ mBloomTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
calcAtmospherics();
@@ -1153,6 +1156,7 @@ BOOL LLVOSky::updateSky()
images.push_back(mShinyTex[side].getImageRaw(TRUE));
}
mCubeMap->init(images);
+ gGL.getTexUnit(0)->disable();
}
gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
@@ -2024,7 +2028,7 @@ void LLVOSky::updateFog(const F32 distance)
const BOOL hide_clip_plane = TRUE;
LLColor4 target_fog(0.f, 0.2f, 0.5f, 0.f);
- const F32 water_height = gAgent.getRegion()->getWaterHeight();
+ const F32 water_height = gAgent.getRegion() ? gAgent.getRegion()->getWaterHeight() : 0.f;
// LLWorld::getInstance()->getWaterHeight();
F32 camera_height = gAgent.getCameraPositionAgent().mV[2];