Merge viewer-bear

master
Ansariel 2016-10-19 10:56:32 +02:00
commit 79c0b8a9b5
19 changed files with 394 additions and 190 deletions

View File

@ -961,11 +961,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() << " ";
@ -973,17 +968,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())

View File

@ -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<>

View File

@ -294,7 +294,7 @@ S32 LLXfer::processEOF()
}
else
{
LL_INFOS() << "xfer from " << mRemoteHost << " failed, code "
LL_INFOS() << "xfer from " << mRemoteHost << " failed or aborted, code "
<< mCallbackResult << ": " << getFileName() << LL_ENDL;
}

View File

@ -401,7 +401,7 @@ U64 LLXferManager::registerXfer(const void *datap, const S32 length)
///////////////////////////////////////////////////////////
void LLXferManager::requestFile(const std::string& local_filename,
U64 LLXferManager::requestFile(const std::string& local_filename,
const std::string& remote_filename,
ELLPath remote_path,
const LLHost& remote_host,
@ -424,10 +424,12 @@ void LLXferManager::requestFile(const std::string& local_filename,
{
// cout << "requested a xfer already in progress" << endl;
return;
return xferp->mID;
}
}
U64 xfer_id = 0;
S32 chunk_size = use_big_packets ? LL_XFER_LARGE_PAYLOAD : -1;
xferp = (LLXfer *) new LLXfer_File(chunk_size);
if (xferp)
@ -438,13 +440,15 @@ void LLXferManager::requestFile(const std::string& local_filename,
// around.
// Note: according to AaronB, this is here to deal with locks on files that were
// in transit during a crash,
if(delete_remote_on_completion &&
(remote_filename.substr(remote_filename.length()-4) == ".tmp"))
if( delete_remote_on_completion
&& (remote_filename.substr(remote_filename.length()-4) == ".tmp")
&& gDirUtilp->fileExists(local_filename))
{
LLFile::remove(local_filename);
}
xfer_id = getNextID();
((LLXfer_File *)xferp)->initializeRequest(
getNextID(),
xfer_id,
local_filename,
remote_filename,
remote_path,
@ -457,6 +461,7 @@ void LLXferManager::requestFile(const std::string& local_filename,
{
LL_ERRS() << "Xfer allocation error" << LL_ENDL;
}
return xfer_id;
}
void LLXferManager::requestFile(const std::string& remote_filename,
@ -616,7 +621,7 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user
if (!xferp)
{
char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */
LL_WARNS() << "received xfer data from " << mesgsys->getSender()
LL_INFOS() << "received xfer data from " << mesgsys->getSender()
<< " for non-existent xfer id: "
<< U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << LL_ENDL;
return;
@ -1103,6 +1108,29 @@ void LLXferManager::retransmitUnackedPackets ()
}
}
///////////////////////////////////////////////////////////
void LLXferManager::abortRequestById(U64 xfer_id, S32 result_code)
{
LLXfer * xferp = findXfer(xfer_id, mReceiveList);
if (xferp)
{
if (xferp->mStatus == e_LL_XFER_IN_PROGRESS)
{
// causes processAbort();
xferp->abort(result_code);
}
else
{
xferp->mCallbackResult = result_code;
xferp->processEOF(); //should notify requester
removeXfer(xferp, &mReceiveList);
}
// Since already removed or marked as aborted no need
// to wait for processAbort() to start new download
startPendingDownloads();
}
}
///////////////////////////////////////////////////////////

View File

@ -140,7 +140,7 @@ class LLXferManager
// file requesting routines
// .. to file
virtual void requestFile(const std::string& local_filename,
virtual U64 requestFile(const std::string& local_filename,
const std::string& remote_filename,
ELLPath remote_path,
const LLHost& remote_host,
@ -202,6 +202,7 @@ class LLXferManager
virtual void retransmitUnackedPackets ();
// error handling
void abortRequestById(U64 xfer_id, S32 result_code);
virtual void processAbort (LLMessageSystem *mesgsys, void **user_data);
};

View File

@ -12768,16 +12768,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<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>
@ -12920,7 +12920,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>6.5</real>
<real>7.5</real>
</map>
<key>RenderWater</key>
<map>

View File

@ -3786,7 +3786,7 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global)
}
BOOL LLAgent::leftButtonGrabbed() const
{
{
const BOOL camera_mouse_look = gAgentCamera.cameraMouselook();
return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0)
|| (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0)
@ -3794,6 +3794,13 @@ BOOL LLAgent::leftButtonGrabbed() const
|| (camera_mouse_look && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0);
}
BOOL LLAgent::leftButtonBlocked() const
{
const BOOL camera_mouse_look = gAgentCamera.cameraMouselook();
return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0)
|| (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0);
}
BOOL LLAgent::rotateGrabbed() const
{
return (mControlsTakenCount[CONTROL_YAW_POS_INDEX] > 0)
@ -4344,7 +4351,14 @@ BOOL LLAgent::anyControlGrabbed() const
BOOL LLAgent::isControlGrabbed(S32 control_index) const
{
return mControlsTakenCount[control_index] > 0;
if (gAgent.mControlsTakenCount[control_index] > 0)
return TRUE;
return gAgent.mControlsTakenPassedOnCount[control_index] > 0;
}
BOOL LLAgent::isControlBlocked(S32 control_index) const
{
return mControlsTakenCount[control_index] > 0;
}
void LLAgent::forceReleaseControls()

View File

@ -527,7 +527,8 @@ private:
// Grab
//--------------------------------------------------------------------
public:
BOOL leftButtonGrabbed() const;
BOOL leftButtonGrabbed() const;
BOOL leftButtonBlocked() const;
BOOL rotateGrabbed() const;
BOOL forwardGrabbed() const;
BOOL backwardGrabbed() const;
@ -544,8 +545,9 @@ public:
BOOL controlFlagsDirty() const;
void enableControlFlagReset();
void resetControlFlags();
BOOL anyControlGrabbed() const; // True iff a script has taken over a control
BOOL isControlGrabbed(S32 control_index) const;
BOOL anyControlGrabbed() const; // True if a script has taken over any control
BOOL isControlGrabbed(S32 control_index) const; // True if a script has taken over a control
BOOL isControlBlocked(S32 control_index) const; // Control should be ignored or won't be passed
// Send message to simulator to force grabbed controls to be
// released, in case of a poorly written script.
void forceReleaseControls();

View File

@ -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"
@ -55,7 +56,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() :
@ -280,7 +281,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)
{
}
@ -288,118 +299,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.
LLHUDComplexity new_total_complexity;
LLHUDComplexity report_complexity;
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)
{
LLHUDComplexity object_complexity = *iter;
EWarnLevel object_level = getWarningType(object_complexity, report_complexity);
if (object_level >= 0)
{
warning_level = object_level;
report_complexity = object_complexity;
}
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)
{
// 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
{
// 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, "RenderHUDTexturesVirtualMemoryWarning", WARN_HUD_TEXTURE_MEMORY_LIMIT);
static LLCachedControl<U32> max_texture_memory(gSavedSettings, "RenderHUDTexturesMemoryWarning", WARN_HUD_TEXTURE_MEMORY_LIMIT);
if (mHUDPopUpDelayTimer.hasExpired())
if (cmp_complexity.texturesMemoryTotal < object_complexity.texturesMemoryTotal
&& object_complexity.texturesMemoryTotal > (F64Bytes)max_texture_memory)
{
// 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)
{
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;
}
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)
{
LL_DEBUGS("HUDdetail") << "HUD contains too many objects: "
<< new_complexity.objectsCount << LL_ENDL;
displayHUDNotification(hud_textures);
mReportedHUDComplexity.objectsCount = new_complexity.objectsCount;
}
else
{
// all warnings displayed, just store everything so that we will
// be able to reduce values and show warnings again later
mReportedHUDComplexity = new_complexity;
}
}
// Note: Memory might not be accurate since texture is still loading or discard level changes
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)
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_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 << " complexity over limit,"
<< " HUD textures cost: " << object_complexity.texturesCost
<< " HUD objects cost: " << object_complexity.objectsCost << LL_ENDL;
mLatestHUDComplexity = new_complexity;
return WARN_COST;
}
else if (cmp_complexity.largeTexturesCount < object_complexity.largeTexturesCount
&& object_complexity.largeTexturesCount > max_oversized_count)
{
LL_DEBUGS("HUDdetail") << "HUD " << object_complexity.objectName << " contains to many large textures: "
<< object_complexity.largeTexturesCount << LL_ENDL;
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);
}
}
LLNotifications::instance().add(LLNotification::Params()
LLSD msg_args;
msg_args["HUD_REASON"] = LLTrans::getString(e_hud_messages[warn_type], reason_args);
mHUDNotificationPtr = LLNotifications::instance().add(LLNotification::Params()
.name("HUDComplexityWarning")
.expiry(expire_date)
.substitutions(args));
.substitutions(msg_args));
mHUDPopUpDelayTimer.resetWithExpiry(pop_up_delay);
}

View File

@ -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;
};

View File

@ -38,6 +38,7 @@
#include "lltoolfocus.h"
#include "llfocusmgr.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llviewerjoystick.h"
extern BOOL gDebugClicks;
@ -84,7 +85,14 @@ BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask)
}
// by default, didn't handle it
// LL_INFOS() << "LLTool::handleMouseDown" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN);
if (gAgentCamera.cameraMouselook())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN);
}
return TRUE;
}
@ -95,8 +103,15 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask)
LL_INFOS() << "LLTool left mouse up" << LL_ENDL;
}
// by default, didn't handle it
// LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP);
// LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL;
if (gAgentCamera.cameraMouselook())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP);
}
return TRUE;
}

View File

@ -760,12 +760,13 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask)
BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
{
// if the left button is grabbed, don't put up the pie menu
if (gAgent.leftButtonGrabbed())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// if the left button is blocked, don't put up the pie menu
if (gAgent.leftButtonBlocked())
{
// in case of "grabbed" control flag will be set later
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// On mousedown, start grabbing
gGrabTransientTool = this;
@ -777,12 +778,13 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask)
{
// if the left button is grabbed, don't put up the pie menu
if (gAgent.leftButtonGrabbed())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// if the left button is blocked, don't put up the pie menu
if (gAgent.leftButtonBlocked())
{
// in case of "grabbed" control flag will be set later
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// On mousedown, start grabbing
gGrabTransientTool = this;

View File

@ -146,7 +146,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask)
// call the base class to propogate info to sim
LLTool::handleMouseDown(x, y, mask);
if (!gAgent.leftButtonGrabbed())
if (!gAgent.leftButtonBlocked())
{
// can grab transparent objects (how touch event propagates, scripters rely on this)
gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE);

View File

@ -145,7 +145,6 @@ std::map<std::string, U32> LLViewerObject::sObjectDataMap;
// JC 3/18/2003
const F32 PHYSICS_TIMESTEP = 1.f / 45.f;
const F64 INV_REQUEST_EXPIRE_TIME_SEC = 60.0;
static LLTrace::BlockTimerStatHandle FTM_CREATE_OBJECT("Create Object");
@ -268,9 +267,10 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mPixelArea(1024.f),
mInventory(NULL),
mInventorySerialNum(0),
mRegionp( regionp ),
mInvRequestExpireTime(0.0),
mInvRequestState(INVENTORY_REQUEST_STOPPED),
mInvRequestXFerId(0),
mInventoryDirty(FALSE),
mRegionp(regionp),
mDead(FALSE),
mOrphaned(FALSE),
mUserSelected(FALSE),
@ -2916,11 +2916,7 @@ void LLViewerObject::removeInventoryListener(LLVOInventoryListener* listener)
BOOL LLViewerObject::isInventoryPending()
{
if (mInvRequestExpireTime == 0.0 || mInvRequestExpireTime < LLFrameTimer::getTotalSeconds())
{
return FALSE;
}
return TRUE;
return mInvRequestState != INVENTORY_REQUEST_STOPPED;
}
void LLViewerObject::clearInventoryListeners()
@ -2961,7 +2957,7 @@ void LLViewerObject::requestInventory()
void LLViewerObject::fetchInventoryFromServer()
{
if (mInvRequestExpireTime == 0.0 || mInvRequestExpireTime < LLFrameTimer::getTotalSeconds())
if (!isInventoryPending())
{
delete mInventory;
LLMessageSystem* msg = gMessageSystem;
@ -2974,7 +2970,7 @@ void LLViewerObject::fetchInventoryFromServer()
msg->sendReliable(mRegionp->getHost());
// this will get reset by dirtyInventory or doInventoryCallback
mInvRequestExpireTime = LLFrameTimer::getTotalSeconds() + INV_REQUEST_EXPIRE_TIME_SEC;
mInvRequestState = INVENTORY_REQUEST_PENDING;
}
}
@ -3035,7 +3031,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
std::string unclean_filename;
msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, unclean_filename);
ft->mFilename = LLDir::getScrubbedFileName(unclean_filename);
if(ft->mFilename.empty())
{
LL_DEBUGS() << "Task has no inventory" << LL_ENDL;
@ -3057,13 +3053,27 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
delete ft;
return;
}
gXferManager->requestFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ft->mFilename),
U64 new_id = gXferManager->requestFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ft->mFilename),
ft->mFilename, LL_PATH_CACHE,
object->mRegionp->getHost(),
TRUE,
&LLViewerObject::processTaskInvFile,
(void**)ft,
LLXferManager::HIGH_PRIORITY);
if (object->mInvRequestState == INVENTORY_XFER)
{
if (new_id > 0 && new_id != object->mInvRequestXFerId)
{
// we started new download.
gXferManager->abortRequestById(object->mInvRequestXFerId, -1);
object->mInvRequestXFerId = new_id;
}
}
else
{
object->mInvRequestState = INVENTORY_XFER;
object->mInvRequestXFerId = new_id;
}
}
void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtStat ext_status)
@ -3199,7 +3209,10 @@ void LLViewerObject::doInventoryCallback()
mInventoryCallbacks.erase(curiter);
}
}
mInvRequestExpireTime = 0.0;
// release inventory loading state
mInvRequestXFerId = 0;
mInvRequestState = INVENTORY_REQUEST_STOPPED;
}
void LLViewerObject::removeInventory(const LLUUID& item_id)
@ -6414,7 +6427,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());

View File

@ -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; }
@ -737,6 +737,7 @@ private:
void deleteTEImages(); // correctly deletes list of images
protected:
typedef std::map<char *, LLNameValue *> name_value_map_t;
name_value_map_t mNameValuePairs; // Any name-value pairs stored by script
@ -773,9 +774,17 @@ protected:
callback_list_t mInventoryCallbacks;
S16 mInventorySerialNum;
enum EInventoryRequestState
{
INVENTORY_REQUEST_STOPPED,
INVENTORY_REQUEST_PENDING,
INVENTORY_XFER
};
EInventoryRequestState mInvRequestState;
U64 mInvRequestXFerId;
BOOL mInventoryDirty;
LLViewerRegion *mRegionp; // Region that this object belongs to.
F64 mInvRequestExpireTime;
BOOL mInventoryDirty;
BOOL mDead;
BOOL mOrphaned; // This is an orphaned child
BOOL mUserSelected; // Cached user select information

View File

@ -9237,7 +9237,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++)
{
@ -9325,6 +9325,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
if (isSelf()
&& attached_object
&& attached_object->isHUDAttachment()
&& !attached_object->isTempAttachment()
&& attached_object->mDrawable)
{
textures.clear();
@ -9332,9 +9333,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();
@ -9345,30 +9352,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);
}
}
}
@ -9440,7 +9448,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity);
// HUD complexity
LLHUDRenderNotifier::getInstance()->updateNotificationHUD(hud_complexity);
LLHUDRenderNotifier::getInstance()->updateNotificationHUD(hud_complexity_list);
}
// <FS:Ansariel> Show avatar complexity in appearance floater

View File

@ -1302,18 +1302,7 @@ BOOL LLVOVolume::calcLOD()
lod_factor *= LLVOVolume::sRiggedFactorMultiplier;
distance = avatar->mDrawable->mDistanceWRTCamera;
F32 avatar_radius = avatar->getBinRadius();
F32 object_radius;
if (mDrawable.notNull() && !mDrawable->isDead())
{
const LLVector4a* ext = mDrawable->getSpatialExtents();
LLVector4a diff;
diff.setSub(ext[1], ext[0]);
object_radius = diff.getLength3().getF32();
}
else
{
object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length();
}
F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length();
radius = object_radius * LLVOVolume::sRiggedFactorMultiplier;
radius = llmin(radius, avatar_radius);
}

View File

@ -7502,15 +7502,6 @@ This area has voice chat disabled. You will not be able to use voice chat here.
This area has building disabled. You can&apos;t build or rez objects here.
</notification>
<notification
icon="notify.tga"
name="AutopilotCanceled"
persist="true"
type="notify">
<unique/>
Autopilot canceled
</notification>
<notification
icon="alertmodal.tga"
name="PathfindingDirty"
@ -11494,6 +11485,22 @@ You have been teleported by the object '[OBJECT_NAME]' owned by [OWNER_ID]
You have been teleported by the object '[OBJECT_NAME]' owned by an unknown user.
</notification>
<notification
icon="alertmodal.tga"
name="StandDeniedByObject"
type="notify">
<tag>fail</tag>
'[OBJECT_NAME]' will not allow you to stand at this time.
</notification>
<notification
icon="alertmodal.tga"
name="ResitDeniedByObject"
type="notify">
<tag>fail</tag>
'[OBJECT_NAME]' will not allow you to change your seat at this time.
</notification>
<notification
icon="alertmodal.tga"
name="CantCreateObjectRegionFull"

View File

@ -961,11 +961,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,