diff options
author | McCabe Maxsted | 2009-09-22 09:46:20 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-22 09:46:20 -0700 |
commit | 0a700b3b3a145733345d88ba1f6a6cd34c10ac3e (patch) | |
tree | ab02f29c1a453a354561faca5c2bf33e5b22cb2f /linden | |
parent | Fixed map textures displaying as X (diff) | |
parent | Applied Aimee's minimap zoom patch (diff) | |
download | meta-impy-0a700b3b3a145733345d88ba1f6a6cd34c10ac3e.zip meta-impy-0a700b3b3a145733345d88ba1f6a6cd34c10ac3e.tar.gz meta-impy-0a700b3b3a145733345d88ba1f6a6cd34c10ac3e.tar.bz2 meta-impy-0a700b3b3a145733345d88ba1f6a6cd34c10ac3e.tar.xz |
Merged 1.2.0-minimap-magnify into 1.2.0-radarzoom
Diffstat (limited to 'linden')
-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 a1c8624..2acb043 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 5fed08e..194e95e 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -5064,7 +5064,7 @@ | |||
5064 | <key>MiniMapScale</key> | 5064 | <key>MiniMapScale</key> |
5065 | <map> | 5065 | <map> |
5066 | <key>Comment</key> | 5066 | <key>Comment</key> |
5067 | <string>Miniature world map zoom levle (pixels per region)</string> | 5067 | <string>Miniature world map zoom level (pixels per region)</string> |
5068 | <key>Persist</key> | 5068 | <key>Persist</key> |
5069 | <integer>1</integer> | 5069 | <integer>1</integer> |
5070 | <key>Type</key> | 5070 | <key>Type</key> |
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index c407f04..b8bf0cb 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -70,13 +70,15 @@ | |||
70 | #include "llglheaders.h" | 70 | #include "llglheaders.h" |
71 | 71 | ||
72 | const F32 MAP_SCALE_MIN = 32; | 72 | const F32 MAP_SCALE_MIN = 32; |
73 | const F32 MAP_SCALE_MID = 172; | 73 | const F32 MAP_SCALE_MID = 1024; |
74 | const F32 MAP_SCALE_MAX = 512; | 74 | const F32 MAP_SCALE_MAX = 4096; |
75 | const F32 MAP_SCALE_INCREMENT = 16; | 75 | const F32 MAP_SCALE_INCREMENT = 16; |
76 | const F32 MAP_MIN_PICK_DIST = 4; | 76 | const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of the scroll wheel (4%) |
77 | const F32 MAP_MINOR_DIR_THRESHOLD = 0.08f; | 77 | const F32 MAP_MINOR_DIR_THRESHOLD = 0.08f; |
78 | const F32 MIN_DOT_RADIUS = 3.5f; | ||
79 | const F32 DOT_SCALE = 0.75f; | ||
80 | const F32 MIN_PICK_SCALE = 2.f; | ||
78 | const S32 SLOP = 2; | 81 | const S32 SLOP = 2; |
79 | |||
80 | const S32 TRACKING_RADIUS = 3; | 82 | const S32 TRACKING_RADIUS = 3; |
81 | 83 | ||
82 | LLNetMap::LLNetMap(const std::string& name) : | 84 | LLNetMap::LLNetMap(const std::string& name) : |
@@ -92,6 +94,7 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
92 | { | 94 | { |
93 | mScale = gSavedSettings.getF32("MiniMapScale"); | 95 | mScale = gSavedSettings.getF32("MiniMapScale"); |
94 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); | 96 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); |
97 | mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); | ||
95 | 98 | ||
96 | mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); | 99 | mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); |
97 | 100 | ||
@@ -151,6 +154,7 @@ void LLNetMap::setScale( F32 scale ) | |||
151 | } | 154 | } |
152 | 155 | ||
153 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); | 156 | mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); |
157 | mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); | ||
154 | 158 | ||
155 | mUpdateNow = TRUE; | 159 | mUpdateNow = TRUE; |
156 | } | 160 | } |
@@ -333,6 +337,7 @@ void LLNetMap::draw() | |||
333 | LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); | 337 | LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); |
334 | mClosestAgentToCursor.setNull(); | 338 | mClosestAgentToCursor.setNull(); |
335 | F32 closest_dist = F32_MAX; | 339 | F32 closest_dist = F32_MAX; |
340 | F32 min_pick_dist = mDotRadius * MIN_PICK_SCALE; | ||
336 | 341 | ||
337 | // Draw avatars | 342 | // Draw avatars |
338 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); | 343 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); |
@@ -377,14 +382,14 @@ void LLNetMap::draw() | |||
377 | } | 382 | } |
378 | // [/RLVa:KB] | 383 | // [/RLVa:KB] |
379 | 384 | ||
380 | |||
381 | LLWorldMapView::drawAvatar( | 385 | LLWorldMapView::drawAvatar( |
382 | pos_map.mV[VX], pos_map.mV[VY], | 386 | pos_map.mV[VX], pos_map.mV[VY], |
383 | glyph_color, | 387 | glyph_color, |
384 | pos_map.mV[VZ]); | 388 | pos_map.mV[VZ], |
389 | mDotRadius); | ||
385 | 390 | ||
386 | F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); | 391 | F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); |
387 | if(dist_to_cursor < MAP_MIN_PICK_DIST && dist_to_cursor < closest_dist) | 392 | if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist) |
388 | { | 393 | { |
389 | closest_dist = dist_to_cursor; | 394 | closest_dist = dist_to_cursor; |
390 | mClosestAgentToCursor = avatar_ids[i]; | 395 | mClosestAgentToCursor = avatar_ids[i]; |
@@ -413,10 +418,13 @@ void LLNetMap::draw() | |||
413 | // Draw dot for self avatar position | 418 | // Draw dot for self avatar position |
414 | pos_global = gAgent.getPositionGlobal(); | 419 | pos_global = gAgent.getPositionGlobal(); |
415 | pos_map = globalPosToView(pos_global, rotate_map); | 420 | pos_map = globalPosToView(pos_global, rotate_map); |
416 | LLUIImagePtr you = LLWorldMapView::sAvatarYouSmallImage; | 421 | LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; |
422 | S32 dot_width = llround(mDotRadius * 2.f); | ||
417 | you->draw( | 423 | you->draw( |
418 | llround(pos_map.mV[VX]) - you->getWidth()/2, | 424 | llround(pos_map.mV[VX] - mDotRadius), |
419 | llround(pos_map.mV[VY]) - you->getHeight()/2); | 425 | llround(pos_map.mV[VY] - mDotRadius), |
426 | dot_width, | ||
427 | dot_width); | ||
420 | 428 | ||
421 | // Draw frustum | 429 | // Draw frustum |
422 | F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); | 430 | F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); |
@@ -557,8 +565,12 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) | |||
557 | 565 | ||
558 | BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) | 566 | BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) |
559 | { | 567 | { |
560 | // note that clicks are reversed from what you'd think | 568 | // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in |
561 | setScale(llclamp(mScale - clicks*MAP_SCALE_INCREMENT, MAP_SCALE_MIN, MAP_SCALE_MAX)); | 569 | F32 scale = mScale; |
570 | |||
571 | scale *= pow(MAP_SCALE_ZOOM_FACTOR, -clicks); | ||
572 | setScale(llclamp(scale, MAP_SCALE_MIN, MAP_SCALE_MAX)); | ||
573 | |||
562 | return TRUE; | 574 | return TRUE; |
563 | } | 575 | } |
564 | 576 | ||
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h index 55fbe1f..800b825 100644 --- a/linden/indra/newview/llnetmap.h +++ b/linden/indra/newview/llnetmap.h | |||
@@ -95,7 +95,8 @@ private: | |||
95 | F32 mScale; // Size of a region in pixels | 95 | F32 mScale; // Size of a region in pixels |
96 | F32 mPixelsPerMeter; // world meters to map pixels | 96 | F32 mPixelsPerMeter; // world meters to map pixels |
97 | F32 mObjectMapTPM; // texels per meter on map | 97 | F32 mObjectMapTPM; // texels per meter on map |
98 | F32 mObjectMapPixels; // Width of object map in pixels; | 98 | F32 mObjectMapPixels; // Width of object map in pixels |
99 | F32 mDotRadius; // Size of avatar markers | ||
99 | F32 mTargetPanX; | 100 | F32 mTargetPanX; |
100 | F32 mTargetPanY; | 101 | F32 mTargetPanY; |
101 | F32 mCurPanX; | 102 | F32 mCurPanX; |
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index 90977ed..947bdfd 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp | |||
@@ -71,9 +71,10 @@ const S32 SCROLL_HINT_WIDTH = 65; | |||
71 | const F32 BIG_DOT_RADIUS = 5.f; | 71 | const F32 BIG_DOT_RADIUS = 5.f; |
72 | BOOL LLWorldMapView::sHandledLastClick = FALSE; | 72 | BOOL LLWorldMapView::sHandledLastClick = FALSE; |
73 | 73 | ||
74 | LLUIImagePtr LLWorldMapView::sAvatarYouSmallImage = NULL; | ||
75 | LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; | 74 | LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; |
76 | LLUIImagePtr LLWorldMapView::sAvatarLargeImage = NULL; | 75 | LLUIImagePtr LLWorldMapView::sAvatarYouImage = NULL; |
76 | LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = NULL; | ||
77 | LLUIImagePtr LLWorldMapView::sAvatarLevelImage = NULL; | ||
77 | LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; | 78 | LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; |
78 | LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; | 79 | LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; |
79 | 80 | ||
@@ -113,11 +114,12 @@ std::map<std::string,std::string> LLWorldMapView::sStringsMap; | |||
113 | 114 | ||
114 | void LLWorldMapView::initClass() | 115 | void LLWorldMapView::initClass() |
115 | { | 116 | { |
116 | sAvatarYouSmallImage = LLUI::getUIImage("map_avatar_you_8.tga"); | ||
117 | sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); | 117 | sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); |
118 | sAvatarLargeImage = LLUI::getUIImage("map_avatar_16.tga"); | 118 | sAvatarYouImage = LLUI::getUIImage("map_avatar_16.tga"); |
119 | sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_8.tga"); | 119 | sAvatarYouLargeImage = LLUI::getUIImage("map_avatar_you_32.tga"); |
120 | sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_8.tga"); | 120 | sAvatarLevelImage = LLUI::getUIImage("map_avatar_32.tga"); |
121 | sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_32.tga"); | ||
122 | sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_32.tga"); | ||
121 | 123 | ||
122 | sHomeImage = LLUI::getUIImage("map_home.tga"); | 124 | sHomeImage = LLUI::getUIImage("map_home.tga"); |
123 | sTelehubImage = LLUI::getUIImage("map_telehub.tga"); | 125 | sTelehubImage = LLUI::getUIImage("map_telehub.tga"); |
@@ -137,9 +139,10 @@ void LLWorldMapView::initClass() | |||
137 | // static | 139 | // static |
138 | void LLWorldMapView::cleanupClass() | 140 | void LLWorldMapView::cleanupClass() |
139 | { | 141 | { |
140 | sAvatarYouSmallImage = NULL; | ||
141 | sAvatarSmallImage = NULL; | 142 | sAvatarSmallImage = NULL; |
142 | sAvatarLargeImage = NULL; | 143 | sAvatarYouImage = NULL; |
144 | sAvatarYouLargeImage = NULL; | ||
145 | sAvatarLevelImage = NULL; | ||
143 | sAvatarAboveImage = NULL; | 146 | sAvatarAboveImage = NULL; |
144 | sAvatarBelowImage = NULL; | 147 | sAvatarBelowImage = NULL; |
145 | 148 | ||
@@ -764,7 +767,7 @@ void LLWorldMapView::draw() | |||
764 | 767 | ||
765 | // Now draw your avatar after all that other stuff. | 768 | // Now draw your avatar after all that other stuff. |
766 | LLVector3d pos_global = gAgent.getPositionGlobal(); | 769 | LLVector3d pos_global = gAgent.getPositionGlobal(); |
767 | drawImage(pos_global, sAvatarLargeImage); | 770 | drawImage(pos_global, sAvatarYouImage); |
768 | 771 | ||
769 | LLVector3 pos_map = globalPosToView(pos_global); | 772 | LLVector3 pos_map = globalPosToView(pos_global); |
770 | if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) | 773 | if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) |
@@ -1273,7 +1276,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, | |||
1273 | F32 dot_radius) | 1276 | F32 dot_radius) |
1274 | { | 1277 | { |
1275 | const F32 HEIGHT_THRESHOLD = 7.f; | 1278 | const F32 HEIGHT_THRESHOLD = 7.f; |
1276 | LLUIImagePtr dot_image = sAvatarSmallImage; | 1279 | LLUIImagePtr dot_image = sAvatarLevelImage; |
1277 | if(relative_z < -HEIGHT_THRESHOLD) | 1280 | if(relative_z < -HEIGHT_THRESHOLD) |
1278 | { | 1281 | { |
1279 | dot_image = sAvatarBelowImage; | 1282 | dot_image = sAvatarBelowImage; |
@@ -1282,9 +1285,13 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, | |||
1282 | { | 1285 | { |
1283 | dot_image = sAvatarAboveImage; | 1286 | dot_image = sAvatarAboveImage; |
1284 | } | 1287 | } |
1288 | |||
1289 | S32 dot_width = llround(dot_radius * 2.f); | ||
1285 | dot_image->draw( | 1290 | dot_image->draw( |
1286 | llround(x_pixels) - dot_image->getWidth()/2, | 1291 | llround(x_pixels - dot_radius), |
1287 | llround(y_pixels) - dot_image->getHeight()/2, | 1292 | llround(y_pixels - dot_radius), |
1293 | dot_width, | ||
1294 | dot_width, | ||
1288 | color); | 1295 | color); |
1289 | } | 1296 | } |
1290 | 1297 | ||
diff --git a/linden/indra/newview/llworldmapview.h b/linden/indra/newview/llworldmapview.h index b97dfb5..b6ab855 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 4800048..9b0e4c7 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"/> |