diff options
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r-- | indra/newview/llface.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index b2da5bb9f8..ad1df2b0e3 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -308,6 +308,11 @@ void LLFace::setDiffuseMap(LLViewerTexture* tex) setTexture(LLRender::DIFFUSE_MAP, tex); } +void LLFace::setAlternateDiffuseMap(LLViewerTexture* tex) +{ + setTexture(LLRender::ALTERNATE_DIFFUSE_MAP, tex); +} + void LLFace::setNormalMap(LLViewerTexture* tex) { setTexture(LLRender::NORMAL_MAP, tex); @@ -386,16 +391,20 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture) return; } - llassert(mTexture[ch].notNull()); - - new_texture->addTextureStats(mTexture[ch]->getMaxVirtualSize()) ; + if (mTexture[ch].notNull()) + { + new_texture->addTextureStats(mTexture[ch]->getMaxVirtualSize()) ; + } if (ch == LLRender::DIFFUSE_MAP) { - getViewerObject()->changeTEImage(mTEOffset, new_texture) ; + if (getViewerObject()) + { + getViewerObject()->changeTEImage(mTEOffset, new_texture); + } } - setTexture(ch, new_texture) ; + setTexture(ch, new_texture); dirtyTexture(); } @@ -1726,7 +1735,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, // that emboss mapping always shows up on the upward faces of cubes when // it's noon (since a lot of builders build with the sun forced to noon). LLVector3 sun_ray = gSky.mVOSkyp->mBumpSunDir; - LLVector3 moon_ray = gSky.getMoonDirection(); + LLVector3 moon_ray = gSky.mVOSkyp->getMoon().getDirection(); LLVector3& primary_light_ray = (sun_ray.mV[VZ] > 0) ? sun_ray : moon_ray; bump_s_primary_light_ray.load3((offset_multiple * s_scale * primary_light_ray).mV); |