diff options
Diffstat (limited to 'linden/indra/newview/llnetmap.cpp')
-rw-r--r-- | linden/indra/newview/llnetmap.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index ee853fe..9d92576 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
7 | * | 7 | * |
8 | * Copyright (c) 2001-2008, Linden Research, Inc. | 8 | * Copyright (c) 2001-2009, Linden Research, Inc. |
9 | * | 9 | * |
10 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
11 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -229,7 +229,7 @@ void LLNetMap::draw() | |||
229 | LLGLEnable scissor(GL_SCISSOR_TEST); | 229 | LLGLEnable scissor(GL_SCISSOR_TEST); |
230 | 230 | ||
231 | { | 231 | { |
232 | LLGLSNoTexture no_texture; | 232 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
233 | LLLocalClipRect clip(getLocalRect()); | 233 | LLLocalClipRect clip(getLocalRect()); |
234 | 234 | ||
235 | glMatrixMode(GL_MODELVIEW); | 235 | glMatrixMode(GL_MODELVIEW); |
@@ -289,8 +289,8 @@ void LLNetMap::draw() | |||
289 | 289 | ||
290 | 290 | ||
291 | // Draw using texture. | 291 | // Draw using texture. |
292 | LLViewerImage::bindTexture(regionp->getLand().getSTexture()); | 292 | gGL.getTexUnit(0)->bind(regionp->getLand().getSTexture()); |
293 | gGL.begin(LLVertexBuffer::QUADS); | 293 | gGL.begin(LLRender::QUADS); |
294 | gGL.texCoord2f(0.f, 1.f); | 294 | gGL.texCoord2f(0.f, 1.f); |
295 | gGL.vertex2f(left, top); | 295 | gGL.vertex2f(left, top); |
296 | gGL.texCoord2f(0.f, 0.f); | 296 | gGL.texCoord2f(0.f, 0.f); |
@@ -306,8 +306,8 @@ void LLNetMap::draw() | |||
306 | { | 306 | { |
307 | if (regionp->getLand().getWaterTexture()) | 307 | if (regionp->getLand().getWaterTexture()) |
308 | { | 308 | { |
309 | LLViewerImage::bindTexture(regionp->getLand().getWaterTexture()); | 309 | gGL.getTexUnit(0)->bind(regionp->getLand().getWaterTexture()); |
310 | gGL.begin(LLVertexBuffer::QUADS); | 310 | gGL.begin(LLRender::QUADS); |
311 | gGL.texCoord2f(0.f, 1.f); | 311 | gGL.texCoord2f(0.f, 1.f); |
312 | gGL.vertex2f(left, top); | 312 | gGL.vertex2f(left, top); |
313 | gGL.texCoord2f(0.f, 0.f); | 313 | gGL.texCoord2f(0.f, 0.f); |
@@ -353,11 +353,11 @@ void LLNetMap::draw() | |||
353 | map_center_agent.mV[VX] *= gMiniMapScale/region_width; | 353 | map_center_agent.mV[VX] *= gMiniMapScale/region_width; |
354 | map_center_agent.mV[VY] *= gMiniMapScale/region_width; | 354 | map_center_agent.mV[VY] *= gMiniMapScale/region_width; |
355 | 355 | ||
356 | LLViewerImage::bindTexture(mObjectImagep); | 356 | gGL.getTexUnit(0)->bind(mObjectImagep); |
357 | F32 image_half_width = 0.5f*mObjectMapPixels; | 357 | F32 image_half_width = 0.5f*mObjectMapPixels; |
358 | F32 image_half_height = 0.5f*mObjectMapPixels; | 358 | F32 image_half_height = 0.5f*mObjectMapPixels; |
359 | 359 | ||
360 | gGL.begin(LLVertexBuffer::QUADS); | 360 | gGL.begin(LLRender::QUADS); |
361 | gGL.texCoord2f(0.f, 1.f); | 361 | gGL.texCoord2f(0.f, 1.f); |
362 | gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); | 362 | gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); |
363 | gGL.texCoord2f(0.f, 0.f); | 363 | gGL.texCoord2f(0.f, 0.f); |
@@ -460,13 +460,13 @@ void LLNetMap::draw() | |||
460 | F32 ctr_y = (F32)center_sw_bottom; | 460 | F32 ctr_y = (F32)center_sw_bottom; |
461 | 461 | ||
462 | 462 | ||
463 | LLGLSNoTexture no_texture; | 463 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
464 | 464 | ||
465 | if( LLNetMap::sRotateMap ) | 465 | if( LLNetMap::sRotateMap ) |
466 | { | 466 | { |
467 | gGL.color4fv(gFrustumMapColor.mV); | 467 | gGL.color4fv(gFrustumMapColor.mV); |
468 | 468 | ||
469 | gGL.begin( LLVertexBuffer::TRIANGLES ); | 469 | gGL.begin( LLRender::TRIANGLES ); |
470 | gGL.vertex2f( ctr_x, ctr_y ); | 470 | gGL.vertex2f( ctr_x, ctr_y ); |
471 | gGL.vertex2f( ctr_x - half_width_pixels, ctr_y + far_clip_pixels ); | 471 | gGL.vertex2f( ctr_x - half_width_pixels, ctr_y + far_clip_pixels ); |
472 | gGL.vertex2f( ctr_x + half_width_pixels, ctr_y + far_clip_pixels ); | 472 | gGL.vertex2f( ctr_x + half_width_pixels, ctr_y + far_clip_pixels ); |
@@ -480,7 +480,7 @@ void LLNetMap::draw() | |||
480 | gGL.pushMatrix(); | 480 | gGL.pushMatrix(); |
481 | gGL.translatef( ctr_x, ctr_y, 0 ); | 481 | gGL.translatef( ctr_x, ctr_y, 0 ); |
482 | glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); | 482 | glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); |
483 | gGL.begin( LLVertexBuffer::TRIANGLES ); | 483 | gGL.begin( LLRender::TRIANGLES ); |
484 | gGL.vertex2f( 0, 0 ); | 484 | gGL.vertex2f( 0, 0 ); |
485 | gGL.vertex2f( -half_width_pixels, far_clip_pixels ); | 485 | gGL.vertex2f( -half_width_pixels, far_clip_pixels ); |
486 | gGL.vertex2f( half_width_pixels, far_clip_pixels ); | 486 | gGL.vertex2f( half_width_pixels, far_clip_pixels ); |
@@ -649,7 +649,11 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U & | |||
649 | LLVector3 local_pos; | 649 | LLVector3 local_pos; |
650 | local_pos.setVec( pos - mObjectImageCenterGlobal ); | 650 | local_pos.setVec( pos - mObjectImageCenterGlobal ); |
651 | 651 | ||
652 | S32 diameter_pixels = llround(2 * radius_meters * mObjectMapTPM); | 652 | // DEV-17370 - megaprims of size > 4096 cause lag. (go figger.) |
653 | const F32 MAX_RADIUS = 256.0f; | ||
654 | F32 radius_clamped = llmin(radius_meters, MAX_RADIUS); | ||
655 | |||
656 | S32 diameter_pixels = llround(2 * radius_clamped * mObjectMapTPM); | ||
653 | renderPoint( local_pos, color, diameter_pixels ); | 657 | renderPoint( local_pos, color, diameter_pixels ); |
654 | } | 658 | } |
655 | 659 | ||