diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llerror.cpp | 13 | ||||
-rw-r--r-- | indra/llcommon/llfile.cpp | 4 | ||||
-rw-r--r-- | indra/llcommon/llfile.h | 2 | ||||
-rw-r--r-- | indra/llcommon/tests/llerror_test.cpp | 4 | ||||
-rw-r--r-- | indra/llmessage/llxfer_file.cpp | 6 | ||||
-rw-r--r-- | indra/llmessage/llxfermanager.cpp | 2 | ||||
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 6 | ||||
-rw-r--r-- | indra/newview/llavatarrendernotifier.cpp | 259 | ||||
-rw-r--r-- | indra/newview/llavatarrendernotifier.h | 34 | ||||
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 41 | ||||
-rw-r--r-- | indra/newview/llpresetsmanager.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 31 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/mime_types.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 12 |
20 files changed, 309 insertions, 144 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 5ed348e13c..6a62860c3f 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -921,11 +921,6 @@ namespace std::ostringstream message_stream; - if (show_location && (r->wantsLocation() || level == LLError::LEVEL_ERROR || s->mPrintLocation)) - { - message_stream << site.mLocationString << " "; - } - if (show_time && r->wantsTime() && s->mTimeFunction != NULL) { message_stream << s->mTimeFunction() << " "; @@ -933,17 +928,17 @@ namespace if (show_level && r->wantsLevel()) { - message_stream << site.mLevelString; + message_stream << site.mLevelString << " "; } if (show_tags && r->wantsTags()) { message_stream << site.mTagString; } - if ((show_level && r->wantsLevel())|| - (show_tags && r->wantsTags())) + + if (show_location && (r->wantsLocation() || level == LLError::LEVEL_ERROR || s->mPrintLocation)) { - message_stream << " "; + message_stream << site.mLocationString << " "; } if (show_function && r->wantsFunctionName()) diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 873a7bce25..7b559861bb 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -239,7 +239,7 @@ int LLFile::close(LLFILE * file) } -int LLFile::remove(const std::string& filename) +int LLFile::remove(const std::string& filename, int supress_error) { #if LL_WINDOWS std::string utf8filename = filename; @@ -248,7 +248,7 @@ int LLFile::remove(const std::string& filename) #else int rc = ::remove(filename.c_str()); #endif - return warnif("remove", filename, rc); + return warnif("remove", filename, rc, supress_error); } int LLFile::rename(const std::string& filename, const std::string& newname) diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 3e25228aeb..d8f84daf2b 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -72,7 +72,7 @@ public: static int mkdir(const std::string& filename, int perms = 0700); static int rmdir(const std::string& filename); - static int remove(const std::string& filename); + static int remove(const std::string& filename, int supress_error = 0); static int rename(const std::string& filename,const std::string& newname); static bool copy(const std::string from, const std::string to); diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 8bace8ac41..20de205454 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -564,9 +564,9 @@ namespace tut function; writeReturningLocationAndFunction(location, function); - ensure_equals("order is location time type function message", + ensure_equals("order is time location type function message", message(0), - location + roswell() + " INFO: " + function + ": apple"); + roswell() + " INFO: " + location + function + ": apple"); } template<> template<> diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp index 257a13f277..8e2ed890e7 100644 --- a/indra/llmessage/llxfer_file.cpp +++ b/indra/llmessage/llxfer_file.cpp @@ -98,12 +98,12 @@ void LLXfer_File::cleanup () mFp = NULL; } - LLFile::remove(mTempFilename); + LLFile::remove(mTempFilename, ENOENT); if (mDeleteLocalOnCompletion) { LL_DEBUGS() << "Removing file: " << mLocalFilename << LL_ENDL; - LLFile::remove(mLocalFilename); + LLFile::remove(mLocalFilename, ENOENT); } else { @@ -321,7 +321,7 @@ S32 LLXfer_File::processEOF() mCallbackResult = flushval; } - LLFile::remove(mLocalFilename); + LLFile::remove(mLocalFilename, ENOENT); if (!mCallbackResult) { diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index 0ab67b8dda..0232a6e802 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -441,7 +441,7 @@ void LLXferManager::requestFile(const std::string& local_filename, if(delete_remote_on_completion && (remote_filename.substr(remote_filename.length()-4) == ".tmp")) { - LLFile::remove(local_filename); + LLFile::remove(local_filename, ENOENT); } ((LLXfer_File *)xferp)->initializeRequest( getNextID(), diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 8071d716da..031befe63a 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -851,6 +851,8 @@ struct ModelSort bool LLDAELoader::OpenFile(const std::string& filename) { + setLoadState( READING_FILE ); + //no suitable slm exists, load from the .dae file DAE dae; domCOLLADA* dom; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 797b866724..a8bd5c7183 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10159,16 +10159,16 @@ <key>Value</key> <integer>6</integer> </map> - <key>RenderHUDTexturesVirtualMemoryWarning</key> + <key>RenderHUDTexturesMemoryWarning</key> <map> <key>Comment</key> - <string>Viewer will warn user about HUD textures using memory above this value (Virtual memory, in pixels)</string> + <string>Viewer will warn user about HUD textures using memory above this value (in bytes)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>U32</string> <key>Value</key> - <integer>10000000</integer> + <integer>32000000</integer> </map> <key>RenderAutoMuteSurfaceAreaLimit</key> <map> diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index f7a1ef1621..94584a623b 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -38,6 +38,7 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "llnotificationtemplate.h" +#include "llslurl.h" #include "lltimer.h" #include "llvoavatarself.h" #include "llviewercontrol.h" @@ -54,7 +55,7 @@ static const U32 OVER_LIMIT_UPDATE_DELAY = 70; static const U32 WARN_HUD_OBJECTS_LIMIT = 1000; static const U32 WARN_HUD_TEXTURES_LIMIT = 200; static const U32 WARN_HUD_OVERSIZED_TEXTURES_LIMIT = 6; -static const U32 WARN_HUD_TEXTURE_MEMORY_LIMIT = 10000000; // in pixels +static const U32 WARN_HUD_TEXTURE_MEMORY_LIMIT = 32000000; // in bytes LLAvatarRenderNotifier::LLAvatarRenderNotifier() : @@ -271,7 +272,17 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // LLHUDRenderNotifier -LLHUDRenderNotifier::LLHUDRenderNotifier() +static const char* e_hud_messages[] = +{ + "hud_render_textures_warning", + "hud_render_cramped_warning", + "hud_render_heavy_textures_warning", + "hud_render_cost_warning", + "hud_render_memory_warning", +}; + +LLHUDRenderNotifier::LLHUDRenderNotifier() : +mReportedHUDWarning(WARN_NONE) { } @@ -279,118 +290,200 @@ LLHUDRenderNotifier::~LLHUDRenderNotifier() { } -void LLHUDRenderNotifier::updateNotificationHUD(LLHUDComplexity new_complexity) +void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity) { - if (!isAgentAvatarValid()) + if (!isAgentAvatarValid() || !gAgentWearables.areWearablesLoaded()) { // data not ready. return; } - static const char* hud_memory = "hud_render_memory_warning"; - static const char* hud_cost = "hud_render_cost_warning"; - static const char* hud_heavy = "hud_render_heavy_textures_warning"; - static const char* hud_cramped = "hud_render_cramped_warning"; - static const char* hud_textures = "hud_render_textures_warning"; + // TODO: + // Find a way to show message with list of issues, but without making it too large + // and intrusive. - static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0U); // ties max HUD cost to avatar cost - static LLCachedControl<U32> max_objects_count(gSavedSettings, "RenderHUDObjectsWarning", WARN_HUD_OBJECTS_LIMIT); - static LLCachedControl<U32> max_textures_count(gSavedSettings, "RenderHUDTexturesWarning", WARN_HUD_TEXTURES_LIMIT); - static LLCachedControl<U32> max_oversized_count(gSavedSettings, "RenderHUDOversizedTexturesWarning", WARN_HUD_OVERSIZED_TEXTURES_LIMIT); - static LLCachedControl<U32> max_texture_memory(gSavedSettings, "RenderHUDTexturesVirtualMemoryWarning", WARN_HUD_TEXTURE_MEMORY_LIMIT); + LLHUDComplexity new_total_complexity; + LLHUDComplexity report_complexity; - if (mHUDPopUpDelayTimer.hasExpired()) + hud_complexity_list_t::iterator iter = complexity.begin(); + hud_complexity_list_t::iterator end = complexity.end(); + EWarnLevel warning_level = WARN_NONE; + for (; iter != end; ++iter) { - // Show warning with highest importance (5m delay between warnings by default) - // TODO: - // Consider showing message with list of issues. - // For now shows one after another if update arrives and timer expired, so - // consider showing only one most important or consider triggering not - // only in case of update - if (mReportedHUDComplexity.texturesSizeTotal < new_complexity.texturesSizeTotal - && new_complexity.texturesSizeTotal > max_texture_memory) + LLHUDComplexity object_complexity = *iter; + EWarnLevel object_level = getWarningType(object_complexity, report_complexity); + if (object_level >= 0) { - displayHUDNotification(hud_memory); - LL_DEBUGS("HUDdetail") << "HUD memory usage over limit," - << " was " << mReportedHUDComplexity.texturesSizeTotal - << " is " << new_complexity.texturesSizeTotal << LL_ENDL; - mReportedHUDComplexity.texturesSizeTotal = new_complexity.texturesSizeTotal; + warning_level = object_level; + report_complexity = object_complexity; } - else if ((mReportedHUDComplexity.objectsCost < new_complexity.objectsCost - || mReportedHUDComplexity.texturesCost < new_complexity.texturesCost) - && max_render_cost > 0 - && new_complexity.objectsCost + new_complexity.texturesCost > max_render_cost) - { - LL_DEBUGS("HUDdetail") << "HUD complexity over limit," - << " HUD textures cost: " << new_complexity.texturesCost - << " HUD objects cost: " << new_complexity.objectsCost << LL_ENDL; - displayHUDNotification(hud_cost); - mReportedHUDComplexity.objectsCost = new_complexity.objectsCost; - mReportedHUDComplexity.texturesCost = new_complexity.texturesCost; - } - else if (mReportedHUDComplexity.largeTexturesCount < new_complexity.largeTexturesCount - && new_complexity.largeTexturesCount > max_oversized_count) - { - LL_DEBUGS("HUDdetail") << "HUD contains to many large textures: " - << new_complexity.largeTexturesCount << LL_ENDL; - displayHUDNotification(hud_heavy); - mReportedHUDComplexity.largeTexturesCount = new_complexity.largeTexturesCount; - } - else if (mReportedHUDComplexity.texturesCount < new_complexity.texturesCount - && new_complexity.texturesCount > max_textures_count) - { - LL_DEBUGS("HUDdetail") << "HUD contains too many textures: " - << new_complexity.texturesCount << LL_ENDL; - displayHUDNotification(hud_cramped); - mReportedHUDComplexity.texturesCount = new_complexity.texturesCount; - } - else if (mReportedHUDComplexity.objectsCount < new_complexity.objectsCount - && new_complexity.objectsCount > max_objects_count) + new_total_complexity.objectsCost += object_complexity.objectsCost; + new_total_complexity.objectsCount += object_complexity.objectsCount; + new_total_complexity.texturesCost += object_complexity.texturesCost; + new_total_complexity.texturesCount += object_complexity.texturesCount; + new_total_complexity.largeTexturesCount += object_complexity.largeTexturesCount; + new_total_complexity.texturesMemoryTotal += object_complexity.texturesMemoryTotal; + } + + if (mHUDPopUpDelayTimer.hasExpired() || isNotificationVisible()) + { + if (warning_level >= 0) { - LL_DEBUGS("HUDdetail") << "HUD contains too many objects: " - << new_complexity.objectsCount << LL_ENDL; - displayHUDNotification(hud_textures); - mReportedHUDComplexity.objectsCount = new_complexity.objectsCount; + // Display info about most complex HUD object + // make sure it shown only once unless object's complexity or object itself changed + if (mReportedHUDComplexity.objectId != report_complexity.objectId + || mReportedHUDWarning != warning_level) + { + displayHUDNotification(warning_level, report_complexity.objectId, report_complexity.objectName, report_complexity.jointName); + mReportedHUDComplexity = report_complexity; + mReportedHUDWarning = warning_level; + } } else { - // all warnings displayed, just store everything so that we will - // be able to reduce values and show warnings again later - mReportedHUDComplexity = new_complexity; + // Check if total complexity is above threshold and above previous warning + // Show warning with highest importance (5m delay between warnings by default) + if (!mReportedHUDComplexity.objectId.isNull()) + { + mReportedHUDComplexity.reset(); + mReportedHUDWarning = WARN_NONE; + } + + warning_level = getWarningType(new_total_complexity, mReportedHUDComplexity); + if (warning_level >= 0 && mReportedHUDWarning != warning_level) + { + displayHUDNotification(warning_level); + } + mReportedHUDComplexity = new_total_complexity; + mReportedHUDWarning = warning_level; } } + else if (warning_level >= 0) + { + LL_DEBUGS("HUDdetail") << "HUD individual warning postponed" << LL_ENDL; + } + + if (mLatestHUDComplexity.objectsCost != new_total_complexity.objectsCost + || mLatestHUDComplexity.objectsCount != new_total_complexity.objectsCount + || mLatestHUDComplexity.texturesCost != new_total_complexity.texturesCost + || mLatestHUDComplexity.texturesCount != new_total_complexity.texturesCount + || mLatestHUDComplexity.largeTexturesCount != new_total_complexity.largeTexturesCount + || mLatestHUDComplexity.texturesMemoryTotal != new_total_complexity.texturesMemoryTotal) + { + LL_INFOS("HUDdetail") << "HUD textures count: " << new_total_complexity.texturesCount + << " HUD textures cost: " << new_total_complexity.texturesCost + << " Large textures: " << new_total_complexity.largeTexturesCount + << " HUD objects cost: " << new_total_complexity.objectsCost + << " HUD objects count: " << new_total_complexity.objectsCount << LL_ENDL; + + mLatestHUDComplexity = new_total_complexity; + } +} + +bool LLHUDRenderNotifier::isNotificationVisible() +{ + return mHUDNotificationPtr != NULL && mHUDNotificationPtr->isActive(); +} + +// private static +LLHUDRenderNotifier::EWarnLevel LLHUDRenderNotifier::getWarningType(LLHUDComplexity object_complexity, LLHUDComplexity cmp_complexity) +{ + static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0U); // ties max HUD cost to avatar cost + static LLCachedControl<U32> max_objects_count(gSavedSettings, "RenderHUDObjectsWarning", WARN_HUD_OBJECTS_LIMIT); + static LLCachedControl<U32> max_textures_count(gSavedSettings, "RenderHUDTexturesWarning", WARN_HUD_TEXTURES_LIMIT); + static LLCachedControl<U32> max_oversized_count(gSavedSettings, "RenderHUDOversizedTexturesWarning", WARN_HUD_OVERSIZED_TEXTURES_LIMIT); + static LLCachedControl<U32> max_texture_memory(gSavedSettings, "RenderHUDTexturesMemoryWarning", WARN_HUD_TEXTURE_MEMORY_LIMIT); + + if (cmp_complexity.texturesMemoryTotal < object_complexity.texturesMemoryTotal + && object_complexity.texturesMemoryTotal > (F64Bytes)max_texture_memory) + { + // Note: Memory might not be accurate since texture is still loading or discard level changes + + LL_DEBUGS("HUDdetail") << "HUD " << object_complexity.objectName << " memory usage over limit, " + << " was " << cmp_complexity.texturesMemoryTotal + << " is " << object_complexity.texturesMemoryTotal << LL_ENDL; + + return WARN_MEMORY; + } + else if ((cmp_complexity.objectsCost < object_complexity.objectsCost + || cmp_complexity.texturesCost < object_complexity.texturesCost) + && max_render_cost > 0 + && object_complexity.objectsCost + object_complexity.texturesCost > max_render_cost) + { + LL_DEBUGS("HUDdetail") << "HUD " << object_complexity.objectName << " complexity over limit," + << " HUD textures cost: " << object_complexity.texturesCost + << " HUD objects cost: " << object_complexity.objectsCost << LL_ENDL; - if (mLatestHUDComplexity.objectsCost != new_complexity.objectsCost - || mLatestHUDComplexity.objectsCount != new_complexity.objectsCount - || mLatestHUDComplexity.texturesCost != new_complexity.texturesCost - || mLatestHUDComplexity.texturesCount != new_complexity.texturesCount - || mLatestHUDComplexity.largeTexturesCount != new_complexity.largeTexturesCount - || mLatestHUDComplexity.texturesSizeTotal != new_complexity.texturesSizeTotal) + return WARN_COST; + } + else if (cmp_complexity.largeTexturesCount < object_complexity.largeTexturesCount + && object_complexity.largeTexturesCount > max_oversized_count) { - LL_INFOS("HUDdetail") << "HUD textures count: " << new_complexity.texturesCount - << " HUD textures cost: " << new_complexity.texturesCost - << " Large textures: " << new_complexity.largeTexturesCount - << " HUD objects cost: " << new_complexity.objectsCost - << " HUD objects count: " << new_complexity.objectsCount << LL_ENDL; + LL_DEBUGS("HUDdetail") << "HUD " << object_complexity.objectName << " contains to many large textures: " + << object_complexity.largeTexturesCount << LL_ENDL; - mLatestHUDComplexity = new_complexity; + return WARN_HEAVY; } - + else if (cmp_complexity.texturesCount < object_complexity.texturesCount + && object_complexity.texturesCount > max_textures_count) + { + LL_DEBUGS("HUDdetail") << "HUD " << object_complexity.objectName << " contains too many textures: " + << object_complexity.texturesCount << LL_ENDL; + + return WARN_CRAMPED; + } + else if (cmp_complexity.objectsCount < object_complexity.objectsCount + && object_complexity.objectsCount > max_objects_count) + { + LL_DEBUGS("HUDdetail") << "HUD " << object_complexity.objectName << " contains too many objects: " + << object_complexity.objectsCount << LL_ENDL; + + return WARN_TEXTURES; + } + return WARN_NONE; } -void LLHUDRenderNotifier::displayHUDNotification(const char* message) +void LLHUDRenderNotifier::displayHUDNotification(EWarnLevel warn_type, LLUUID obj_id, std::string obj_name, std::string joint_name) { static LLCachedControl<U32> pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); static LLCachedControl<U32> expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); - LLSD args; - args["HUD_REASON"] = LLTrans::getString(message); + // Since we need working "ignoretext" there is no other way but to + // use single notification while constructing it from multiple pieces + LLSD reason_args; + if (obj_id.isNull()) + { + reason_args["HUD_DETAILS"] = LLTrans::getString("hud_description_total"); + } + else + { + if (obj_name.empty()) + { + LL_WARNS("HUDdetail") << "Object name not assigned" << LL_ENDL; + } + if (joint_name.empty()) + { + std::string verb = "select?name=" + LLURI::escape(obj_name); + reason_args["HUD_DETAILS"] = LLSLURL("inventory", obj_id, verb.c_str()).getSLURLString(); + } + else + { + LLSD object_args; + std::string verb = "select?name=" + LLURI::escape(obj_name); + object_args["OBJ_NAME"] = LLSLURL("inventory", obj_id, verb.c_str()).getSLURLString(); + object_args["JNT_NAME"] = LLTrans::getString(joint_name); + reason_args["HUD_DETAILS"] = LLTrans::getString("hud_name_with_joint", object_args); + } + } + + LLSD msg_args; + msg_args["HUD_REASON"] = LLTrans::getString(e_hud_messages[warn_type], reason_args); - LLNotifications::instance().add(LLNotification::Params() + mHUDNotificationPtr = LLNotifications::instance().add(LLNotification::Params() .name("HUDComplexityWarning") .expiry(expire_date) - .substitutions(args)); + .substitutions(msg_args)); mHUDPopUpDelayTimer.resetWithExpiry(pop_up_delay); } diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 959bebef02..a169baef40 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -37,21 +37,32 @@ struct LLHUDComplexity { LLHUDComplexity() { + reset(); + } + void reset() + { + objectId = LLUUID::null; + objectName = ""; objectsCost = 0; objectsCount = 0; texturesCost = 0; texturesCount = 0; largeTexturesCount = 0; - texturesSizeTotal = 0; + texturesMemoryTotal = (F64Bytes)0; } + LLUUID objectId; + std::string objectName; + std::string jointName; U32 objectsCost; U32 objectsCount; U32 texturesCost; U32 texturesCount; U32 largeTexturesCount; - F64 texturesSizeTotal; + F64Bytes texturesMemoryTotal; }; +typedef std::list<LLHUDComplexity> hud_complexity_list_t; + // Class to notify user about drastic changes in agent's render weights or if other agents // reported that user's agent is too 'heavy' for their settings class LLAvatarRenderNotifier : public LLSingleton<LLAvatarRenderNotifier> @@ -107,12 +118,27 @@ public: LLHUDRenderNotifier(); ~LLHUDRenderNotifier(); - void updateNotificationHUD(LLHUDComplexity new_complexity); + void updateNotificationHUD(hud_complexity_list_t complexity); + bool isNotificationVisible(); private: - void displayHUDNotification(const char* message); + enum EWarnLevel + { + WARN_NONE = -1, + WARN_TEXTURES = 0, // least important + WARN_CRAMPED, + WARN_HEAVY, + WARN_COST, + WARN_MEMORY, //most important + }; + + LLNotificationPtr mHUDNotificationPtr; + + static EWarnLevel getWarningType(LLHUDComplexity object_complexity, LLHUDComplexity cmp_complexity); + void displayHUDNotification(EWarnLevel warn_type, LLUUID obj_id = LLUUID::null, std::string object_name = "", std::string joint_name = ""); LLHUDComplexity mReportedHUDComplexity; + EWarnLevel mReportedHUDWarning; LLHUDComplexity mLatestHUDComplexity; LLFrameTimer mHUDPopUpDelayTimer; }; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 84ead0bdde..60056ac21d 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -401,7 +401,9 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) if ((params.mVertexBuffer->getTypeMask() & mask) != mask) { //FIXME! - LL_WARNS() << "Missing required components, skipping render batch." << LL_ENDL; + LL_WARNS_ONCE() << "Missing required components, expected mask: " << mask + << " present: " << (params.mVertexBuffer->getTypeMask() & mask) + << ". Skipping render batch." << LL_ENDL; continue; } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ffeebfd256..a07f3311f1 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1184,6 +1184,7 @@ void LLFloaterModelPreview::onMouseCaptureLostModelPreview(LLMouseHandler* handl LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE), LLMutex(NULL) , mLodsQuery() +, mLodsWithParsingError() , mPelvisZOffset( 0.0f ) , mLegacyRigValid( false ) , mRigValidJointUpload( false ) @@ -1902,9 +1903,16 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) { mLoading = false ; mModelLoader = NULL; + mLodsWithParsingError.push_back(loaded_lod); return ; } + mLodsWithParsingError.erase(std::remove(mLodsWithParsingError.begin(), mLodsWithParsingError.end(), loaded_lod), mLodsWithParsingError.end()); + if(mLodsWithParsingError.empty()) + { + mFMP->childEnable( "calculate_btn" ); + } + // Copy determinations about rig so UI will reflect them // setRigValidForJointPositionUpload(mModelLoader->isRigValidForJointPositionUpload()); @@ -2639,17 +2647,7 @@ void LLModelPreview::updateStatusMessages() setLoadState( LLModelLoader::ERROR_MATERIALS ); mFMP->childDisable( "calculate_btn" ); } - - int refFaceCnt = 0; - int modelFaceCnt = 0; - - if (!lod_model->matchMaterialOrder(model_high_lod, refFaceCnt, modelFaceCnt ) ) - { - setLoadState( LLModelLoader::ERROR_MATERIALS ); - mFMP->childDisable( "calculate_btn" ); - } - - if (lod_model) + else { //for each model in the lod S32 cur_tris = 0; @@ -3591,7 +3589,7 @@ BOOL LLModelPreview::render() } } - if (has_skin_weights) + if (has_skin_weights && lodsReady()) { //model has skin weights, enable view options for skin weights and joint positions if (fmp && isLegacyRigValid() ) { diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a73ca50260..184315f604 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -307,6 +307,7 @@ public: static bool sIgnoreLoadedCallback; std::vector<S32> mLodsQuery; + std::vector<S32> mLodsWithParsingError; protected: diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index a9a0c30e26..5d43c38612 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -711,6 +711,34 @@ void LLPanelPlaces::onEditButtonClicked() updateVerbs(); } +class LLUpdateLandmarkParent : public LLInventoryCallback +{ +public: + LLUpdateLandmarkParent(LLPointer<LLViewerInventoryItem> item, LLUUID new_parent) : + mItem(item), + mNewParentId(new_parent) + {}; + /* virtual */ void fire(const LLUUID& inv_item_id) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(mItem->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(mNewParentId, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + mItem->setParent(mNewParentId); + mItem->updateParentOnServer(FALSE); + + gInventory.updateItem(mItem); + gInventory.notifyObservers(); + } + +private: + LLPointer<LLViewerInventoryItem> mItem; + LLUUID mNewParentId; +}; + void LLPanelPlaces::onSaveButtonClicked() { if (!mLandmarkInfo || mItem.isNull()) @@ -726,6 +754,7 @@ void LLPanelPlaces::onSaveButtonClicked() LLUUID item_id = mItem->getUUID(); LLUUID folder_id = mLandmarkInfo->getLandmarkFolder(); + bool change_parent = folder_id != mItem->getParentUUID(); LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(mItem); @@ -734,10 +763,16 @@ void LLPanelPlaces::onSaveButtonClicked() { new_item->rename(current_title_value); new_item->setDescription(current_notes_value); - new_item->updateServer(FALSE); + LLPointer<LLInventoryCallback> cb; + if (change_parent) + { + cb = new LLUpdateLandmarkParent(new_item, folder_id); + } + LLInventoryModel::LLCategoryUpdate up(mItem->getParentUUID(), 0); + gInventory.accountForUpdate(up); + update_inventory_item(new_item, cb); } - - if(folder_id != mItem->getParentUUID()) + else if (change_parent) { LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(mItem->getParentUUID(),-1); diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 836f63bffa..f40b3e0295 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -55,6 +55,10 @@ void LLPresetsManager::triggerChangeSignal() void LLPresetsManager::createMissingDefault() { + if(gDirUtilp->getLindenUserDir().empty()) + { + return; + } std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, PRESETS_GRAPHIC, PRESETS_DEFAULT + ".xml"); if (!gDirUtilp->fileExists(default_file)) { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 72a8595845..5f4eeaa37b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -6307,7 +6307,7 @@ const LLUUID &LLViewerObject::extractAttachmentItemID() return getAttachmentItemID(); } -const std::string& LLViewerObject::getAttachmentItemName() +const std::string& LLViewerObject::getAttachmentItemName() const { static std::string empty; LLInventoryItem *item = gInventory.getItem(getAttachmentItemID()); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index b95190c554..804b6c147b 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -172,7 +172,7 @@ public: void setOnActiveList(BOOL on_active) { mOnActiveList = on_active; } virtual BOOL isAttachment() const { return FALSE; } - const std::string& getAttachmentItemName(); + const std::string& getAttachmentItemName() const; virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or NULL if object is not an attachment virtual BOOL isHUDAttachment() const { return FALSE; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f79249d6fa..fe8f54b900 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8354,7 +8354,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() { U32 cost = VISUAL_COMPLEXITY_UNKNOWN; LLVOVolume::texture_cost_t textures; - LLHUDComplexity hud_complexity; + hud_complexity_list_t hud_complexity_list; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { @@ -8441,9 +8441,15 @@ void LLVOAvatar::calculateUpdateRenderComplexity() const LLVOVolume* volume = attached_object->mDrawable->getVOVolume(); if (volume) { + LLHUDComplexity hud_object_complexity; + hud_object_complexity.objectName = attached_object->getAttachmentItemName(); + hud_object_complexity.objectId = attached_object->getAttachmentItemID(); + std::string joint_name; + gAgentAvatarp->getAttachedPointName(attached_object->getAttachmentItemID(), joint_name); + hud_object_complexity.jointName = joint_name; // get cost and individual textures - hud_complexity.objectsCost += volume->getRenderCost(textures); - hud_complexity.objectsCount++; + hud_object_complexity.objectsCost += volume->getRenderCost(textures); + hud_object_complexity.objectsCount++; LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -8454,30 +8460,31 @@ void LLVOAvatar::calculateUpdateRenderComplexity() if (chld_volume) { // get cost and individual textures - hud_complexity.objectsCost += chld_volume->getRenderCost(textures); - hud_complexity.objectsCount++; + hud_object_complexity.objectsCost += chld_volume->getRenderCost(textures); + hud_object_complexity.objectsCount++; } } - hud_complexity.texturesCount += textures.size(); + hud_object_complexity.texturesCount += textures.size(); for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); volume_texture != textures.end(); ++volume_texture) { // add the cost of each individual texture (ignores duplicates) - hud_complexity.texturesCost += volume_texture->second; + hud_object_complexity.texturesCost += volume_texture->second; LLViewerFetchedTexture *tex = LLViewerTextureManager::getFetchedTexture(volume_texture->first); if (tex) { - F64 size = tex->getMaxVirtualSize(); // in pixels - hud_complexity.texturesSizeTotal += size; - if (size >= HUD_OVERSIZED_TEXTURE_DATA_SIZE) + // Note: Texture memory might be incorect since texture might be still loading. + hud_object_complexity.texturesMemoryTotal += tex->getTextureMemory(); + if (tex->getOriginalHeight() * tex->getOriginalWidth() >= HUD_OVERSIZED_TEXTURE_DATA_SIZE) { - hud_complexity.largeTexturesCount++; + hud_object_complexity.largeTexturesCount++; } } } + hud_complexity_list.push_back(hud_object_complexity); } } } @@ -8547,7 +8554,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity); // HUD complexity - LLHUDRenderNotifier::getInstance()->updateNotificationHUD(hud_complexity); + LLHUDRenderNotifier::getInstance()->updateNotificationHUD(hud_complexity_list); } } } diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml index c27fac6731..8d8d546b24 100644 --- a/indra/newview/skins/default/xui/en/mime_types.xml +++ b/indra/newview/skins/default/xui/en/mime_types.xml @@ -130,7 +130,7 @@ movie </widgettype> <impl> - media_plugin_cef + media_plugin_libvlc </impl> </scheme> <scheme name="libvlc"> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 09c18f4bfc..23379ff777 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2502,11 +2502,13 @@ This feature is currently in Beta. Please add your name to this [http://goo.gl/f <string name="av_render_anyone">You may not be rendered by anyone around you.</string> <!-- HUD complexity rendering messages, see llavatarrendernotifier. --> - <string name="hud_render_memory_warning">Your HUD uses a lot of texture memory</string> - <string name="hud_render_cost_warning">Your HUD contains a lot of expensive objects and textures</string> - <string name="hud_render_heavy_textures_warning">Your HUD contains a lot of large textures</string> - <string name="hud_render_cramped_warning">Your HUD contains too many objects</string> - <string name="hud_render_textures_warning">Your HUD contains too many textures</string> + <string name="hud_description_total">Your HUD</string> + <string name="hud_name_with_joint">[OBJ_NAME] (worn on [JNT_NAME])</string> + <string name="hud_render_memory_warning">[HUD_DETAILS] uses a lot of texture memory</string> + <string name="hud_render_cost_warning">[HUD_DETAILS] contains a lot of expensive objects and textures</string> + <string name="hud_render_heavy_textures_warning">[HUD_DETAILS] contains a lot of large textures</string> + <string name="hud_render_cramped_warning">[HUD_DETAILS] contains too many objects</string> + <string name="hud_render_textures_warning">[HUD_DETAILS] contains too many textures</string> <!-- AgeYearsA = singular, AgeYearsB = plural, |