summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorVaalith <none@none>2012-04-10 09:28:47 -0400
committerVaalith <none@none>2012-04-10 09:28:47 -0400
commit8d4c6771fdbea274eabc7a2e2606b3b77952cb4a (patch)
tree304efa629bbddcee190f83c49f098733a3714201 /indra
parent4ff8067aa8f5117fa83e1a971b5bbc0c8fc033b2 (diff)
storm-64: One more toast on failure to verify initial image, and changed a bool to enum
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lllocalbitmaps.cpp21
-rw-r--r--indra/newview/lllocalbitmaps.h16
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml9
3 files changed, 34 insertions, 12 deletions
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 10c3b20f63..459e52c4f4 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -116,15 +116,15 @@ LLLocalBitmap::LLLocalBitmap(std::string filename)
}
/* next phase of unit creation is nearly the same as an update cycle.
- true means the unit's update is running for the first time so it will not check
- for current usage nor will it attempt to replace the old, non existent image */
- mValid = updateSelf(true);
+ we're running updateSelf as a special case with the optional UT_FIRSTUSE
+ which omits the parts associated with removing the outdated texture */
+ mValid = updateSelf(UT_FIRSTUSE);
}
LLLocalBitmap::~LLLocalBitmap()
{
// replace IDs with defaults, if set to do so.
- if(LL_LOCAL_REPLACE_ON_DEL)
+ if(LL_LOCAL_REPLACE_ON_DEL && mValid) // fix for STORM-1837
{
replaceIDs(mWorldID, IMG_DEFAULT);
LLLocalBitmapMgr::doRebake();
@@ -167,7 +167,7 @@ bool LLLocalBitmap::getValid()
}
/* update functions */
-bool LLLocalBitmap::updateSelf(bool first_update)
+bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
{
bool updated = false;
@@ -189,7 +189,7 @@ bool LLLocalBitmap::updateSelf(bool first_update)
{
// decode is successful, we can safely proceed.
LLUUID old_id = LLUUID::null;
- if (!first_update && !mWorldID.isNull())
+ if (!(optional_firstupdate == UT_FIRSTUSE) && !mWorldID.isNull())
{
old_id = mWorldID;
}
@@ -205,7 +205,7 @@ bool LLLocalBitmap::updateSelf(bool first_update)
gTextureList.addImage(texture);
- if (!first_update)
+ if (!optional_firstupdate == UT_FIRSTUSE)
{
// seek out everything old_id uses and replace it with mWorldID
replaceIDs(old_id, mWorldID);
@@ -807,6 +807,13 @@ bool LLLocalBitmapMgr::addUnit()
}
else
{
+ llwarns << "Attempted to add invalid or unreadable image file, attempt cancelled.\n"
+ << "Filename: " << filename << llendl;
+
+ LLSD notif_args;
+ notif_args["FNAME"] = filename;
+ LLNotificationsUtil::add("LocalBitmapsVerifyFail", notif_args);
+
delete unit;
unit = NULL;
}
diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h
index c6d05c1763..7a23c7ef6e 100644
--- a/indra/newview/lllocalbitmaps.h
+++ b/indra/newview/lllocalbitmaps.h
@@ -39,7 +39,6 @@ class LLLocalBitmap
public: /* main */
LLLocalBitmap(std::string filename);
~LLLocalBitmap();
- bool updateSelf(bool first_update = false);
public: /* accessors */
std::string getFilename();
@@ -48,18 +47,25 @@ class LLLocalBitmap
LLUUID getWorldID();
bool getValid();
- private: /* maintenance */
+ public: /* self update public section */
+ enum EUpdateType
+ {
+ UT_FIRSTUSE,
+ UT_REGUPDATE
+ };
+
+ bool updateSelf(EUpdateType = UT_REGUPDATE);
+
+ private: /* self update private section */
bool decodeBitmap(LLPointer<LLImageRaw> raw);
void replaceIDs(LLUUID old_id, LLUUID new_id);
-
- private: /* id replacement */
std::vector<LLViewerObject*> prepUpdateObjects(LLUUID old_id);
void updateUserPrims(LLUUID old_id, LLUUID new_id);
void updateUserSculpts(LLUUID old_id, LLUUID new_id);
void updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableType::EType type);
LLVOAvatarDefines::ETextureIndex getTexIndex(LLWearableType::EType type, LLVOAvatarDefines::EBakedTextureIndex baked_texind);
- private: /* enums */
+ private: /* private enums */
enum ELinkStatus
{
LS_ON,
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e9175e2390..9cad5b8586 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7713,5 +7713,14 @@ Disabling future updates for this file.
[FNAME] could not be opened or decoded for [NRETRIES] attempts, and is now considered broken.
Disabling future updates for this file.
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="LocalBitmapsVerifyFail"
+ persist="true"
+ type="notify">
+Attempted to add an invalid or unreadable image file [FNAME] which could not be opened or decoded.
+Attempt cancelled.
+ </notification>
</notifications>