Minimap cleanup

This commit is contained in:
Siana Gearz
2011-02-26 00:13:59 +01:00
parent 1968cc6024
commit c1eaba08f4
7 changed files with 27 additions and 127 deletions

View File

@@ -75,7 +75,6 @@ const F32 GODLY_TELEPORT_HEIGHT = 200.f;
const S32 SCROLL_HINT_WIDTH = 65;
const F32 BIG_DOT_RADIUS = 5.f;
BOOL LLWorldMapView::sHandledLastClick = FALSE;
BOOL LLWorldMapView::sUseOldTrackingDots = FALSE;
LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL;
LLUIImagePtr LLWorldMapView::sAvatarYouImage = NULL;
@@ -147,8 +146,6 @@ void LLWorldMapView::initClass()
sStringsMap["loading"] = LLTrans::getString("texture_loading");
sStringsMap["offline"] = LLTrans::getString("worldmap_offline");
sUseOldTrackingDots = gSavedSettings.getBOOL("UseOldTrackingDots");
}
// static
@@ -1320,84 +1317,33 @@ static void drawDot(F32 x_pixels, F32 y_pixels,
// static
void LLWorldMapView::drawAvatar(F32 x_pixels,
F32 y_pixels,
const LLColor4& color,
LLColor4 color,
F32 relative_z,
F32 dot_radius)
{
const F32 HEIGHT_THRESHOLD = 7.f;
LLUIImagePtr dot_image = sAvatarSmallImage;
if (sUseOldTrackingDots || relative_z == 16000.f)
if (relative_z == 16000.f) // Unknown altitude (0m or > 1020m)
{
F32 left = x_pixels - dot_radius;
F32 right = x_pixels + dot_radius;
F32 center = (left + right) * 0.5f;
F32 top = y_pixels + dot_radius;
F32 bottom = y_pixels - dot_radius;
if (relative_z == 16000.f)
{
// Unknown altitude (0m or > 1020m)
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
glColor4fv(color.mV);
LLUI::setLineWidth(1.5f);
glBegin(GL_LINES);
glVertex2f(left, y_pixels);
glVertex2f(right, y_pixels);
glEnd();
LLUI::setLineWidth(1.0f);
}
else if (relative_z > HEIGHT_THRESHOLD)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
glColor4fv(color.mV);
LLUI::setLineWidth(1.5f);
glBegin(GL_LINES);
glVertex2f(left, top);
glVertex2f(right, top);
glVertex2f(center, top);
glVertex2f(center, bottom);
glEnd();
LLUI::setLineWidth(1.0f);
}
else if (relative_z > -HEIGHT_THRESHOLD)
{
dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2,
llround(y_pixels) - dot_image->getHeight()/2,
color);
}
else
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
glColor4fv(color.mV);
LLUI::setLineWidth(1.5f);
glBegin(GL_LINES);
glVertex2f(center, top);
glVertex2f(center, bottom);
glVertex2f(left, bottom);
glVertex2f(right, bottom);
glEnd();
LLUI::setLineWidth(1.0f);
}
F32 mag = color.length();
color=color*0.5f + LLColor4(mag, mag, mag)*0.25f;
}
else
{
if (relative_z < -HEIGHT_THRESHOLD)
else if (relative_z < -HEIGHT_THRESHOLD)
{
dot_image = sAvatarBelowImage;
}
else if (relative_z > HEIGHT_THRESHOLD)
else if (relative_z > HEIGHT_THRESHOLD)
{
dot_image = sAvatarAboveImage;
}
S32 dot_width = llround(dot_radius * 2.f);
dot_image->draw(llround(x_pixels - dot_radius),
llround(y_pixels - dot_radius),
dot_width,
dot_width,
color);
}
dot_image->draw(llround(x_pixels - dot_radius),
llround(y_pixels - dot_radius),
dot_width,
dot_width,
color);
}
// Pass relative Z of 0 to draw at same level.