aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerregion.cpp68
1 files changed, 38 insertions, 30 deletions
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 88d8a40..51b1ebe 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2000-2007, Linden Research, Inc. 5 * Copyright (c) 2000-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -34,7 +35,6 @@
34#include "llhttpclient.h" 35#include "llhttpclient.h"
35#include "llregionflags.h" 36#include "llregionflags.h"
36#include "llregionhandle.h" 37#include "llregionhandle.h"
37#include "llsdmessagesystem.h"
38#include "llsurface.h" 38#include "llsurface.h"
39#include "message.h" 39#include "message.h"
40//#include "vmath.h" 40//#include "vmath.h"
@@ -43,6 +43,7 @@
43 43
44#include "llagent.h" 44#include "llagent.h"
45#include "llcallingcard.h" 45#include "llcallingcard.h"
46#include "llcaphttpsender.h"
46#include "lldir.h" 47#include "lldir.h"
47#include "lleventpoll.h" 48#include "lleventpoll.h"
48#include "llfloatergodtools.h" 49#include "llfloatergodtools.h"
@@ -57,6 +58,12 @@
57#include "llvocache.h" 58#include "llvocache.h"
58#include "llvoclouds.h" 59#include "llvoclouds.h"
59#include "llworld.h" 60#include "llworld.h"
61#include "viewer.h"
62
63// Viewer object cache version, change if object update
64// format changes. JC
65const U32 INDRA_OBJECT_CACHE_VERSION = 12;
66
60 67
61extern BOOL gNoRender; 68extern BOOL gNoRender;
62 69
@@ -161,6 +168,7 @@ LLViewerRegion::~LLViewerRegion()
161 delete mParcelOverlay; 168 delete mParcelOverlay;
162 delete mLandp; 169 delete mLandp;
163 delete mEventPoll; 170 delete mEventPoll;
171 LLHTTPSender::clearSender(mHost);
164 172
165 saveCache(); 173 saveCache();
166} 174}
@@ -441,7 +449,6 @@ LLVector3 LLViewerRegion::getCenterAgent() const
441 return gAgent.getPosAgentFromGlobal(mCenterGlobal); 449 return gAgent.getPosAgentFromGlobal(mCenterGlobal);
442} 450}
443 451
444
445void LLViewerRegion::setRegionNameAndZone(const char* name_and_zone) 452void LLViewerRegion::setRegionNameAndZone(const char* name_and_zone)
446{ 453{
447 LLString name_zone(name_and_zone); 454 LLString name_zone(name_and_zone);
@@ -724,21 +731,6 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const
724 return getComposition()->getValueScaled((F32)x, (F32)y); 731 return getComposition()->getValueScaled((F32)x, (F32)y);
725} 732}
726 733
727
728// ---------------- Friends ----------------
729
730std::ostream& operator<<(std::ostream &s, const LLViewerRegion &region)
731{
732 s << "{ ";
733 s << region.mHost;
734 s << " mOriginGlobal = " << region.getOriginGlobal()<< "\n";
735 s << "}";
736 return s;
737}
738
739
740// ---------------- Protected Member Functions ----------------
741
742void LLViewerRegion::calculateCenterGlobal() 734void LLViewerRegion::calculateCenterGlobal()
743{ 735{
744 mCenterGlobal = mOriginGlobal; 736 mCenterGlobal = mOriginGlobal;
@@ -754,7 +746,24 @@ void LLViewerRegion::calculateCenterGlobal()
754 } 746 }
755} 747}
756 748
749void LLViewerRegion::calculateCameraDistance()
750{
751 mCameraDistanceSquared = (F32)(gAgent.getCameraPositionGlobal() - getCenterGlobal()).magVecSquared();
752}
757 753
754// ---------------- Friends ----------------
755
756std::ostream& operator<<(std::ostream &s, const LLViewerRegion &region)
757{
758 s << "{ ";
759 s << region.mHost;
760 s << " mOriginGlobal = " << region.getOriginGlobal()<< "\n";
761 s << "}";
762 return s;
763}
764
765
766// ---------------- Protected Member Functions ----------------
758 767
759void LLViewerRegion::updateNetStats() 768void LLViewerRegion::updateNetStats()
760{ 769{
@@ -1293,35 +1302,34 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1293 capabilityNames.append("SendUserReport"); 1302 capabilityNames.append("SendUserReport");
1294 capabilityNames.append("SendUserReportWithScreenshot"); 1303 capabilityNames.append("SendUserReportWithScreenshot");
1295 capabilityNames.append("RequestTextureDownload"); 1304 capabilityNames.append("RequestTextureDownload");
1305 capabilityNames.append("UntrustedSimulatorMessage");
1306
1296 LLHTTPClient::post(url, capabilityNames, BaseCapabilitiesComplete::build(this)); 1307 LLHTTPClient::post(url, capabilityNames, BaseCapabilitiesComplete::build(this));
1297} 1308}
1298 1309
1299static 1310static
1300LLEventPoll* createViewerEventPoll(const std::string& url) 1311LLEventPoll* createViewerEventPoll(const std::string& url)
1301{ 1312{
1302 static LLHTTPNode eventRoot; 1313 return new LLEventPoll(url);
1303 static bool eventRootServicesAdded = false;
1304 if (!eventRootServicesAdded)
1305 {
1306 LLSDMessageSystem::useServices();
1307 LLHTTPRegistrar::buildAllServices(eventRoot);
1308 eventRootServicesAdded = true;
1309 }
1310
1311 return new LLEventPoll(url, eventRoot);
1312} 1314}
1313 1315
1314 1316
1315void LLViewerRegion::setCapability(const std::string& name, const std::string& url) 1317void LLViewerRegion::setCapability(const std::string& name, const std::string& url)
1316{ 1318{
1317 mCapabilities[name] = url; 1319 if(name == "EventQueueGet")
1318
1319 if (name == "EventQueueGet")
1320 { 1320 {
1321 delete mEventPoll; 1321 delete mEventPoll;
1322 mEventPoll = NULL; 1322 mEventPoll = NULL;
1323 mEventPoll = createViewerEventPoll(url); 1323 mEventPoll = createViewerEventPoll(url);
1324 } 1324 }
1325 else if(name == "UntrustedSimulatorMessage")
1326 {
1327 LLHTTPSender::setSender(mHost, new LLCapHTTPSender(url));
1328 }
1329 else
1330 {
1331 mCapabilities[name] = url;
1332 }
1325} 1333}
1326 1334
1327std::string LLViewerRegion::getCapability(const std::string& name) const 1335std::string LLViewerRegion::getCapability(const std::string& name) const