diff options
Diffstat (limited to 'indra/newview/llsky.cpp')
-rw-r--r-- | indra/newview/llsky.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 24fea645d4..b779aa0f83 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -285,18 +285,37 @@ LLColor4U LLSky::getFadeColor() const void LLSky::init(const LLVector3 &sun_direction) { + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); + mVOWLSkyp = static_cast<LLVOWLSky*>(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, NULL)); mVOWLSkyp->initSunDirection(sun_direction, LLVector3::zero); - gPipeline.addObject(mVOWLSkyp.get()); + gPipeline.createObject(mVOWLSkyp.get()); + + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, NULL); + + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); + mVOSkyp->initSunDirection(sun_direction, LLVector3()); - gPipeline.addObject((LLViewerObject *)mVOSkyp); + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); + + gPipeline.createObject((LLViewerObject *)mVOSkyp); + + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, NULL); LLVOGround *groundp = mVOGroundp; - gPipeline.addObject((LLViewerObject *)groundp); + gPipeline.createObject((LLViewerObject *)groundp); + + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio")); @@ -309,6 +328,8 @@ void LLSky::init(const LLVector3 &sun_direction) // Get the parameters. mSunDefaultPosition = gSavedSettings.getVector3("SkySunDefaultPosition"); + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition") || mOverrideSimSunPosition) { @@ -319,6 +340,8 @@ void LLSky::init(const LLVector3 &sun_direction) setSunDirection(sun_direction, LLVector3(0.f, 0.f, 0.f)); } + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); mUpdatedThisFrame = TRUE; } |