diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerparcelmgr.cpp | 270 |
1 files changed, 98 insertions, 172 deletions
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index ddc67d0..b151802 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp | |||
@@ -74,7 +74,6 @@ const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; | |||
74 | 74 | ||
75 | 75 | ||
76 | // Globals | 76 | // Globals |
77 | LLViewerParcelMgr *gParcelMgr = NULL; | ||
78 | 77 | ||
79 | U8* LLViewerParcelMgr::sPackedOverlay = NULL; | 78 | U8* LLViewerParcelMgr::sPackedOverlay = NULL; |
80 | 79 | ||
@@ -139,11 +138,8 @@ LLViewerParcelMgr::LLViewerParcelMgr() | |||
139 | mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; | 138 | mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; |
140 | resetSegments(mCollisionSegments); | 139 | resetSegments(mCollisionSegments); |
141 | 140 | ||
142 | mBlockedImageID.set(gViewerArt.getString("noentrylines.tga")); | 141 | mBlockedImage = gImageList.getImageFromFile("noentrylines.j2c"); |
143 | sBlockedImage = gImageList.getImage(mBlockedImageID, TRUE, TRUE); | 142 | mPassImage = gImageList.getImageFromFile("noentrypasslines.j2c"); |
144 | |||
145 | mPassImageID.set(gViewerArt.getString("noentrypasslines.tga")); | ||
146 | sPassImage = gImageList.getImage(mPassImageID, TRUE, TRUE); | ||
147 | 143 | ||
148 | S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS; | 144 | S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS; |
149 | sPackedOverlay = new U8[overlay_size]; | 145 | sPackedOverlay = new U8[overlay_size]; |
@@ -217,9 +213,7 @@ void LLViewerParcelMgr::dump() | |||
217 | 213 | ||
218 | LLViewerRegion* LLViewerParcelMgr::getSelectionRegion() | 214 | LLViewerRegion* LLViewerParcelMgr::getSelectionRegion() |
219 | { | 215 | { |
220 | if (!gWorldp) return NULL; | 216 | return LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
221 | |||
222 | return gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
223 | } | 217 | } |
224 | 218 | ||
225 | 219 | ||
@@ -436,11 +430,6 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelInRectangle() | |||
436 | 430 | ||
437 | void LLViewerParcelMgr::selectCollisionParcel() | 431 | void LLViewerParcelMgr::selectCollisionParcel() |
438 | { | 432 | { |
439 | if (!gWorldp) | ||
440 | { | ||
441 | return; | ||
442 | } | ||
443 | |||
444 | // BUG: Claim to be in the agent's region | 433 | // BUG: Claim to be in the agent's region |
445 | mWestSouth = gAgent.getRegion()->getOriginGlobal(); | 434 | mWestSouth = gAgent.getRegion()->getOriginGlobal(); |
446 | mEastNorth = mWestSouth; | 435 | mEastNorth = mWestSouth; |
@@ -483,11 +472,6 @@ void LLViewerParcelMgr::selectCollisionParcel() | |||
483 | LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &corner2, | 472 | LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &corner2, |
484 | BOOL snap_selection) | 473 | BOOL snap_selection) |
485 | { | 474 | { |
486 | if (!gWorldp) | ||
487 | { | ||
488 | return NULL; | ||
489 | } | ||
490 | |||
491 | sanitize_corners( corner1, corner2, mWestSouth, mEastNorth ); | 475 | sanitize_corners( corner1, corner2, mWestSouth, mEastNorth ); |
492 | 476 | ||
493 | // ...x isn't more than one meter away | 477 | // ...x isn't more than one meter away |
@@ -515,8 +499,8 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, | |||
515 | east_north_region_check.mdV[VX] -= 0.5; | 499 | east_north_region_check.mdV[VX] -= 0.5; |
516 | east_north_region_check.mdV[VY] -= 0.5; | 500 | east_north_region_check.mdV[VY] -= 0.5; |
517 | 501 | ||
518 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal(mWestSouth); | 502 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal(mWestSouth); |
519 | LLViewerRegion *region_other = gWorldp->getRegionFromPosGlobal( east_north_region_check ); | 503 | LLViewerRegion *region_other = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); |
520 | 504 | ||
521 | if(!region) | 505 | if(!region) |
522 | { | 506 | { |
@@ -689,8 +673,7 @@ F32 LLViewerParcelMgr::agentDrawDistance() const | |||
689 | 673 | ||
690 | BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const | 674 | BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const |
691 | { | 675 | { |
692 | if (!gWorldp) return FALSE; | 676 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); |
693 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | ||
694 | if (!region) return FALSE; | 677 | if (!region) return FALSE; |
695 | 678 | ||
696 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); | 679 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); |
@@ -703,8 +686,7 @@ BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const | |||
703 | 686 | ||
704 | BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const | 687 | BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const |
705 | { | 688 | { |
706 | if (!gWorldp) return FALSE; | 689 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); |
707 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | ||
708 | if (!region) return FALSE; | 690 | if (!region) return FALSE; |
709 | 691 | ||
710 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); | 692 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); |
@@ -717,8 +699,7 @@ BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const | |||
717 | 699 | ||
718 | BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const | 700 | BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const |
719 | { | 701 | { |
720 | if (!gWorldp) return FALSE; | 702 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); |
721 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | ||
722 | if (!region) return FALSE; | 703 | if (!region) return FALSE; |
723 | 704 | ||
724 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); | 705 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); |
@@ -731,8 +712,7 @@ BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const | |||
731 | 712 | ||
732 | BOOL LLViewerParcelMgr::isSoundLocal(const LLVector3d& pos_global) const | 713 | BOOL LLViewerParcelMgr::isSoundLocal(const LLVector3d& pos_global) const |
733 | { | 714 | { |
734 | if (!gWorldp) return FALSE; | 715 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); |
735 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); | ||
736 | if (!region) return FALSE; | 716 | if (!region) return FALSE; |
737 | 717 | ||
738 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); | 718 | LLViewerParcelOverlay* overlay = region->getParcelOverlay(); |
@@ -754,12 +734,12 @@ BOOL LLViewerParcelMgr::canHearSound(const LLVector3d &pos_global) const | |||
754 | } | 734 | } |
755 | else | 735 | else |
756 | { | 736 | { |
757 | if (gParcelMgr->getAgentParcel()->getSoundLocal()) | 737 | if (LLViewerParcelMgr::getInstance()->getAgentParcel()->getSoundLocal()) |
758 | { | 738 | { |
759 | // Not in same parcel, and agent parcel only has local sound | 739 | // Not in same parcel, and agent parcel only has local sound |
760 | return FALSE; | 740 | return FALSE; |
761 | } | 741 | } |
762 | else if (gParcelMgr->isSoundLocal(pos_global)) | 742 | else if (LLViewerParcelMgr::getInstance()->isSoundLocal(pos_global)) |
763 | { | 743 | { |
764 | // Not in same parcel, and target parcel only has local sound | 744 | // Not in same parcel, and target parcel only has local sound |
765 | return FALSE; | 745 | return FALSE; |
@@ -775,8 +755,7 @@ BOOL LLViewerParcelMgr::canHearSound(const LLVector3d &pos_global) const | |||
775 | 755 | ||
776 | BOOL LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const | 756 | BOOL LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const |
777 | { | 757 | { |
778 | if (!gWorldp) return FALSE; | 758 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(pos_global); |
779 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(pos_global); | ||
780 | if (region != gAgent.getRegion()) | 759 | if (region != gAgent.getRegion()) |
781 | { | 760 | { |
782 | // Can't be in the agent parcel if you're not in the same region. | 761 | // Can't be in the agent parcel if you're not in the same region. |
@@ -833,8 +812,7 @@ void LLViewerParcelMgr::render() | |||
833 | { | 812 | { |
834 | // Rendering is done in agent-coordinates, so need to supply | 813 | // Rendering is done in agent-coordinates, so need to supply |
835 | // an appropriate offset to the render code. | 814 | // an appropriate offset to the render code. |
836 | if (!gWorldp) return; | 815 | LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(mWestSouth); |
837 | LLViewerRegion* regionp = gWorldp->getRegionFromPosGlobal(mWestSouth); | ||
838 | if (!regionp) return; | 816 | if (!regionp) return; |
839 | 817 | ||
840 | renderHighlightSegments(mHighlightSegments, regionp); | 818 | renderHighlightSegments(mHighlightSegments, regionp); |
@@ -866,8 +844,7 @@ void LLViewerParcelMgr::sendParcelAccessListRequest(U32 flags) | |||
866 | return; | 844 | return; |
867 | } | 845 | } |
868 | 846 | ||
869 | if(!gWorldp) return; | 847 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
870 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
871 | if (!region) return; | 848 | if (!region) return; |
872 | 849 | ||
873 | LLMessageSystem *msg = gMessageSystem; | 850 | LLMessageSystem *msg = gMessageSystem; |
@@ -902,8 +879,7 @@ void LLViewerParcelMgr::sendParcelDwellRequest() | |||
902 | return; | 879 | return; |
903 | } | 880 | } |
904 | 881 | ||
905 | if(!gWorldp) return; | 882 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
906 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
907 | if (!region) return; | 883 | if (!region) return; |
908 | 884 | ||
909 | LLMessageSystem *msg = gMessageSystem; | 885 | LLMessageSystem *msg = gMessageSystem; |
@@ -935,8 +911,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) | |||
935 | east_north_region_check.mdV[VX] -= 0.5; | 911 | east_north_region_check.mdV[VX] -= 0.5; |
936 | east_north_region_check.mdV[VY] -= 0.5; | 912 | east_north_region_check.mdV[VY] -= 0.5; |
937 | 913 | ||
938 | if(!gWorldp) return; | 914 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
939 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
940 | if (!region) | 915 | if (!region) |
941 | { | 916 | { |
942 | // TODO: Add a force owner version of this alert. | 917 | // TODO: Add a force owner version of this alert. |
@@ -945,7 +920,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) | |||
945 | } | 920 | } |
946 | 921 | ||
947 | // BUG: Make work for cross-region selections | 922 | // BUG: Make work for cross-region selections |
948 | LLViewerRegion *region2 = gWorldp->getRegionFromPosGlobal( east_north_region_check ); | 923 | LLViewerRegion *region2 = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); |
949 | if (region != region2) | 924 | if (region != region2) |
950 | { | 925 | { |
951 | gViewerWindow->alertXml("CannotSetLandOwnerMultipleRegions"); | 926 | gViewerWindow->alertXml("CannotSetLandOwnerMultipleRegions"); |
@@ -992,8 +967,7 @@ void LLViewerParcelMgr::sendParcelGodForceToContent() | |||
992 | gViewerWindow->alertXml("CannotContentifyNothingSelected"); | 967 | gViewerWindow->alertXml("CannotContentifyNothingSelected"); |
993 | return; | 968 | return; |
994 | } | 969 | } |
995 | if(!gWorldp) return; | 970 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
996 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
997 | if (!region) | 971 | if (!region) |
998 | { | 972 | { |
999 | gViewerWindow->alertXml("CannotContentifyNoRegion"); | 973 | gViewerWindow->alertXml("CannotContentifyNoRegion"); |
@@ -1018,8 +992,7 @@ void LLViewerParcelMgr::sendParcelRelease() | |||
1018 | return; | 992 | return; |
1019 | } | 993 | } |
1020 | 994 | ||
1021 | if(!gWorldp) return; | 995 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
1022 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1023 | if (!region) | 996 | if (!region) |
1024 | { | 997 | { |
1025 | gViewerWindow->alertXml("CannotReleaseLandNoRegion"); | 998 | gViewerWindow->alertXml("CannotReleaseLandNoRegion"); |
@@ -1081,8 +1054,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( | |||
1081 | return NULL; | 1054 | return NULL; |
1082 | } | 1055 | } |
1083 | 1056 | ||
1084 | if(!gWorldp) return NULL; | 1057 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
1085 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1086 | if (!region) | 1058 | if (!region) |
1087 | { | 1059 | { |
1088 | gViewerWindow->alertXml("CannotBuyLandNoRegion"); | 1060 | gViewerWindow->alertXml("CannotBuyLandNoRegion"); |
@@ -1099,7 +1071,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( | |||
1099 | east_north_region_check.mdV[VX] -= 0.5; | 1071 | east_north_region_check.mdV[VX] -= 0.5; |
1100 | east_north_region_check.mdV[VY] -= 0.5; | 1072 | east_north_region_check.mdV[VY] -= 0.5; |
1101 | 1073 | ||
1102 | LLViewerRegion *region2 = gWorldp->getRegionFromPosGlobal( east_north_region_check ); | 1074 | LLViewerRegion *region2 = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); |
1103 | 1075 | ||
1104 | if (region != region2) | 1076 | if (region != region2) |
1105 | { | 1077 | { |
@@ -1192,8 +1164,7 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) | |||
1192 | gViewerWindow->alertXml("CannotDeedLandNoGroup"); | 1164 | gViewerWindow->alertXml("CannotDeedLandNoGroup"); |
1193 | return; | 1165 | return; |
1194 | } | 1166 | } |
1195 | if(!gWorldp) return; | 1167 | LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
1196 | LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1197 | if (!region) | 1168 | if (!region) |
1198 | { | 1169 | { |
1199 | gViewerWindow->alertXml("CannotDeedLandNoRegion"); | 1170 | gViewerWindow->alertXml("CannotDeedLandNoRegion"); |
@@ -1231,7 +1202,7 @@ void LLViewerParcelMgr::makeLandmarkAtSelection() | |||
1231 | global_center *= 0.5f; | 1202 | global_center *= 0.5f; |
1232 | 1203 | ||
1233 | LLViewerRegion* region; | 1204 | LLViewerRegion* region; |
1234 | region = gWorldp->getRegionFromPosGlobal(global_center); | 1205 | region = LLWorld::getInstance()->getRegionFromPosGlobal(global_center); |
1235 | 1206 | ||
1236 | LLVector3 west_south_bottom_region = region->getPosRegionFromGlobal( mWestSouth ); | 1207 | LLVector3 west_south_bottom_region = region->getPosRegionFromGlobal( mWestSouth ); |
1237 | LLVector3 east_north_top_region = region->getPosRegionFromGlobal( mEastNorth ); | 1208 | LLVector3 east_north_top_region = region->getPosRegionFromGlobal( mEastNorth ); |
@@ -1260,11 +1231,8 @@ const LLString& LLViewerParcelMgr::getAgentParcelName() const | |||
1260 | void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region) | 1231 | void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region) |
1261 | { | 1232 | { |
1262 | if(!parcel) return; | 1233 | if(!parcel) return; |
1263 | if(!gWorldp) return; | ||
1264 | //llinfos << "passed parcel: " << parcel->getName() << llendl; | ||
1265 | 1234 | ||
1266 | LLViewerRegion* region = use_agent_region ? | 1235 | LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
1267 | gAgent.getRegion() : gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1268 | if (!region) return; | 1236 | if (!region) return; |
1269 | //llinfos << "found region: " << region->getName() << llendl; | 1237 | //llinfos << "found region: " << region->getName() << llendl; |
1270 | 1238 | ||
@@ -1302,8 +1270,7 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag | |||
1302 | 1270 | ||
1303 | void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) | 1271 | void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) |
1304 | { | 1272 | { |
1305 | if(!gWorldp) return; | 1273 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos ); |
1306 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos ); | ||
1307 | if (!region) | 1274 | if (!region) |
1308 | { | 1275 | { |
1309 | return; | 1276 | return; |
@@ -1356,7 +1323,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) | |||
1356 | return; | 1323 | return; |
1357 | } | 1324 | } |
1358 | 1325 | ||
1359 | S32 parcels_per_edge = gParcelMgr->mParcelsPerEdge; | 1326 | S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; |
1360 | S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; | 1327 | S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; |
1361 | if (packed_overlay_size != expected_size) | 1328 | if (packed_overlay_size != expected_size) |
1362 | { | 1329 | { |
@@ -1374,7 +1341,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) | |||
1374 | expected_size); | 1341 | expected_size); |
1375 | 1342 | ||
1376 | LLHost host = msg->getSender(); | 1343 | LLHost host = msg->getSender(); |
1377 | LLViewerRegion *region = gWorldp->getRegion(host); | 1344 | LLViewerRegion *region = LLWorld::getInstance()->getRegion(host); |
1378 | if (region) | 1345 | if (region) |
1379 | { | 1346 | { |
1380 | region->mParcelOverlay->uncompressLandOverlay( sequence_id, sPackedOverlay ); | 1347 | region->mParcelOverlay->uncompressLandOverlay( sequence_id, sPackedOverlay ); |
@@ -1434,31 +1401,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1434 | if (sequence_id == SELECTED_PARCEL_SEQ_ID) | 1401 | if (sequence_id == SELECTED_PARCEL_SEQ_ID) |
1435 | { | 1402 | { |
1436 | // ...selected parcels report this sequence id | 1403 | // ...selected parcels report this sequence id |
1437 | gParcelMgr->mRequestResult = PARCEL_RESULT_SUCCESS; | 1404 | LLViewerParcelMgr::getInstance()->mRequestResult = PARCEL_RESULT_SUCCESS; |
1438 | parcel = gParcelMgr->mCurrentParcel; | 1405 | parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel; |
1439 | } | 1406 | } |
1440 | else if (sequence_id == HOVERED_PARCEL_SEQ_ID) | 1407 | else if (sequence_id == HOVERED_PARCEL_SEQ_ID) |
1441 | { | 1408 | { |
1442 | gParcelMgr->mHoverRequestResult = PARCEL_RESULT_SUCCESS; | 1409 | LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS; |
1443 | parcel = gParcelMgr->mHoverParcel; | 1410 | parcel = LLViewerParcelMgr::getInstance()->mHoverParcel; |
1444 | } | 1411 | } |
1445 | else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || | 1412 | else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || |
1446 | sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID || | 1413 | sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID || |
1447 | sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) | 1414 | sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) |
1448 | { | 1415 | { |
1449 | gParcelMgr->mHoverRequestResult = PARCEL_RESULT_SUCCESS; | 1416 | LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS; |
1450 | parcel = gParcelMgr->mCollisionParcel; | 1417 | parcel = LLViewerParcelMgr::getInstance()->mCollisionParcel; |
1451 | } | 1418 | } |
1452 | else if (sequence_id == 0 || sequence_id > gParcelMgr->mAgentParcelSequenceID) | 1419 | else if (sequence_id == 0 || sequence_id > LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID) |
1453 | { | 1420 | { |
1454 | // new agent parcel | 1421 | // new agent parcel |
1455 | gParcelMgr->mAgentParcelSequenceID = sequence_id; | 1422 | LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID = sequence_id; |
1456 | parcel = gParcelMgr->mAgentParcel; | 1423 | parcel = LLViewerParcelMgr::getInstance()->mAgentParcel; |
1457 | } | 1424 | } |
1458 | else | 1425 | else |
1459 | { | 1426 | { |
1460 | llinfos << "out of order agent parcel sequence id " << sequence_id | 1427 | llinfos << "out of order agent parcel sequence id " << sequence_id |
1461 | << " last good " << gParcelMgr->mAgentParcelSequenceID | 1428 | << " last good " << LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID |
1462 | << llendl; | 1429 | << llendl; |
1463 | return; | 1430 | return; |
1464 | } | 1431 | } |
@@ -1529,15 +1496,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1529 | parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override); | 1496 | parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override); |
1530 | parcel->unpackMessage(msg); | 1497 | parcel->unpackMessage(msg); |
1531 | 1498 | ||
1532 | if (parcel == gParcelMgr->mAgentParcel) | 1499 | if (parcel == LLViewerParcelMgr::getInstance()->mAgentParcel) |
1533 | { | 1500 | { |
1534 | S32 bitmap_size = gParcelMgr->mParcelsPerEdge | 1501 | S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge |
1535 | * gParcelMgr->mParcelsPerEdge | 1502 | * LLViewerParcelMgr::getInstance()->mParcelsPerEdge |
1536 | / 8; | 1503 | / 8; |
1537 | U8* bitmap = new U8[ bitmap_size ]; | 1504 | U8* bitmap = new U8[ bitmap_size ]; |
1538 | msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); | 1505 | msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); |
1539 | 1506 | ||
1540 | gParcelMgr->writeAgentParcelFromBitmap(bitmap); | 1507 | LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap); |
1541 | delete[] bitmap; | 1508 | delete[] bitmap; |
1542 | } | 1509 | } |
1543 | } | 1510 | } |
@@ -1546,80 +1513,79 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1546 | if (sequence_id == SELECTED_PARCEL_SEQ_ID) | 1513 | if (sequence_id == SELECTED_PARCEL_SEQ_ID) |
1547 | { | 1514 | { |
1548 | // Update selected counts | 1515 | // Update selected counts |
1549 | gParcelMgr->mCurrentParcelSelection->mSelectedSelfCount = self_count; | 1516 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedSelfCount = self_count; |
1550 | gParcelMgr->mCurrentParcelSelection->mSelectedOtherCount = other_count; | 1517 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedOtherCount = other_count; |
1551 | gParcelMgr->mCurrentParcelSelection->mSelectedPublicCount = public_count; | 1518 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedPublicCount = public_count; |
1552 | 1519 | ||
1553 | gParcelMgr->mCurrentParcelSelection->mSelectedMultipleOwners = | 1520 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedMultipleOwners = |
1554 | (request_result == PARCEL_RESULT_MULTIPLE); | 1521 | (request_result == PARCEL_RESULT_MULTIPLE); |
1555 | 1522 | ||
1556 | // Select the whole parcel | 1523 | // Select the whole parcel |
1557 | if(!gWorldp) return; | 1524 | LLViewerRegion* region = LLWorld::getInstance()->getRegion( msg->getSender() ); |
1558 | LLViewerRegion* region = gWorldp->getRegion( msg->getSender() ); | ||
1559 | if (region) | 1525 | if (region) |
1560 | { | 1526 | { |
1561 | if (!snap_selection) | 1527 | if (!snap_selection) |
1562 | { | 1528 | { |
1563 | // don't muck with the westsouth and eastnorth. | 1529 | // don't muck with the westsouth and eastnorth. |
1564 | // just highlight it | 1530 | // just highlight it |
1565 | LLVector3 west_south = region->getPosRegionFromGlobal(gParcelMgr->mWestSouth); | 1531 | LLVector3 west_south = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mWestSouth); |
1566 | LLVector3 east_north = region->getPosRegionFromGlobal(gParcelMgr->mEastNorth); | 1532 | LLVector3 east_north = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mEastNorth); |
1567 | 1533 | ||
1568 | gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); | 1534 | LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); |
1569 | gParcelMgr->writeHighlightSegments( | 1535 | LLViewerParcelMgr::getInstance()->writeHighlightSegments( |
1570 | west_south.mV[VX], | 1536 | west_south.mV[VX], |
1571 | west_south.mV[VY], | 1537 | west_south.mV[VY], |
1572 | east_north.mV[VX], | 1538 | east_north.mV[VX], |
1573 | east_north.mV[VY] ); | 1539 | east_north.mV[VY] ); |
1574 | gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = FALSE; | 1540 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = FALSE; |
1575 | } | 1541 | } |
1576 | else if (0 == local_id) | 1542 | else if (0 == local_id) |
1577 | { | 1543 | { |
1578 | // this is public land, just highlight the selection | 1544 | // this is public land, just highlight the selection |
1579 | gParcelMgr->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); | 1545 | LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); |
1580 | gParcelMgr->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); | 1546 | LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); |
1581 | 1547 | ||
1582 | gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); | 1548 | LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); |
1583 | gParcelMgr->writeHighlightSegments( | 1549 | LLViewerParcelMgr::getInstance()->writeHighlightSegments( |
1584 | aabb_min.mV[VX], | 1550 | aabb_min.mV[VX], |
1585 | aabb_min.mV[VY], | 1551 | aabb_min.mV[VY], |
1586 | aabb_max.mV[VX], | 1552 | aabb_max.mV[VX], |
1587 | aabb_max.mV[VY] ); | 1553 | aabb_max.mV[VY] ); |
1588 | gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = TRUE; | 1554 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE; |
1589 | } | 1555 | } |
1590 | else | 1556 | else |
1591 | { | 1557 | { |
1592 | gParcelMgr->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); | 1558 | LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); |
1593 | gParcelMgr->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); | 1559 | LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); |
1594 | 1560 | ||
1595 | // Owned land, highlight the boundaries | 1561 | // Owned land, highlight the boundaries |
1596 | S32 bitmap_size = gParcelMgr->mParcelsPerEdge | 1562 | S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge |
1597 | * gParcelMgr->mParcelsPerEdge | 1563 | * LLViewerParcelMgr::getInstance()->mParcelsPerEdge |
1598 | / 8; | 1564 | / 8; |
1599 | U8* bitmap = new U8[ bitmap_size ]; | 1565 | U8* bitmap = new U8[ bitmap_size ]; |
1600 | msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); | 1566 | msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); |
1601 | 1567 | ||
1602 | gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); | 1568 | LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); |
1603 | gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mHighlightSegments ); | 1569 | LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mHighlightSegments ); |
1604 | 1570 | ||
1605 | delete[] bitmap; | 1571 | delete[] bitmap; |
1606 | bitmap = NULL; | 1572 | bitmap = NULL; |
1607 | 1573 | ||
1608 | gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = TRUE; | 1574 | LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE; |
1609 | } | 1575 | } |
1610 | 1576 | ||
1611 | // Request access list information for this land | 1577 | // Request access list information for this land |
1612 | gParcelMgr->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); | 1578 | LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); |
1613 | 1579 | ||
1614 | // Request dwell for this land, if it's not public land. | 1580 | // Request dwell for this land, if it's not public land. |
1615 | gParcelMgr->mSelectedDwell = 0.f; | 1581 | LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f; |
1616 | if (0 != local_id) | 1582 | if (0 != local_id) |
1617 | { | 1583 | { |
1618 | gParcelMgr->sendParcelDwellRequest(); | 1584 | LLViewerParcelMgr::getInstance()->sendParcelDwellRequest(); |
1619 | } | 1585 | } |
1620 | 1586 | ||
1621 | gParcelMgr->mSelected = TRUE; | 1587 | LLViewerParcelMgr::getInstance()->mSelected = TRUE; |
1622 | gParcelMgr->notifyObservers(); | 1588 | LLViewerParcelMgr::getInstance()->notifyObservers(); |
1623 | } | 1589 | } |
1624 | } | 1590 | } |
1625 | else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || | 1591 | else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || |
@@ -1627,32 +1593,32 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1627 | sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) | 1593 | sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) |
1628 | { | 1594 | { |
1629 | // We're about to collide with this parcel | 1595 | // We're about to collide with this parcel |
1630 | gParcelMgr->mRenderCollision = TRUE; | 1596 | LLViewerParcelMgr::getInstance()->mRenderCollision = TRUE; |
1631 | gParcelMgr->mCollisionTimer.reset(); | 1597 | LLViewerParcelMgr::getInstance()->mCollisionTimer.reset(); |
1632 | 1598 | ||
1633 | // Differentiate this parcel if we are banned from it. | 1599 | // Differentiate this parcel if we are banned from it. |
1634 | if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) | 1600 | if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) |
1635 | { | 1601 | { |
1636 | gParcelMgr->mCollisionBanned = BA_BANNED; | 1602 | LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_BANNED; |
1637 | } | 1603 | } |
1638 | else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID) | 1604 | else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID) |
1639 | { | 1605 | { |
1640 | gParcelMgr->mCollisionBanned = BA_NOT_IN_GROUP; | 1606 | LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_IN_GROUP; |
1641 | } | 1607 | } |
1642 | else | 1608 | else |
1643 | { | 1609 | { |
1644 | gParcelMgr->mCollisionBanned = BA_NOT_ON_LIST; | 1610 | LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_ON_LIST; |
1645 | 1611 | ||
1646 | } | 1612 | } |
1647 | 1613 | ||
1648 | S32 bitmap_size = gParcelMgr->mParcelsPerEdge | 1614 | S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge |
1649 | * gParcelMgr->mParcelsPerEdge | 1615 | * LLViewerParcelMgr::getInstance()->mParcelsPerEdge |
1650 | / 8; | 1616 | / 8; |
1651 | U8* bitmap = new U8[ bitmap_size ]; | 1617 | U8* bitmap = new U8[ bitmap_size ]; |
1652 | msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); | 1618 | msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); |
1653 | 1619 | ||
1654 | gParcelMgr->resetSegments(gParcelMgr->mCollisionSegments); | 1620 | LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mCollisionSegments); |
1655 | gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mCollisionSegments ); | 1621 | LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mCollisionSegments ); |
1656 | 1622 | ||
1657 | delete[] bitmap; | 1623 | delete[] bitmap; |
1658 | bitmap = NULL; | 1624 | bitmap = NULL; |
@@ -1660,16 +1626,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1660 | } | 1626 | } |
1661 | else if (sequence_id == HOVERED_PARCEL_SEQ_ID) | 1627 | else if (sequence_id == HOVERED_PARCEL_SEQ_ID) |
1662 | { | 1628 | { |
1663 | LLViewerRegion *region = gWorldp->getRegion( msg->getSender() ); | 1629 | LLViewerRegion *region = LLWorld::getInstance()->getRegion( msg->getSender() ); |
1664 | if (region) | 1630 | if (region) |
1665 | { | 1631 | { |
1666 | gParcelMgr->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min ); | 1632 | LLViewerParcelMgr::getInstance()->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min ); |
1667 | gParcelMgr->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max ); | 1633 | LLViewerParcelMgr::getInstance()->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max ); |
1668 | } | 1634 | } |
1669 | else | 1635 | else |
1670 | { | 1636 | { |
1671 | gParcelMgr->mHoverWestSouth.clearVec(); | 1637 | LLViewerParcelMgr::getInstance()->mHoverWestSouth.clearVec(); |
1672 | gParcelMgr->mHoverEastNorth.clearVec(); | 1638 | LLViewerParcelMgr::getInstance()->mHoverEastNorth.clearVec(); |
1673 | } | 1639 | } |
1674 | } | 1640 | } |
1675 | else | 1641 | else |
@@ -1724,15 +1690,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use | |||
1724 | 1690 | ||
1725 | void optionally_start_music(const LLString& music_url) | 1691 | void optionally_start_music(const LLString& music_url) |
1726 | { | 1692 | { |
1727 | if (gSavedSettings.getWarning("FirstStreamingMusic")) | 1693 | if (gSavedSettings.getBOOL("AudioStreamingMusic")) |
1728 | { | ||
1729 | std::string* newstring = new std::string(music_url); | ||
1730 | gViewerWindow->alertXml("ParcelCanPlayMusic", | ||
1731 | callback_start_music, | ||
1732 | (void*)newstring); | ||
1733 | |||
1734 | } | ||
1735 | else if (gSavedSettings.getBOOL("AudioStreamingMusic")) | ||
1736 | { | 1694 | { |
1737 | // Make the user click the start button on the overlay bar. JC | 1695 | // Make the user click the start button on the overlay bar. JC |
1738 | // llinfos << "Starting parcel music " << music_url << llendl; | 1696 | // llinfos << "Starting parcel music " << music_url << llendl; |
@@ -1746,31 +1704,6 @@ void optionally_start_music(const LLString& music_url) | |||
1746 | } | 1704 | } |
1747 | } | 1705 | } |
1748 | 1706 | ||
1749 | |||
1750 | void callback_start_music(S32 option, void* data) | ||
1751 | { | ||
1752 | std::string* music_url = (std::string*)data; | ||
1753 | |||
1754 | if (0 == option) | ||
1755 | { | ||
1756 | gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); | ||
1757 | llinfos << "Starting first parcel music " << music_url << llendl; | ||
1758 | if ( gOverlayBar && gOverlayBar->musicPlaying()) | ||
1759 | { | ||
1760 | gAudiop->startInternetStream(music_url->c_str()); | ||
1761 | } | ||
1762 | } | ||
1763 | else | ||
1764 | { | ||
1765 | gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); | ||
1766 | } | ||
1767 | |||
1768 | gSavedSettings.setWarning("FirstStreamingMusic", FALSE); | ||
1769 | |||
1770 | delete music_url; | ||
1771 | music_url = NULL; | ||
1772 | } | ||
1773 | |||
1774 | // static | 1707 | // static |
1775 | void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) | 1708 | void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) |
1776 | { | 1709 | { |
@@ -1784,7 +1717,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void | |||
1784 | msg->getU32Fast( _PREHASH_Data, _PREHASH_Flags, message_flags); | 1717 | msg->getU32Fast( _PREHASH_Data, _PREHASH_Flags, message_flags); |
1785 | msg->getS32Fast( _PREHASH_Data, _PREHASH_LocalID, parcel_id); | 1718 | msg->getS32Fast( _PREHASH_Data, _PREHASH_LocalID, parcel_id); |
1786 | 1719 | ||
1787 | LLParcel* parcel = gParcelMgr->mCurrentParcel; | 1720 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel; |
1788 | if (!parcel) return; | 1721 | if (!parcel) return; |
1789 | 1722 | ||
1790 | if (parcel_id != parcel->getLocalID()) | 1723 | if (parcel_id != parcel->getLocalID()) |
@@ -1807,7 +1740,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void | |||
1807 | parcel->unpackAccessEntries(msg, &(parcel->mRenterList) ); | 1740 | parcel->unpackAccessEntries(msg, &(parcel->mRenterList) ); |
1808 | }*/ | 1741 | }*/ |
1809 | 1742 | ||
1810 | gParcelMgr->notifyObservers(); | 1743 | LLViewerParcelMgr::getInstance()->notifyObservers(); |
1811 | } | 1744 | } |
1812 | 1745 | ||
1813 | 1746 | ||
@@ -1826,10 +1759,10 @@ void LLViewerParcelMgr::processParcelDwellReply(LLMessageSystem* msg, void**) | |||
1826 | F32 dwell; | 1759 | F32 dwell; |
1827 | msg->getF32("Data", "Dwell", dwell); | 1760 | msg->getF32("Data", "Dwell", dwell); |
1828 | 1761 | ||
1829 | if (local_id == gParcelMgr->mCurrentParcel->getLocalID()) | 1762 | if (local_id == LLViewerParcelMgr::getInstance()->mCurrentParcel->getLocalID()) |
1830 | { | 1763 | { |
1831 | gParcelMgr->mSelectedDwell = dwell; | 1764 | LLViewerParcelMgr::getInstance()->mSelectedDwell = dwell; |
1832 | gParcelMgr->notifyObservers(); | 1765 | LLViewerParcelMgr::getInstance()->notifyObservers(); |
1833 | } | 1766 | } |
1834 | } | 1767 | } |
1835 | 1768 | ||
@@ -1845,8 +1778,7 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which) | |||
1845 | return; | 1778 | return; |
1846 | } | 1779 | } |
1847 | 1780 | ||
1848 | if(!gWorldp) return; | 1781 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); |
1849 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth ); | ||
1850 | if (!region) return; | 1782 | if (!region) return; |
1851 | 1783 | ||
1852 | LLMessageSystem* msg = gMessageSystem; | 1784 | LLMessageSystem* msg = gMessageSystem; |
@@ -1995,13 +1927,13 @@ void LLViewerParcelMgr::deedAlertCB(S32 option, void*) | |||
1995 | { | 1927 | { |
1996 | if (option == 0) | 1928 | if (option == 0) |
1997 | { | 1929 | { |
1998 | LLParcel* parcel = gParcelMgr->getParcelSelection()->getParcel(); | 1930 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); |
1999 | LLUUID group_id; | 1931 | LLUUID group_id; |
2000 | if(parcel) | 1932 | if(parcel) |
2001 | { | 1933 | { |
2002 | group_id = parcel->getGroupID(); | 1934 | group_id = parcel->getGroupID(); |
2003 | } | 1935 | } |
2004 | gParcelMgr->sendParcelDeed(group_id); | 1936 | LLViewerParcelMgr::getInstance()->sendParcelDeed(group_id); |
2005 | } | 1937 | } |
2006 | } | 1938 | } |
2007 | 1939 | ||
@@ -2034,8 +1966,7 @@ void LLViewerParcelMgr::startReleaseLand() | |||
2034 | } | 1966 | } |
2035 | 1967 | ||
2036 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; | 1968 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; |
2037 | if(!gWorldp) return; | 1969 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); |
2038 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | ||
2039 | if (!region) | 1970 | if (!region) |
2040 | { | 1971 | { |
2041 | gViewerWindow->alertXml("CannotReleaseLandRegionNotFound"); | 1972 | gViewerWindow->alertXml("CannotReleaseLandRegionNotFound"); |
@@ -2139,8 +2070,7 @@ void LLViewerParcelMgr::callbackDivideLand(S32 option, void* data) | |||
2139 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; | 2070 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; |
2140 | 2071 | ||
2141 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; | 2072 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; |
2142 | if(!gWorldp) return; | 2073 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); |
2143 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | ||
2144 | if (!region) | 2074 | if (!region) |
2145 | { | 2075 | { |
2146 | gViewerWindow->alertXml("CannotDivideLandNoRegion"); | 2076 | gViewerWindow->alertXml("CannotDivideLandNoRegion"); |
@@ -2198,8 +2128,7 @@ void LLViewerParcelMgr::callbackJoinLand(S32 option, void* data) | |||
2198 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; | 2128 | LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; |
2199 | 2129 | ||
2200 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; | 2130 | LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; |
2201 | if(!gWorldp) return; | 2131 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); |
2202 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | ||
2203 | if (!region) | 2132 | if (!region) |
2204 | { | 2133 | { |
2205 | gViewerWindow->alertXml("CannotJoinLandNoRegion"); | 2134 | gViewerWindow->alertXml("CannotJoinLandNoRegion"); |
@@ -2247,8 +2176,7 @@ void LLViewerParcelMgr::startDeedLandToGroup() | |||
2247 | } | 2176 | } |
2248 | 2177 | ||
2249 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; | 2178 | LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; |
2250 | if(!gWorldp) return; | 2179 | LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); |
2251 | LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); | ||
2252 | if (!region) | 2180 | if (!region) |
2253 | { | 2181 | { |
2254 | gViewerWindow->alertXml("CannotDeedLandNoRegion"); | 2182 | gViewerWindow->alertXml("CannotDeedLandNoRegion"); |
@@ -2273,8 +2201,8 @@ void LLViewerParcelMgr::startDeedLandToGroup() | |||
2273 | } | 2201 | } |
2274 | void LLViewerParcelMgr::reclaimParcel() | 2202 | void LLViewerParcelMgr::reclaimParcel() |
2275 | { | 2203 | { |
2276 | LLParcel* parcel = gParcelMgr->getParcelSelection()->getParcel(); | 2204 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); |
2277 | LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); | 2205 | LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); |
2278 | if(parcel && parcel->getOwnerID().notNull() | 2206 | if(parcel && parcel->getOwnerID().notNull() |
2279 | && (parcel->getOwnerID() != gAgent.getID()) | 2207 | && (parcel->getOwnerID() != gAgent.getID()) |
2280 | && regionp && (regionp->getOwner() == gAgent.getID())) | 2208 | && regionp && (regionp->getOwner() == gAgent.getID())) |
@@ -2296,7 +2224,7 @@ void LLViewerParcelMgr::releaseAlertCB(S32 option, void *) | |||
2296 | if (option == 0) | 2224 | if (option == 0) |
2297 | { | 2225 | { |
2298 | // Send the release message, not a force | 2226 | // Send the release message, not a force |
2299 | gParcelMgr->sendParcelRelease(); | 2227 | LLViewerParcelMgr::getInstance()->sendParcelRelease(); |
2300 | } | 2228 | } |
2301 | } | 2229 | } |
2302 | 2230 | ||
@@ -2399,8 +2327,6 @@ void sanitize_corners(const LLVector3d &corner1, | |||
2399 | 2327 | ||
2400 | void LLViewerParcelMgr::cleanupGlobals() | 2328 | void LLViewerParcelMgr::cleanupGlobals() |
2401 | { | 2329 | { |
2402 | delete gParcelMgr; | ||
2403 | gParcelMgr = NULL; | ||
2404 | LLParcelSelection::sNullSelection = NULL; | 2330 | LLParcelSelection::sNullSelection = NULL; |
2405 | } | 2331 | } |
2406 | 2332 | ||