aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llglsandbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llglsandbox.cpp')
-rw-r--r--linden/indra/newview/llglsandbox.cpp82
1 files changed, 38 insertions, 44 deletions
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp
index 31e1935..28b92fd 100644
--- a/linden/indra/newview/llglsandbox.cpp
+++ b/linden/indra/newview/llglsandbox.cpp
@@ -53,7 +53,7 @@
53#include "lltoolmgr.h" 53#include "lltoolmgr.h"
54#include "llselectmgr.h" 54#include "llselectmgr.h"
55#include "llhudmanager.h" 55#include "llhudmanager.h"
56#include "llsphere.h" 56#include "llrendersphere.h"
57#include "llviewerobjectlist.h" 57#include "llviewerobjectlist.h"
58#include "lltoolselectrect.h" 58#include "lltoolselectrect.h"
59#include "llviewerwindow.h" 59#include "llviewerwindow.h"
@@ -86,7 +86,7 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVecto
86 } 86 }
87 if(!mLookAt || mLookAt->isDead()) 87 if(!mLookAt || mLookAt->isDead())
88 { 88 {
89 mLookAt = (LLHUDEffectLookAt *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT); 89 mLookAt = (LLHUDEffectLookAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT);
90 mLookAt->setSourceObject(mAvatarObject); 90 mLookAt->setSourceObject(mAvatarObject);
91 } 91 }
92 92
@@ -103,7 +103,7 @@ BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVec
103 103
104 if(!mPointAt || mPointAt->isDead()) 104 if(!mPointAt || mPointAt->isDead())
105 { 105 {
106 mPointAt = (LLHUDEffectPointAt *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); 106 mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT);
107 mPointAt->setSourceObject(mAvatarObject); 107 mPointAt->setSourceObject(mAvatarObject);
108 } 108 }
109 109
@@ -181,8 +181,8 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
181 top = llround((F32) top * LLUI::sGLScaleFactor.mV[VY]); 181 top = llround((F32) top * LLUI::sGLScaleFactor.mV[VY]);
182 bottom = llround((F32) bottom * LLUI::sGLScaleFactor.mV[VY]); 182 bottom = llround((F32) bottom * LLUI::sGLScaleFactor.mV[VY]);
183 183
184 F32 old_far_plane = gCamera->getFar(); 184 F32 old_far_plane = LLViewerCamera::getInstance()->getFar();
185 F32 old_near_plane = gCamera->getNear(); 185 F32 old_near_plane = LLViewerCamera::getInstance()->getNear();
186 186
187 S32 width = right - left + 1; 187 S32 width = right - left + 1;
188 S32 height = top - bottom + 1; 188 S32 height = top - bottom + 1;
@@ -220,17 +220,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
220 { 220 {
221 // ...select distance from control 221 // ...select distance from control
222 LLVector3 relative_av_pos = av_pos; 222 LLVector3 relative_av_pos = av_pos;
223 relative_av_pos -= gCamera->getOrigin(); 223 relative_av_pos -= LLViewerCamera::getInstance()->getOrigin();
224 224
225 F32 new_far = relative_av_pos * gCamera->getAtAxis() + gSavedSettings.getF32("MaxSelectDistance"); 225 F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + gSavedSettings.getF32("MaxSelectDistance");
226 F32 new_near = relative_av_pos * gCamera->getAtAxis() - gSavedSettings.getF32("MaxSelectDistance"); 226 F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - gSavedSettings.getF32("MaxSelectDistance");
227 227
228 new_near = llmax(new_near, 0.1f); 228 new_near = llmax(new_near, 0.1f);
229 229
230 gCamera->setFar(new_far); 230 LLViewerCamera::getInstance()->setFar(new_far);
231 gCamera->setNear(new_near); 231 LLViewerCamera::getInstance()->setNear(new_near);
232 } 232 }
233 gCamera->setPerspective(FOR_SELECTION, 233 LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION,
234 center_x-width/2, center_y-height/2, width, height, 234 center_x-width/2, center_y-height/2, width, height,
235 limit_select_distance); 235 limit_select_distance);
236 236
@@ -245,17 +245,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
245 { 245 {
246 return true; 246 return true;
247 } 247 }
248 S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); 248 S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
249 switch (result) 249 switch (result)
250 { 250 {
251 case 0: 251 case 0:
252 gSelectMgr->unhighlightObjectOnly(vobjp); 252 LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp);
253 break; 253 break;
254 case 1: 254 case 1:
255 // check vertices 255 // check vertices
256 if (!gCamera->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) 256 if (!LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive))
257 { 257 {
258 gSelectMgr->unhighlightObjectOnly(vobjp); 258 LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp);
259 } 259 }
260 break; 260 break;
261 default: 261 default:
@@ -264,15 +264,15 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
264 return true; 264 return true;
265 } 265 }
266 } func; 266 } func;
267 gSelectMgr->getHighlightedObjects()->applyToObjects(&func); 267 LLSelectMgr::getInstance()->getHighlightedObjects()->applyToObjects(&func);
268 } 268 }
269 269
270 if (grow_selection) 270 if (grow_selection)
271 { 271 {
272 std::vector<LLDrawable*> potentials; 272 std::vector<LLDrawable*> potentials;
273 273
274 for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); 274 for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin();
275 iter != gWorldp->getRegionList().end(); ++iter) 275 iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
276 { 276 {
277 LLViewerRegion* region = *iter; 277 LLViewerRegion* region = *iter;
278 for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) 278 for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
@@ -280,7 +280,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
280 LLSpatialPartition* part = region->getSpatialPartition(i); 280 LLSpatialPartition* part = region->getSpatialPartition(i);
281 if (part) 281 if (part)
282 { 282 {
283 part->cull(*gCamera, &potentials, TRUE); 283 part->cull(*LLViewerCamera::getInstance(), &potentials, TRUE);
284 } 284 }
285 } 285 }
286 } 286 }
@@ -304,20 +304,20 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
304 continue; 304 continue;
305 } 305 }
306 306
307 S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); 307 S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
308 if (result) 308 if (result)
309 { 309 {
310 switch (result) 310 switch (result)
311 { 311 {
312 case 1: 312 case 1:
313 // check vertices 313 // check vertices
314 if (gCamera->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) 314 if (LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive))
315 { 315 {
316 gSelectMgr->highlightObjectOnly(vobjp); 316 LLSelectMgr::getInstance()->highlightObjectOnly(vobjp);
317 } 317 }
318 break; 318 break;
319 case 2: 319 case 2:
320 gSelectMgr->highlightObjectOnly(vobjp); 320 LLSelectMgr::getInstance()->highlightObjectOnly(vobjp);
321 break; 321 break;
322 default: 322 default:
323 break; 323 break;
@@ -332,8 +332,8 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
332 glMatrixMode(GL_MODELVIEW); 332 glMatrixMode(GL_MODELVIEW);
333 333
334 // restore camera 334 // restore camera
335 gCamera->setFar(old_far_plane); 335 LLViewerCamera::getInstance()->setFar(old_far_plane);
336 gCamera->setNear(old_near_plane); 336 LLViewerCamera::getInstance()->setNear(old_near_plane);
337 gViewerWindow->setup3DRender(); 337 gViewerWindow->setup3DRender();
338} 338}
339 339
@@ -343,10 +343,6 @@ static const F32 COMPASS_RANGE = 0.33f;
343 343
344void LLCompass::draw() 344void LLCompass::draw()
345{ 345{
346// S32 left, top, right, bottom;
347
348 if (!getVisible()) return;
349
350 glMatrixMode(GL_MODELVIEW); 346 glMatrixMode(GL_MODELVIEW);
351 gGL.pushMatrix(); 347 gGL.pushMatrix();
352 348
@@ -413,8 +409,6 @@ void LLCompass::draw()
413 409
414void LLHorizontalCompass::draw() 410void LLHorizontalCompass::draw()
415{ 411{
416 if (!getVisible()) return;
417
418 LLGLSUIDefault gls_ui; 412 LLGLSUIDefault gls_ui;
419 413
420 S32 width = getRect().getWidth(); 414 S32 width = getRect().getWidth();
@@ -423,7 +417,7 @@ void LLHorizontalCompass::draw()
423 417
424 if( mTexture ) 418 if( mTexture )
425 { 419 {
426 const LLVector3& at_axis = gCamera->getAtAxis(); 420 const LLVector3& at_axis = LLViewerCamera::getInstance()->getAtAxis();
427 F32 center = atan2( at_axis.mV[VX], at_axis.mV[VY] ); 421 F32 center = atan2( at_axis.mV[VX], at_axis.mV[VY] );
428 422
429 center += F_PI; 423 center += F_PI;
@@ -469,7 +463,7 @@ void LLWind::renderVectors()
469 S32 i,j; 463 S32 i,j;
470 F32 x,y; 464 F32 x,y;
471 465
472 F32 region_width_meters = gWorldPointer->getRegionWidthInMeters(); 466 F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters();
473 467
474 LLGLSNoTexture gls_no_texture; 468 LLGLSNoTexture gls_no_texture;
475 gGL.pushMatrix(); 469 gGL.pushMatrix();
@@ -524,10 +518,10 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
524 // resolves correctly so we can get a height value. 518 // resolves correctly so we can get a height value.
525 const F32 FUDGE = 0.01f; 519 const F32 FUDGE = 0.01f;
526 520
527 F32 sw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); 521 F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) );
528 F32 se_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); 522 F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) );
529 F32 ne_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); 523 F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) );
530 F32 nw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); 524 F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) );
531 525
532 F32 sw_top = sw_bottom + PARCEL_POST_HEIGHT; 526 F32 sw_top = sw_bottom + PARCEL_POST_HEIGHT;
533 F32 se_top = se_bottom + PARCEL_POST_HEIGHT; 527 F32 se_top = se_bottom + PARCEL_POST_HEIGHT;
@@ -601,10 +595,10 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel )
601 // resolves correctly so we can get a height value. 595 // resolves correctly so we can get a height value.
602 const F32 FUDGE = 0.01f; 596 const F32 FUDGE = 0.01f;
603 597
604 F32 sw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); 598 F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) );
605 F32 se_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); 599 F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) );
606 F32 ne_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); 600 F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) );
607 F32 nw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); 601 F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) );
608 602
609 // little hack to make nearby lines not Z-fight 603 // little hack to make nearby lines not Z-fight
610 east -= 0.1f; 604 east -= 0.1f;
@@ -856,11 +850,11 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV
856 850
857 if (use_pass && (mCollisionBanned == BA_NOT_ON_LIST)) 851 if (use_pass && (mCollisionBanned == BA_NOT_ON_LIST))
858 { 852 {
859 LLViewerImage::bindTexture( getPassImage() ); 853 LLViewerImage::bindTexture(mPassImage);
860 } 854 }
861 else 855 else
862 { 856 {
863 LLViewerImage::bindTexture( getBlockedImage() ); 857 LLViewerImage::bindTexture(mBlockedImage);
864 } 858 }
865 859
866 gGL.begin(GL_QUADS); 860 gGL.begin(GL_QUADS);
@@ -1013,7 +1007,7 @@ void LLViewerObjectList::renderObjectBeacons()
1013 } 1007 }
1014 1008
1015 S32 i; 1009 S32 i;
1016 //const LLFontGL *font = gResMgr->getRes(LLFONT_SANSSERIF); 1010 //const LLFontGL *font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF);
1017 1011
1018 LLGLSUIDefault gls_ui; 1012 LLGLSUIDefault gls_ui;
1019 1013