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.cpp81
1 files changed, 65 insertions, 16 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 5381f8291a..6088c31559 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -292,7 +292,11 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
{
BOOL handled = FALSE;
- if ((cargo_type == DAD_TEXTURE) || (cargo_type == DAD_MESH))
+ bool is_mesh = false;
+#if LL_MESH_ENABLED
+ is_mesh = cargo_type == DAD_MESH;
+#endif
+ if ((cargo_type == DAD_TEXTURE) || is_mesh)
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
@@ -1137,6 +1141,20 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
}
}
+void LLTextureCtrl::setImageAssetName(const std::string& name)
+{
+ LLPointer<LLUIImage> imagep = LLUI::getUIImage(name);
+ if(imagep)
+ {
+ LLViewerFetchedTexture* pTexture = dynamic_cast<LLViewerFetchedTexture*>(imagep->getImage().get());
+ if(pTexture)
+ {
+ LLUUID id = pTexture->getID();
+ setImageAssetID(id);
+ }
+ }
+}
+
void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id )
{
if( mImageAssetID != asset_id )
@@ -1163,8 +1181,12 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask,
// returns true, then the cast was valid, and we can perform
// the third test without problems.
LLInventoryItem* item = (LLInventoryItem*)cargo_data;
+ bool is_mesh = false;
+#if LL_MESH_ENABLED
+ is_mesh = cargo_type == DAD_MESH;
+#endif
if (getEnabled() &&
- ((cargo_type == DAD_TEXTURE) || (cargo_type == DAD_MESH)) &&
+ ((cargo_type == DAD_TEXTURE) || is_mesh) &&
allowDrop(item))
{
if (drop)
@@ -1250,25 +1272,52 @@ void LLTextureCtrl::draw()
mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() );
-
// Show "Loading..." string on the top left corner while this texture is loading.
// Using the discard level, do not show the string if the texture is almost but not
// fully loaded.
- if ( mTexturep.notNull() &&
- (!mTexturep->isFullyLoaded()) &&
- (mShowLoadingPlaceholder == TRUE) &&
- (mTexturep->getDiscardLevel() != 1) &&
- (mTexturep->getDiscardLevel() != 0))
+ if (mTexturep.notNull() &&
+ (!mTexturep->isFullyLoaded()) &&
+ (mShowLoadingPlaceholder == TRUE))
{
+ U32 v_offset = 25;
LLFontGL* font = LLFontGL::getFontSansSerif();
- font->renderUTF8(
- mLoadingPlaceholderString, 0,
- llfloor(interior.mLeft+3),
- llfloor(interior.mTop-25),
- LLColor4::white,
- LLFontGL::LEFT,
- LLFontGL::BASELINE,
- LLFontGL::DROP_SHADOW);
+
+ // Don't show as loaded if the texture is almost fully loaded (i.e. discard1) unless god
+ if ((mTexturep->getDiscardLevel() > 1) || gAgent.isGodlike())
+ {
+ font->renderUTF8(
+ mLoadingPlaceholderString,
+ 0,
+ llfloor(interior.mLeft+3),
+ llfloor(interior.mTop-v_offset),
+ LLColor4::white,
+ LLFontGL::LEFT,
+ LLFontGL::BASELINE,
+ LLFontGL::DROP_SHADOW);
+ }
+
+ // Optionally show more detailed information.
+ if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
+ {
+ LLFontGL* font = LLFontGL::getFontSansSerif();
+ std::string tdesc;
+ // Show what % the texture has loaded (0 to 100%, 100 is highest), and what level of detail (5 to 0, 0 is best).
+
+ v_offset += 12;
+ tdesc = llformat(" PK : %d%%", U32(mTexturep->getDownloadProgress()*100.0));
+ font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset),
+ LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
+
+ v_offset += 12;
+ tdesc = llformat(" LVL: %d", mTexturep->getDiscardLevel());
+ font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset),
+ LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
+
+ v_offset += 12;
+ tdesc = llformat(" ID : %s...", (mImageAssetID.asString().substr(0,7)).c_str());
+ font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset),
+ LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
+ }
}
LLUICtrl::draw();