summaryrefslogtreecommitdiff
path: root/indra/newview/llnetmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnetmap.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llnetmap.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 1bda7640bd..d7e7f13e87 100644..100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -67,7 +67,6 @@ const F32 LLNetMap::MAP_SCALE_MIN = 32;
const F32 LLNetMap::MAP_SCALE_MID = 1024;
const F32 LLNetMap::MAP_SCALE_MAX = 4096;
-const F32 MAP_SCALE_INCREMENT = 16;
const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of scroll wheel (4%)
const F32 MIN_DOT_RADIUS = 3.5f;
const F32 DOT_SCALE = 0.75f;
@@ -150,7 +149,7 @@ void LLNetMap::draw()
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
static LLUIColor map_avatar_friend_color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
- static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white);
+ //static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white);
static LLUIColor map_frustum_color = LLUIColorTable::instance().getColor("MapFrustumColor", LLColor4::white);
static LLUIColor map_frustum_rotating_color = LLUIColorTable::instance().getColor("MapFrustumRotatingColor", LLColor4::white);
@@ -162,7 +161,7 @@ void LLNetMap::draw()
static LLUICachedControl<bool> auto_center("MiniMapAutoCenter", true);
if (auto_center)
{
- mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f));
+ mCurPan = lerp(mCurPan, mTargetPan, LLSmoothInterpolation::getInterpolant(0.1f));
}
// Prepare a scissor region
@@ -210,7 +209,7 @@ void LLNetMap::draw()
}
// figure out where agent is
- S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters());
+ S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters());
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
@@ -343,8 +342,11 @@ void LLNetMap::draw()
// Draw avatars
for (U32 i = 0; i < avatar_ids.size(); i++)
{
- pos_map = globalPosToView(positions[i]);
LLUUID uuid = avatar_ids[i];
+ // Skip self, we'll draw it later
+ if (uuid == gAgent.getID()) continue;
+
+ pos_map = globalPosToView(positions[i]);
bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
@@ -378,8 +380,8 @@ void LLNetMap::draw()
(pos_map.mV[VX] >= getRect().getWidth()) ||
(pos_map.mV[VY] >= getRect().getHeight()) )
{
- S32 x = llround( pos_map.mV[VX] );
- S32 y = llround( pos_map.mV[VY] );
+ S32 x = ll_round( pos_map.mV[VX] );
+ S32 y = ll_round( pos_map.mV[VY] );
LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10);
} else
{
@@ -419,12 +421,12 @@ void LLNetMap::draw()
// Draw dot for self avatar position
LLVector3d pos_global = gAgent.getPositionGlobal();
pos_map = globalPosToView(pos_global);
- S32 dot_width = llround(mDotRadius * 2.f);
+ S32 dot_width = ll_round(mDotRadius * 2.f);
LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage;
if (you)
{
- you->draw(llround(pos_map.mV[VX] - mDotRadius),
- llround(pos_map.mV[VY] - mDotRadius),
+ you->draw(ll_round(pos_map.mV[VX] - mDotRadius),
+ ll_round(pos_map.mV[VY] - mDotRadius),
dot_width,
dot_width);
@@ -528,8 +530,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color,
{
if (draw_arrow)
{
- S32 x = llround( pos_local.mV[VX] );
- S32 y = llround( pos_local.mV[VY] );
+ S32 x = ll_round( pos_local.mV[VX] );
+ S32 y = ll_round( pos_local.mV[VY] );
LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10 );
LLWorldMapView::drawTrackingArrow( getRect(), x, y, color );
}
@@ -545,8 +547,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color,
LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y )
{
- x -= llround(getRect().getWidth() / 2 + mCurPan.mV[VX]);
- y -= llround(getRect().getHeight() / 2 + mCurPan.mV[VY]);
+ x -= ll_round(getRect().getWidth() / 2 + mCurPan.mV[VX]);
+ y -= ll_round(getRect().getHeight() / 2 + mCurPan.mV[VY]);
LLVector3 pos_local( (F32)x, (F32)y, 0 );
@@ -682,7 +684,7 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &
LLVector3 local_pos;
local_pos.setVec( pos - mObjectImageCenterGlobal );
- S32 diameter_pixels = llround(2 * radius_meters * mObjectMapTPM);
+ S32 diameter_pixels = ll_round(2 * radius_meters * mObjectMapTPM);
renderPoint( local_pos, color, diameter_pixels );
}
@@ -698,8 +700,8 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
const S32 image_width = (S32)mObjectImagep->getWidth();
const S32 image_height = (S32)mObjectImagep->getHeight();
- S32 x_offset = llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2);
- S32 y_offset = llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2);
+ S32 x_offset = ll_round(pos_local.mV[VX] * mObjectMapTPM + image_width / 2);
+ S32 y_offset = ll_round(pos_local.mV[VY] * mObjectMapTPM + image_height / 2);
if ((x_offset < 0) || (x_offset >= image_width))
{
@@ -778,7 +780,7 @@ void LLNetMap::createObjectImage()
// ... which is, the diagonal of the rect.
F32 width = (F32)getRect().getWidth();
F32 height = (F32)getRect().getHeight();
- S32 square_size = llround( sqrt(width*width + height*height) );
+ S32 square_size = ll_round( sqrt(width*width + height*height) );
// Find the least power of two >= the minimum size.
const S32 MIN_SIZE = 64;