summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/lldrawpoolbump.cpp1
-rwxr-xr-xindra/newview/lldrawpoolterrain.cpp18
-rwxr-xr-xindra/newview/llnetmap.cpp5
-rwxr-xr-xindra/newview/llstartup.cpp2
-rwxr-xr-xindra/newview/llsurface.cpp12
-rwxr-xr-xindra/newview/lltexturecache.cpp2
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp20
-rwxr-xr-xindra/newview/llviewertexture.cpp15
-rwxr-xr-xindra/newview/llvoavatarself.cpp9
-rwxr-xr-xindra/newview/llvosky.cpp41
-rwxr-xr-xindra/newview/llworld.cpp22
-rwxr-xr-xindra/newview/pipeline.cpp8
12 files changed, 47 insertions, 108 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 49ac82e786..6b4c5cfca1 100755
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1232,7 +1232,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
//if (iter->second->getWidth() != src->getWidth() ||
// iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
- if (src->getData())
{
LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1);
U8* dst_data = dst_image->getData();
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index d7ecacf2e6..c3ec234223 100755
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -88,11 +88,8 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
- if (mTexturep)
- {
- mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN);
- }
-
+ mTexturep->setBoostLevel(LLGLTexture::BOOST_TERRAIN);
+
//gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
@@ -854,18 +851,11 @@ void LLDrawPoolTerrain::renderSimple()
// Pass 1/1
// Stage 0: Base terrain texture pass
- if (mTexturep)
- {
- mTexturep->addTextureStats(1024.f*1024.f);
- }
+ mTexturep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
-
- if (mTexturep)
- {
- gGL.getTexUnit(0)->bind(mTexturep);
- }
+ gGL.getTexUnit(0)->bind(mTexturep);
LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent();
F32 tscale = 1.f/256.f;
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 193e2ea678..08b5eaedbb 100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -798,10 +798,7 @@ void LLNetMap::createObjectImage()
{
mObjectRawImagep = new LLImageRaw(img_size, img_size, 4);
U8* data = mObjectRawImagep->getData();
- if (data)
- {
- memset( data, 0, img_size * img_size * 4 );
- }
+ memset( data, 0, img_size * img_size * 4 );
mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE);
}
setScale(mScale);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 924ba0559c..3b52025a23 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2684,7 +2684,7 @@ void init_start_screen(S32 location_id)
}
}
- if(gStartTexture && gStartTexture.isNull())
+ if(gStartTexture.isNull())
{
gStartTexture = LLViewerTexture::sBlackImagep ;
gStartImageWidth = gStartTexture->getWidth() ;
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index f1b27279e3..93c7f54101 100755
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -233,12 +233,6 @@ void LLSurface::createSTexture()
// GL NOT ACTIVE HERE
LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize, sTextureSize, 3);
U8 *default_texture = raw->getData();
-
- if (!default_texture)
- {
- return;
- }
-
for (S32 i = 0; i < sTextureSize; i++)
{
for (S32 j = 0; j < sTextureSize; j++)
@@ -263,12 +257,6 @@ void LLSurface::createWaterTexture()
// Create the water texture
LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4);
U8 *default_texture = raw->getData();
-
- if (!default_texture)
- {
- return;
- }
-
for (S32 i = 0; i < sTextureSize/2; i++)
{
for (S32 j = 0; j < sTextureSize/2; j++)
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 8d9d2421da..5bc2e971eb 100755
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1937,7 +1937,7 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis
memcpy(mFastCachePadBuffer + sizeof(S32) * 3, &discardlevel, sizeof(S32));
S32 copy_size = w * h * c;
- if(copy_size > 0 && raw->getData()) //valid
+ if(copy_size > 0) //valid
{
copy_size = llmin(copy_size, TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD);
memcpy(mFastCachePadBuffer + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD, raw->getData(), copy_size);
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index fad77bce25..a1c12c5cd6 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -76,13 +76,10 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
//
// Create the base texture.
U8 *raw = mImageRaw->getData();
- if (raw)
+ const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
+ for (S32 i = 0; i < COUNT; i++)
{
- const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
- for (S32 i = 0; i < COUNT; i++)
- {
- raw[i] = 0;
- }
+ raw[i] = 0;
}
//mTexture->setSubImage(mImageRaw, 0, 0, mParcelGridsPerEdge, mParcelGridsPerEdge);
@@ -383,13 +380,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
break;
}
- if (raw)
- {
- raw[pixel_index + 0] = (U8)r;
- raw[pixel_index + 1] = (U8)g;
- raw[pixel_index + 2] = (U8)b;
- raw[pixel_index + 3] = (U8)a;
- }
+ raw[pixel_index + 0] = (U8)r;
+ raw[pixel_index + 1] = (U8)g;
+ raw[pixel_index + 2] = (U8)b;
+ raw[pixel_index + 3] = (U8)a;
pixel_index += OVERLAY_IMG_COMPONENTS;
}
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 6364eee3ec..3da6d33d72 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -337,11 +337,6 @@ void LLViewerTextureManager::init()
const S32 dim = 128;
LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3);
U8* data = image_raw->getData();
-
- if (!data)
- {
- return;
- }
memset(data, 0, dim * dim * 3) ;
LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ;
@@ -378,12 +373,8 @@ void LLViewerTextureManager::init()
#else
LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
#endif
-
- if (LLViewerFetchedTexture::sDefaultImagep)
- {
- LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
- LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ;
- }
+ LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
+ LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ;
LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ;
@@ -699,7 +690,7 @@ bool LLViewerTexture::bindDefaultImage(S32 stage)
if (stage < 0) return false;
bool res = true;
- if (LLViewerFetchedTexture::sDefaultImagep && LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get()))
+ if (LLViewerFetchedTexture::sDefaultImagep.notNull() && (this != LLViewerFetchedTexture::sDefaultImagep.get()))
{
// use default if we've got it
res = gGL.getTexUnit(stage)->bind(LLViewerFetchedTexture::sDefaultImagep);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index ca004962d5..082a85e217 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -818,8 +818,7 @@ void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index)
return;
}
- LLViewerTexture * tx = getTEImage(te);
- if (!tx || tx->getID() == image->getID())
+ if (getTEImage(te)->getID() == image->getID())
{
return;
}
@@ -1699,7 +1698,6 @@ S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 wearable_index)
const LLViewerFetchedTexture* image = dynamic_cast<LLViewerFetchedTexture*>( local_tex_obj->getImage() );
if (type >= 0
&& local_tex_obj->getID() != IMG_DEFAULT_AVATAR
- && image
&& !image->isMissingAsset())
{
return image->getDiscardLevel();
@@ -2038,10 +2036,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const
/*static*/
void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
- if (gAgentAvatarp)
- {
- gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
- }
+ gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
}
void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 467152881e..93f0e50336 100755
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -257,21 +257,18 @@ LLSkyTex::~LLSkyTex()
void LLSkyTex::initEmpty(const S32 tex)
{
U8* data = mImageRaw[tex]->getData();
- if (data)
+ for (S32 i = 0; i < sResolution; ++i)
{
- for (S32 i = 0; i < sResolution; ++i)
+ for (S32 j = 0; j < sResolution; ++j)
{
- 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();
- }
+ 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();
}
}
@@ -282,21 +279,17 @@ void LLSkyTex::create(const F32 brightness)
{
/// Brightness ignored for now.
U8* data = mImageRaw[sCurrent]->getData();
- if (data)
+ for (S32 i = 0; i < sResolution; ++i)
{
- for (S32 i = 0; i < sResolution; ++i)
+ for (S32 j = 0; j < sResolution; ++j)
{
- 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;
- }
+ 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);
}
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 27256af97a..85614f397c 100755
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -101,21 +101,15 @@ LLWorld::LLWorld() :
LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4);
U8 *default_texture = raw->getData();
+ *(default_texture++) = MAX_WATER_COLOR.mV[0];
+ *(default_texture++) = MAX_WATER_COLOR.mV[1];
+ *(default_texture++) = MAX_WATER_COLOR.mV[2];
+ *(default_texture++) = MAX_WATER_COLOR.mV[3];
+
+ mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
+ gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
+ mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
- if (default_texture)
- {
- *(default_texture++) = MAX_WATER_COLOR.mV[0];
- *(default_texture++) = MAX_WATER_COLOR.mV[1];
- *(default_texture++) = MAX_WATER_COLOR.mV[2];
- *(default_texture++) = MAX_WATER_COLOR.mV[3];
- }
-
- if (mDefaultWaterTexturep)
- {
- mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
- gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
- mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
- }
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 0af1143ae8..5da8a78b1b 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4410,11 +4410,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
sUnderWaterRender = FALSE;
}
- if (LLViewerFetchedTexture::sDefaultImagep)
- {
- gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep);
- LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP);
- }
+ gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep);
+ LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP);
+
//////////////////////////////////////////////
//