aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolbrush.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lltoolbrush.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/linden/indra/newview/lltoolbrush.cpp b/linden/indra/newview/lltoolbrush.cpp
index 2db1d5b..9572440 100644
--- a/linden/indra/newview/lltoolbrush.cpp
+++ b/linden/indra/newview/lltoolbrush.cpp
@@ -62,8 +62,6 @@
62const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terraforming.\n" 62const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terraforming.\n"
63 "You will need to buy land in another part of the world to terraform it."; 63 "You will need to buy land in another part of the world to terraform it.";
64 64
65// Globals
66LLToolBrushLand *gToolLand = NULL;
67 65
68///============================================================================ 66///============================================================================
69/// Local function declarations, constants, enums, and typedefs 67/// Local function declarations, constants, enums, and typedefs
@@ -182,12 +180,12 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global,
182 180
183void LLToolBrushLand::modifyLandInSelectionGlobal() 181void LLToolBrushLand::modifyLandInSelectionGlobal()
184{ 182{
185 if (gParcelMgr->selectionEmpty()) 183 if (LLViewerParcelMgr::getInstance()->selectionEmpty())
186 { 184 {
187 return; 185 return;
188 } 186 }
189 187
190 if (gToolMgr->getCurrentTool() == gToolParcel) 188 if (LLToolMgr::getInstance()->getCurrentTool() == LLToolSelectLand::getInstance())
191 { 189 {
192 // selecting land, don't do anything 190 // selecting land, don't do anything
193 return; 191 return;
@@ -196,7 +194,7 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
196 LLVector3d min; 194 LLVector3d min;
197 LLVector3d max; 195 LLVector3d max;
198 196
199 gParcelMgr->getSelection(min, max); 197 LLViewerParcelMgr::getInstance()->getSelection(min, max);
200 198
201 S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction"); 199 S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction");
202 200
@@ -306,8 +304,8 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
306 msg->addF32Fast(_PREHASH_Seconds, seconds); 304 msg->addF32Fast(_PREHASH_Seconds, seconds);
307 msg->addF32Fast(_PREHASH_Height, mStartingZ); 305 msg->addF32Fast(_PREHASH_Height, mStartingZ);
308 306
309 BOOL parcel_selected = gParcelMgr->getParcelSelection()->getWholeParcelSelected(); 307 BOOL parcel_selected = LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected();
310 LLParcel* selected_parcel = gParcelMgr->getParcelSelection()->getParcel(); 308 LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
311 309
312 if (parcel_selected && selected_parcel) 310 if (parcel_selected && selected_parcel)
313 { 311 {
@@ -376,7 +374,7 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask)
376 gIdleCallbacks.addFunction( &LLToolBrushLand::onIdle, (void*)this ); 374 gIdleCallbacks.addFunction( &LLToolBrushLand::onIdle, (void*)this );
377 setMouseCapture( TRUE ); 375 setMouseCapture( TRUE );
378 376
379 gParcelMgr->setSelectionVisible(FALSE); 377 LLViewerParcelMgr::getInstance()->setSelectionVisible(FALSE);
380 handled = TRUE; 378 handled = TRUE;
381 } 379 }
382 380
@@ -404,7 +402,7 @@ BOOL LLToolBrushLand::handleMouseUp(S32 x, S32 y, MASK mask)
404 // Release the mouse 402 // Release the mouse
405 setMouseCapture( FALSE ); 403 setMouseCapture( FALSE );
406 404
407 gParcelMgr->setSelectionVisible(TRUE); 405 LLViewerParcelMgr::getInstance()->setSelectionVisible(TRUE);
408 406
409 gIdleCallbacks.deleteFunction( &LLToolBrushLand::onIdle, (void*)this ); 407 gIdleCallbacks.deleteFunction( &LLToolBrushLand::onIdle, (void*)this );
410 handled = TRUE; 408 handled = TRUE;
@@ -435,7 +433,7 @@ void LLToolBrushLand::handleDeselect()
435 } 433 }
436 mLastShowParcelOwners = gSavedSettings.getBOOL("ShowParcelOwners"); 434 mLastShowParcelOwners = gSavedSettings.getBOOL("ShowParcelOwners");
437 gSavedSettings.setBOOL("ShowParcelOwners", mLastShowParcelOwners); 435 gSavedSettings.setBOOL("ShowParcelOwners", mLastShowParcelOwners);
438 gParcelMgr->setSelectionVisible(TRUE); 436 LLViewerParcelMgr::getInstance()->setSelectionVisible(TRUE);
439 mBrushSelected = FALSE; 437 mBrushSelected = FALSE;
440} 438}
441 439
@@ -506,25 +504,25 @@ void LLToolBrushLand::determineAffectedRegions(region_list_t& regions,
506 corner.mdV[VX] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2); 504 corner.mdV[VX] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2);
507 corner.mdV[VY] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2); 505 corner.mdV[VY] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2);
508 LLViewerRegion* region = NULL; 506 LLViewerRegion* region = NULL;
509 region = gWorldPointer->getRegionFromPosGlobal(corner); 507 region = LLWorld::getInstance()->getRegionFromPosGlobal(corner);
510 if(region && regions.find(region) == regions.end()) 508 if(region && regions.find(region) == regions.end())
511 { 509 {
512 regions.insert(region); 510 regions.insert(region);
513 } 511 }
514 corner.mdV[VY] += LAND_BRUSH_SIZE[mBrushIndex]; 512 corner.mdV[VY] += LAND_BRUSH_SIZE[mBrushIndex];
515 region = gWorldPointer->getRegionFromPosGlobal(corner); 513 region = LLWorld::getInstance()->getRegionFromPosGlobal(corner);
516 if(region && regions.find(region) == regions.end()) 514 if(region && regions.find(region) == regions.end())
517 { 515 {
518 regions.insert(region); 516 regions.insert(region);
519 } 517 }
520 corner.mdV[VX] += LAND_BRUSH_SIZE[mBrushIndex]; 518 corner.mdV[VX] += LAND_BRUSH_SIZE[mBrushIndex];
521 region = gWorldPointer->getRegionFromPosGlobal(corner); 519 region = LLWorld::getInstance()->getRegionFromPosGlobal(corner);
522 if(region && regions.find(region) == regions.end()) 520 if(region && regions.find(region) == regions.end())
523 { 521 {
524 regions.insert(region); 522 regions.insert(region);
525 } 523 }
526 corner.mdV[VY] -= LAND_BRUSH_SIZE[mBrushIndex]; 524 corner.mdV[VY] -= LAND_BRUSH_SIZE[mBrushIndex];
527 region = gWorldPointer->getRegionFromPosGlobal(corner); 525 region = LLWorld::getInstance()->getRegionFromPosGlobal(corner);
528 if(region && regions.find(region) == regions.end()) 526 if(region && regions.find(region) == regions.end())
529 { 527 {
530 regions.insert(region); 528 regions.insert(region);
@@ -536,7 +534,7 @@ void LLToolBrushLand::onIdle( void* brush_tool )
536{ 534{
537 LLToolBrushLand* self = reinterpret_cast<LLToolBrushLand*>(brush_tool); 535 LLToolBrushLand* self = reinterpret_cast<LLToolBrushLand*>(brush_tool);
538 536
539 if( gToolMgr->getCurrentTool() == self ) 537 if( LLToolMgr::getInstance()->getCurrentTool() == self )
540 { 538 {
541 self->brush(); 539 self->brush();
542 } 540 }