diff options
Diffstat (limited to 'linden/indra/newview/llmapresponders.cpp')
-rw-r--r-- | linden/indra/newview/llmapresponders.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/linden/indra/newview/llmapresponders.cpp b/linden/indra/newview/llmapresponders.cpp index 140f390..9d974f2 100644 --- a/linden/indra/newview/llmapresponders.cpp +++ b/linden/indra/newview/llmapresponders.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2006&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2006&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2006-2009, Linden Research, Inc. | 7 | * Copyright (c) 2006-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -57,6 +57,8 @@ void LLMapLayerResponder::result(const LLSD& result) | |||
57 | 57 | ||
58 | LLWorldMap::getInstance()->mMapLayers[agent_flags].clear(); | 58 | LLWorldMap::getInstance()->mMapLayers[agent_flags].clear(); |
59 | 59 | ||
60 | bool use_web_map_tiles = LLWorldMap::useWebMapTiles(); | ||
61 | |||
60 | LLSD::array_const_iterator iter; | 62 | LLSD::array_const_iterator iter; |
61 | BOOL adjust = FALSE; | 63 | BOOL adjust = FALSE; |
62 | for(iter = result["LayerData"].beginArray(); iter != result["LayerData"].endArray(); ++iter) | 64 | for(iter = result["LayerData"].beginArray(); iter != result["LayerData"].endArray(); ++iter) |
@@ -65,16 +67,24 @@ void LLMapLayerResponder::result(const LLSD& result) | |||
65 | 67 | ||
66 | LLWorldMapLayer new_layer; | 68 | LLWorldMapLayer new_layer; |
67 | new_layer.LayerDefined = TRUE; | 69 | new_layer.LayerDefined = TRUE; |
68 | new_layer.LayerImageID = layer_data["ImageID"]; | ||
69 | new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE); | ||
70 | gGL.getTexUnit(0)->bind(new_layer.LayerImage.get()); | ||
71 | new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP); | ||
72 | 70 | ||
73 | new_layer.LayerExtents.mLeft = layer_data["Left"]; | 71 | new_layer.LayerExtents.mLeft = layer_data["Left"]; |
74 | new_layer.LayerExtents.mRight = layer_data["Right"]; | 72 | new_layer.LayerExtents.mRight = layer_data["Right"]; |
75 | new_layer.LayerExtents.mBottom = layer_data["Bottom"]; | 73 | new_layer.LayerExtents.mBottom = layer_data["Bottom"]; |
76 | new_layer.LayerExtents.mTop = layer_data["Top"]; | 74 | new_layer.LayerExtents.mTop = layer_data["Top"]; |
77 | 75 | ||
76 | new_layer.LayerImageID = layer_data["ImageID"]; | ||
77 | // if (use_web_map_tiles) | ||
78 | // { | ||
79 | // new_layer.LayerImage = LLWorldMap::loadObjectsTile((U32)new_layer.LayerExtents.mLeft, (U32)new_layer.LayerExtents.mBottom); // no good... Maybe using of level 2 and higher web maps ? | ||
80 | // } | ||
81 | // else | ||
82 | // { | ||
83 | new_layer.LayerImage = gImageList.getImage(new_layer.LayerImageID, MIPMAP_TRUE, FALSE); | ||
84 | // } | ||
85 | gGL.getTexUnit(0)->bind(new_layer.LayerImage.get()); | ||
86 | new_layer.LayerImage->setAddressMode(LLTexUnit::TAM_CLAMP); | ||
87 | |||
78 | F32 x_meters = F32(new_layer.LayerExtents.mLeft*REGION_WIDTH_UNITS); | 88 | F32 x_meters = F32(new_layer.LayerExtents.mLeft*REGION_WIDTH_UNITS); |
79 | F32 y_meters = F32(new_layer.LayerExtents.mBottom*REGION_WIDTH_UNITS); | 89 | F32 y_meters = F32(new_layer.LayerExtents.mBottom*REGION_WIDTH_UNITS); |
80 | adjust = LLWorldMap::getInstance()->extendAABB(U32(x_meters), U32(y_meters), | 90 | adjust = LLWorldMap::getInstance()->extendAABB(U32(x_meters), U32(y_meters), |
@@ -163,7 +173,14 @@ void LLMapLayerResponder::result(const LLSD& result) | |||
163 | siminfo->mRegionFlags = region_flags; | 173 | siminfo->mRegionFlags = region_flags; |
164 | siminfo->mWaterHeight = (F32) water_height; | 174 | siminfo->mWaterHeight = (F32) water_height; |
165 | siminfo->mMapImageID[agent_flags] = image_id; | 175 | siminfo->mMapImageID[agent_flags] = image_id; |
166 | siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); | 176 | if (use_web_map_tiles) |
177 | { | ||
178 | siminfo->mCurrentImage = LLWorldMap::loadObjectsTile((U32)x_regions, (U32)y_regions); | ||
179 | } | ||
180 | else | ||
181 | { | ||
182 | siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); | ||
183 | } | ||
167 | siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP); | 184 | siminfo->mCurrentImage->setAddressMode(LLTexUnit::TAM_CLAMP); |
168 | gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get()); | 185 | gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get()); |
169 | 186 | ||