summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp61
1 files changed, 59 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index e638e5b8c3..868d26d5c6 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -70,6 +70,7 @@
#include "llmeshrepository.h"
#include "llmutelist.h"
#include "llmoveview.h"
+#include "llnotificationmanager.h"
#include "llnotificationsutil.h"
#include "llphysicsshapebuilderutil.h"
#include "llquantize.h"
@@ -818,6 +819,21 @@ LLVOAvatar::~LLVOAvatar()
{
sInstances.remove(this);
+ if (gSavedSettings.getBOOL("IMShowArrivalsDepartures"))
+ {
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(getID(), &av_name);
+ auto display_name = av_name.getDisplayName();
+ if (!display_name.empty())
+ {
+ LLChat chat{llformat("%s left.", display_name.c_str())};
+ chat.mFromName = display_name;
+ chat.mFromID = getID();
+ LLSD args;
+ args["COLOR"] = "ChatHistoryTextColor";
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+ }
+ }
if (!mFullyLoaded)
{
debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud");
@@ -2492,6 +2508,33 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
{
mDebugExistenceTimer.reset();
debugAvatarRezTime("AvatarRezArrivedNotification", "avatar arrived");
+ if (gSavedSettings.getBOOL("IMShowArrivalsDepartures"))
+ {
+ uuid_vec_t uuids;
+ std::vector<LLVector3d> positions;
+ LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange"));
+ auto pos_it = positions.begin();
+ auto id_it = uuids.begin();
+ for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it)
+ {
+ if (*id_it == getID() && !isSelf())
+ {
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(getID(), &av_name);
+ auto display_name = av_name.getDisplayName();
+ if (!display_name.empty())
+ {
+ LLChat chat{llformat("%s arrived (%.1f m).", display_name.c_str(), dist_vec(*pos_it, gAgent.getPositionGlobal()))};
+ chat.mFromName = display_name;
+ chat.mFromID = getID();
+ LLSD args;
+ args["COLOR"] = "ChatHistoryTextColor";
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+ }
+ break;
+ }
+ }
+ }
}
if (retval & LLViewerObject::INVALID_UPDATE)
@@ -11626,24 +11669,38 @@ void LLVOAvatar::placeProfileQuery()
glGenQueries(1, &mGPUTimerQuery);
}
- glBeginQuery(GL_TIME_ELAPSED, mGPUTimerQuery);
+#if GL_EXT_timer_query || GL_EXT_disjoint_timer_query
+ glBeginQuery(GL_TIME_ELAPSED_EXT, mGPUTimerQuery);
+#endif
}
void LLVOAvatar::readProfileQuery(S32 retries)
{
if (!mGPUProfilePending)
{
- glEndQuery(GL_TIME_ELAPSED);
+#if GL_EXT_timer_query || GL_EXT_disjoint_timer_query
+ glEndQuery(GL_TIME_ELAPSED_EXT);
+#endif
mGPUProfilePending = true;
}
+#if GL_ARB_timer_query
GLuint64 result = 0;
glGetQueryObjectui64v(mGPUTimerQuery, GL_QUERY_RESULT_AVAILABLE, &result);
+#else
+ GLuint result = 0;
+ glGetQueryObjectuiv(mGPUTimerQuery, GL_QUERY_RESULT_AVAILABLE, &result);
+#endif
if (result == GL_TRUE || --retries <= 0)
{ // query available, readback result
+#if GL_ARB_timer_query
GLuint64 time_elapsed = 0;
glGetQueryObjectui64v(mGPUTimerQuery, GL_QUERY_RESULT, &time_elapsed);
+#else
+ GLuint time_elapsed = 0;
+ glGetQueryObjectuiv(mGPUTimerQuery, GL_QUERY_RESULT, &time_elapsed);
+#endif
mGPURenderTime = time_elapsed / 1000000.f;
mGPUProfilePending = false;