diff options
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rwxr-xr-x | indra/newview/llvosky.cpp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 93f0e50336..467152881e 100755 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -257,18 +257,21 @@ LLSkyTex::~LLSkyTex() void LLSkyTex::initEmpty(const S32 tex) { U8* data = mImageRaw[tex]->getData(); - for (S32 i = 0; i < sResolution; ++i) + if (data) { - for (S32 j = 0; j < sResolution; ++j) + for (S32 i = 0; i < sResolution; ++i) { - const S32 basic_offset = (i * sResolution + j); - S32 offset = basic_offset * sComponents; - data[offset] = 0; - data[offset+1] = 0; - data[offset+2] = 0; - data[offset+3] = 255; - - mSkyData[basic_offset].setToBlack(); + for (S32 j = 0; j < sResolution; ++j) + { + const S32 basic_offset = (i * sResolution + j); + S32 offset = basic_offset * sComponents; + data[offset] = 0; + data[offset+1] = 0; + data[offset+2] = 0; + data[offset+3] = 255; + + mSkyData[basic_offset].setToBlack(); + } } } @@ -279,17 +282,21 @@ void LLSkyTex::create(const F32 brightness) { /// Brightness ignored for now. U8* data = mImageRaw[sCurrent]->getData(); - for (S32 i = 0; i < sResolution; ++i) + if (data) { - for (S32 j = 0; j < sResolution; ++j) + for (S32 i = 0; i < sResolution; ++i) { - const S32 basic_offset = (i * sResolution + j); - S32 offset = basic_offset * sComponents; - U32* pix = (U32*)(data + offset); - LLColor4U temp = LLColor4U(mSkyData[basic_offset]); - *pix = temp.mAll; + for (S32 j = 0; j < sResolution; ++j) + { + const S32 basic_offset = (i * sResolution + j); + S32 offset = basic_offset * sComponents; + U32* pix = (U32*)(data + offset); + LLColor4U temp = LLColor4U(mSkyData[basic_offset]); + *pix = temp.mAll; + } } } + createGLImage(sCurrent); } |