summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r--indra/newview/lltexturectrl.cpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index a1ab051021..f3530b69db 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -100,7 +100,7 @@ public:
PermissionMask immediate_filter_perm_mask,
PermissionMask non_immediate_filter_perm_mask,
BOOL can_apply_immediately,
- const std::string& fallback_image_name);
+ LLUIImagePtr fallback_image_name);
virtual ~LLFloaterTexturePicker();
@@ -153,7 +153,7 @@ protected:
LLTextureCtrl* mOwner;
LLUUID mImageAssetID; // Currently selected texture
- std::string mFallbackImageName; // What to show if currently selected texture is null.
+ LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null.
LLUUID mWhiteImageAssetID;
LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory.
@@ -183,11 +183,11 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
PermissionMask immediate_filter_perm_mask,
PermissionMask non_immediate_filter_perm_mask,
BOOL can_apply_immediately,
- const std::string& fallback_image_name)
+ LLUIImagePtr fallback_image)
: LLFloater(LLSD()),
mOwner( owner ),
mImageAssetID( owner->getImageAssetID() ),
- mFallbackImageName( fallback_image_name ),
+ mFallbackImage( fallback_image ),
mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ),
mOriginalImageAssetID(owner->getImageAssetID()),
mLabel(label),
@@ -533,11 +533,6 @@ void LLFloaterTexturePicker::draw()
mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES);
mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
}
- else if (!mFallbackImageName.empty())
- {
- mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName);
- mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
- }
if (mTentativeLabel)
{
@@ -578,13 +573,10 @@ void LLFloaterTexturePicker::draw()
// Pump the priority
mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
-
- // Draw Tentative Label over the image
- if( mOwner->getTentative() && !mViewModel->isDirty() )
- {
- mTentativeLabel->setVisible( TRUE );
- drawChild(mTentativeLabel);
- }
+ }
+ else if (!mFallbackImage.isNull())
+ {
+ mFallbackImage->draw(interior);
}
else
{
@@ -593,6 +585,13 @@ void LLFloaterTexturePicker::draw()
// Draw X
gl_draw_x(interior, LLColor4::black );
}
+
+ // Draw Tentative Label over the image
+ if( mOwner->getTentative() && !mViewModel->isDirty() )
+ {
+ mTentativeLabel->setVisible( TRUE );
+ drawChild(mTentativeLabel);
+ }
}
}
@@ -875,7 +874,8 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
mShowLoadingPlaceholder( TRUE ),
mImageAssetID(p.image_id),
mDefaultImageAssetID(p.default_image_id),
- mDefaultImageName(p.default_image_name)
+ mDefaultImageName(p.default_image_name),
+ mFallbackImage(p.fallback_image)
{
setAllowNoTexture(p.allow_no_texture);
setCanApplyImmediately(p.can_apply_immediately);
@@ -1019,7 +1019,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus)
mImmediateFilterPermMask,
mNonImmediateFilterPermMask,
mCanApplyImmediately,
- mFallbackImageName);
+ mFallbackImage);
mFloaterHandle = floaterp->getHandle();
@@ -1223,12 +1223,6 @@ void LLTextureCtrl::draw()
mTexturep = texture;
}
- else if (!mFallbackImageName.empty())
- {
- // Show fallback image.
- mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName);
- mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
- }
else//mImageAssetID == LLUUID::null
{
mTexturep = NULL;
@@ -1252,6 +1246,10 @@ void LLTextureCtrl::draw()
gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep);
mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
}
+ else if (!mFallbackImage.isNull())
+ {
+ mFallbackImage->draw(interior);
+ }
else
{
gl_rect_2d( interior, LLColor4::grey, TRUE );