diff options
Diffstat (limited to '')
-rw-r--r-- | linden/doc/contributions.txt | 1 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | linden/indra/newview/llnetmap.cpp | 36 | ||||
-rw-r--r-- | linden/indra/newview/llnetmap.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/llworldmapview.cpp | 31 | ||||
-rw-r--r-- | linden/indra/newview/llworldmapview.h | 6 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/textures/textures.xml | 1 |
7 files changed, 51 insertions, 29 deletions
diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index 9886640..6da9879 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt | |||
@@ -21,6 +21,7 @@ Aimee Trescothick | |||
21 | VWR-8341 | 21 | VWR-8341 |
22 | VWR-8430 | 22 | VWR-8430 |
23 | VWR-9255 | 23 | VWR-9255 |
24 | VWR-12748 | ||
24 | Alejandro Rosenthal | 25 | Alejandro Rosenthal |
25 | VWR-1184 | 26 | VWR-1184 |
26 | Alissa Sabre | 27 | Alissa Sabre |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index cce09e2..2d64f03 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -4800,7 +4800,7 @@ | |||
4800 | <key>MiniMapScale</key> | 4800 | <key>MiniMapScale</key> |
4801 | <map> | 4801 | <map> |
4802 | <key>Comment</key> | 4802 | <key>Comment</key> |
4803 | <string>Miniature world map zoom levle (pixels per region)</string> | 4803 | <string>Miniature world map zoom level (pixels per region)</string> |
4804 | <key>Persist</key> | 4804 | <key>Persist</key> |
4805 | <integer>1</integer> | 4805 | <integer>1</integer> |
4806 | <key>Type</key> | 4806 | <key>Type</key> |
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 71eb35b..5a54068 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -68,13 +68,14 @@ | |||
68 | #include "llglheaders.h" | 68 | #include "llglheaders.h" |
69 | 69 | ||
70 | const F32 MAP_SCALE_MIN = 32; | 70 | const F32 MAP_SCALE_MIN = 32; |
71 | const F32 MAP_SCALE_MID = 172; | 71 | const F32 MAP_SCALE_MID = 1024; |
72 | const F32 MAP_SCALE_MAX = 512; | 72 | const F32 MAP_SCALE_MAX = 4096; |
73 | const F32 MAP_SCALE_INCREMENT = 16; | 73 | const F32 MAP_SCALE_INCREMENT = 16; |
74 | const F32 MAP_MIN_PICK_DIST = 4; | 74 | const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of the scroll wheel (4%) |
75 | const F32 MAP_MINOR_DIR_THRESHOLD = 0.08f; | 75 | const F32 MAP_MINOR_DIR_THRESHOLD = 0.08f; |
76 | 76 | const F32 MIN_DOT_RADIUS = 3.5f; | |
77 | const S32 TRACKING_RADIUS = 3; | 77 | const F32 DOT_SCALE = 0.75f; |
78 | const F32 MIN_PICK_SCALE = 2.f; | ||
78 | 79 | ||
79 | LLNetMap::LLNetMap(const std::string& name) : | 80 | LLNetMap::LLNetMap(const std::string& name) : |
80 | LLPanel(name), | 81 | LLPanel(name), |
@@ -89,6 +90,7 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
89 | { | 90 | { |
90 | mScale = gSavedSettings.getF32("MiniMapScale"); | 91 | mScale = gSavedSettings.getF32("MiniMapScale"); |
91 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); | 92 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); |
93 | mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); | ||
92 | 94 | ||
93 | mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); | 95 | mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); |
94 | 96 | ||
@@ -138,6 +140,7 @@ void LLNetMap::setScale( F32 scale ) | |||
138 | } | 140 | } |
139 | 141 | ||
140 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); | 142 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); |
143 | mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); | ||
141 | 144 | ||
142 | mUpdateNow = TRUE; | 145 | mUpdateNow = TRUE; |
143 | } | 146 | } |
@@ -319,6 +322,7 @@ void LLNetMap::draw() | |||
319 | LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); | 322 | LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); |
320 | mClosestAgentToCursor.setNull(); | 323 | mClosestAgentToCursor.setNull(); |
321 | F32 closest_dist = F32_MAX; | 324 | F32 closest_dist = F32_MAX; |
325 | F32 min_pick_dist = mDotRadius * MIN_PICK_SCALE; | ||
322 | 326 | ||
323 | // Draw avatars | 327 | // Draw avatars |
324 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); | 328 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); |
@@ -335,10 +339,11 @@ void LLNetMap::draw() | |||
335 | LLWorldMapView::drawAvatar( | 339 | LLWorldMapView::drawAvatar( |
336 | pos_map.mV[VX], pos_map.mV[VY], | 340 | pos_map.mV[VX], pos_map.mV[VY], |
337 | is_agent_friend(avatar_ids[i]) ? friend_color : avatar_color, | 341 | is_agent_friend(avatar_ids[i]) ? friend_color : avatar_color, |
338 | pos_map.mV[VZ]); | 342 | pos_map.mV[VZ], |
343 | mDotRadius); | ||
339 | 344 | ||
340 | F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); | 345 | F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); |
341 | if(dist_to_cursor < MAP_MIN_PICK_DIST && dist_to_cursor < closest_dist) | 346 | if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist) |
342 | { | 347 | { |
343 | closest_dist = dist_to_cursor; | 348 | closest_dist = dist_to_cursor; |
344 | mClosestAgentToCursor = avatar_ids[i]; | 349 | mClosestAgentToCursor = avatar_ids[i]; |
@@ -367,10 +372,13 @@ void LLNetMap::draw() | |||
367 | // Draw dot for self avatar position | 372 | // Draw dot for self avatar position |
368 | pos_global = gAgent.getPositionGlobal(); | 373 | pos_global = gAgent.getPositionGlobal(); |
369 | pos_map = globalPosToView(pos_global, rotate_map); | 374 | pos_map = globalPosToView(pos_global, rotate_map); |
370 | LLUIImagePtr you = LLWorldMapView::sAvatarYouSmallImage; | 375 | LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; |
376 | S32 dot_width = llround(mDotRadius * 2.f); | ||
371 | you->draw( | 377 | you->draw( |
372 | llround(pos_map.mV[VX]) - you->getWidth()/2, | 378 | llround(pos_map.mV[VX] - mDotRadius), |
373 | llround(pos_map.mV[VY]) - you->getHeight()/2); | 379 | llround(pos_map.mV[VY] - mDotRadius), |
380 | dot_width, | ||
381 | dot_width); | ||
374 | 382 | ||
375 | // Draw frustum | 383 | // Draw frustum |
376 | F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); | 384 | F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); |
@@ -509,8 +517,12 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) | |||
509 | 517 | ||
510 | BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) | 518 | BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) |
511 | { | 519 | { |
512 | // note that clicks are reversed from what you'd think | 520 | // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in |
513 | setScale(llclamp(mScale - clicks*MAP_SCALE_INCREMENT, MAP_SCALE_MIN, MAP_SCALE_MAX)); | 521 | F32 scale = mScale; |
522 | |||
523 | scale *= pow(MAP_SCALE_ZOOM_FACTOR, -clicks); | ||
524 | setScale(llclamp(scale, MAP_SCALE_MIN, MAP_SCALE_MAX)); | ||
525 | |||
514 | return TRUE; | 526 | return TRUE; |
515 | } | 527 | } |
516 | 528 | ||
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h index be5593d..6a112ad 100644 --- a/linden/indra/newview/llnetmap.h +++ b/linden/indra/newview/llnetmap.h | |||
@@ -85,7 +85,8 @@ private: | |||
85 | F32 mScale; // Size of a region in pixels | 85 | F32 mScale; // Size of a region in pixels |
86 | F32 mPixelsPerMeter; // world meters to map pixels | 86 | F32 mPixelsPerMeter; // world meters to map pixels |
87 | F32 mObjectMapTPM; // texels per meter on map | 87 | F32 mObjectMapTPM; // texels per meter on map |
88 | F32 mObjectMapPixels; // Width of object map in pixels; | 88 | F32 mObjectMapPixels; // Width of object map in pixels |
89 | F32 mDotRadius; // Size of avatar markers | ||
89 | F32 mTargetPanX; | 90 | F32 mTargetPanX; |
90 | F32 mTargetPanY; | 91 | F32 mTargetPanY; |
91 | F32 mCurPanX; | 92 | F32 mCurPanX; |
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index 73c2d8b..2ded35a 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp | |||
@@ -70,9 +70,10 @@ const S32 SCROLL_HINT_WIDTH = 65; | |||
70 | const F32 BIG_DOT_RADIUS = 5.f; | 70 | const F32 BIG_DOT_RADIUS = 5.f; |
71 | BOOL LLWorldMapView::sHandledLastClick = FALSE; | 71 | BOOL LLWorldMapView::sHandledLastClick = FALSE; |
72 | 72 | ||
73 | LLUIImagePtr LLWorldMapView::sAvatarYouSmallImage = NULL; | ||
74 | LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; | 73 | LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; |
75 | LLUIImagePtr LLWorldMapView::sAvatarLargeImage = NULL; | 74 | LLUIImagePtr LLWorldMapView::sAvatarYouImage = NULL; |
75 | LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = NULL; | ||
76 | LLUIImagePtr LLWorldMapView::sAvatarLevelImage = NULL; | ||
76 | LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; | 77 | LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; |
77 | LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; | 78 | LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; |
78 | 79 | ||
@@ -112,11 +113,12 @@ std::map<std::string,std::string> LLWorldMapView::sStringsMap; | |||
112 | 113 | ||
113 | void LLWorldMapView::initClass() | 114 | void LLWorldMapView::initClass() |
114 | { | 115 | { |
115 | sAvatarYouSmallImage = LLUI::getUIImage("map_avatar_you_8.tga"); | ||
116 | sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); | 116 | sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); |
117 | sAvatarLargeImage = LLUI::getUIImage("map_avatar_16.tga"); | 117 | sAvatarYouImage = LLUI::getUIImage("map_avatar_16.tga"); |
118 | sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_8.tga"); | 118 | sAvatarYouLargeImage = LLUI::getUIImage("map_avatar_you_32.tga"); |
119 | sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_8.tga"); | 119 | sAvatarLevelImage = LLUI::getUIImage("map_avatar_32.tga"); |
120 | sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_32.tga"); | ||
121 | sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_32.tga"); | ||
120 | 122 | ||
121 | sHomeImage = LLUI::getUIImage("map_home.tga"); | 123 | sHomeImage = LLUI::getUIImage("map_home.tga"); |
122 | sTelehubImage = LLUI::getUIImage("map_telehub.tga"); | 124 | sTelehubImage = LLUI::getUIImage("map_telehub.tga"); |
@@ -136,9 +138,10 @@ void LLWorldMapView::initClass() | |||
136 | // static | 138 | // static |
137 | void LLWorldMapView::cleanupClass() | 139 | void LLWorldMapView::cleanupClass() |
138 | { | 140 | { |
139 | sAvatarYouSmallImage = NULL; | ||
140 | sAvatarSmallImage = NULL; | 141 | sAvatarSmallImage = NULL; |
141 | sAvatarLargeImage = NULL; | 142 | sAvatarYouImage = NULL; |
143 | sAvatarYouLargeImage = NULL; | ||
144 | sAvatarLevelImage = NULL; | ||
142 | sAvatarAboveImage = NULL; | 145 | sAvatarAboveImage = NULL; |
143 | sAvatarBelowImage = NULL; | 146 | sAvatarBelowImage = NULL; |
144 | 147 | ||
@@ -724,7 +727,7 @@ void LLWorldMapView::draw() | |||
724 | 727 | ||
725 | // Now draw your avatar after all that other stuff. | 728 | // Now draw your avatar after all that other stuff. |
726 | LLVector3d pos_global = gAgent.getPositionGlobal(); | 729 | LLVector3d pos_global = gAgent.getPositionGlobal(); |
727 | drawImage(pos_global, sAvatarLargeImage); | 730 | drawImage(pos_global, sAvatarYouImage); |
728 | 731 | ||
729 | LLVector3 pos_map = globalPosToView(pos_global); | 732 | LLVector3 pos_map = globalPosToView(pos_global); |
730 | if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) | 733 | if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) |
@@ -1210,7 +1213,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, | |||
1210 | F32 dot_radius) | 1213 | F32 dot_radius) |
1211 | { | 1214 | { |
1212 | const F32 HEIGHT_THRESHOLD = 7.f; | 1215 | const F32 HEIGHT_THRESHOLD = 7.f; |
1213 | LLUIImagePtr dot_image = sAvatarSmallImage; | 1216 | LLUIImagePtr dot_image = sAvatarLevelImage; |
1214 | if(relative_z < -HEIGHT_THRESHOLD) | 1217 | if(relative_z < -HEIGHT_THRESHOLD) |
1215 | { | 1218 | { |
1216 | dot_image = sAvatarBelowImage; | 1219 | dot_image = sAvatarBelowImage; |
@@ -1219,9 +1222,13 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, | |||
1219 | { | 1222 | { |
1220 | dot_image = sAvatarAboveImage; | 1223 | dot_image = sAvatarAboveImage; |
1221 | } | 1224 | } |
1225 | |||
1226 | S32 dot_width = llround(dot_radius * 2.f); | ||
1222 | dot_image->draw( | 1227 | dot_image->draw( |
1223 | llround(x_pixels) - dot_image->getWidth()/2, | 1228 | llround(x_pixels - dot_radius), |
1224 | llround(y_pixels) - dot_image->getHeight()/2, | 1229 | llround(y_pixels - dot_radius), |
1230 | dot_width, | ||
1231 | dot_width, | ||
1225 | color); | 1232 | color); |
1226 | } | 1233 | } |
1227 | 1234 | ||
diff --git a/linden/indra/newview/llworldmapview.h b/linden/indra/newview/llworldmapview.h index 7e94e19..6dbaa8d 100644 --- a/linden/indra/newview/llworldmapview.h +++ b/linden/indra/newview/llworldmapview.h | |||
@@ -136,11 +136,13 @@ protected: | |||
136 | public: | 136 | public: |
137 | LLColor4 mBackgroundColor; | 137 | LLColor4 mBackgroundColor; |
138 | 138 | ||
139 | static LLUIImagePtr sAvatarYouSmallImage; | ||
140 | static LLUIImagePtr sAvatarSmallImage; | 139 | static LLUIImagePtr sAvatarSmallImage; |
141 | static LLUIImagePtr sAvatarLargeImage; | 140 | static LLUIImagePtr sAvatarYouImage; |
141 | static LLUIImagePtr sAvatarYouLargeImage; | ||
142 | static LLUIImagePtr sAvatarLevelImage; | ||
142 | static LLUIImagePtr sAvatarAboveImage; | 143 | static LLUIImagePtr sAvatarAboveImage; |
143 | static LLUIImagePtr sAvatarBelowImage; | 144 | static LLUIImagePtr sAvatarBelowImage; |
145 | |||
144 | static LLUIImagePtr sTelehubImage; | 146 | static LLUIImagePtr sTelehubImage; |
145 | static LLUIImagePtr sInfohubImage; | 147 | static LLUIImagePtr sInfohubImage; |
146 | static LLUIImagePtr sHomeImage; | 148 | static LLUIImagePtr sHomeImage; |
diff --git a/linden/indra/newview/skins/default/textures/textures.xml b/linden/indra/newview/skins/default/textures/textures.xml index 9e1d9b5..89399ef 100644 --- a/linden/indra/newview/skins/default/textures/textures.xml +++ b/linden/indra/newview/skins/default/textures/textures.xml | |||
@@ -150,7 +150,6 @@ | |||
150 | 150 | ||
151 | <texture name="map_avatar_16.tga"/> | 151 | <texture name="map_avatar_16.tga"/> |
152 | <texture name="map_avatar_8.tga"/> | 152 | <texture name="map_avatar_8.tga"/> |
153 | <texture name="map_avatar_you_8.tga"/> | ||
154 | <texture name="map_event.tga"/> | 153 | <texture name="map_event.tga"/> |
155 | <texture name="map_event_mature.tga"/> | 154 | <texture name="map_event_mature.tga"/> |
156 | <texture name="map_home.tga"/> | 155 | <texture name="map_home.tga"/> |