summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp70
1 files changed, 37 insertions, 33 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f19a33301a..78163adf47 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -44,6 +44,7 @@
#include "llviewertexturelist.h"
#include "llgroupmgr.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llwindow.h"
#include "llviewerstats.h"
@@ -78,6 +79,7 @@
#include "lllocationhistory.h"
#include "llfasttimerview.h"
#include "llvoicechannel.h"
+#include "llvoavatarself.h"
#include "llsidetray.h"
@@ -355,7 +357,7 @@ void request_initial_instant_messages()
if (!requested
&& gMessageSystem
&& LLMuteList::getInstance()->isLoaded()
- && gAgent.getAvatarObject())
+ && isAgentAvatarValid())
{
// Auto-accepted inventory items may require the avatar object
// to build a correct name. Likewise, inventory offers from
@@ -1166,8 +1168,8 @@ bool LLAppViewer::mainLoop()
if(!total_work_pending) //pause texture fetching threads if nothing to process.
{
- LLAppViewer::getTextureCache()->pause();
- LLAppViewer::getImageDecodeThread()->pause();
+ LLAppViewer::getTextureCache()->pause();
+ LLAppViewer::getImageDecodeThread()->pause();
LLAppViewer::getTextureFetch()->pause();
}
if(!total_io_pending) //pause file threads if nothing to process.
@@ -1525,6 +1527,8 @@ bool LLAppViewer::cleanup()
LLLocationHistory::getInstance()->save();
LLAvatarIconIDCache::getInstance()->save();
+
+ LLViewerMedia::saveCookieFile();
llinfos << "Shutting down Threads" << llendflush;
@@ -1645,7 +1649,7 @@ bool LLAppViewer::cleanup()
// HACK: Attempt to wait until the screen res. switch is complete.
ms_sleep(1000);
- LLWeb::loadURLExternal( gLaunchFileOnQuit );
+ LLWeb::loadURLExternal( gLaunchFileOnQuit, false );
llinfos << "File launched." << llendflush;
}
@@ -2494,9 +2498,9 @@ void LLAppViewer::cleanupSavedSettings()
gSavedSettings.setF32("MapScale", LLWorldMapView::sMapScale );
// Some things are cached in LLAgent.
- if (gAgent.mInitialized)
+ if (gAgent.isInitialized())
{
- gSavedSettings.setF32("RenderFarClip", gAgent.mDrawDistance);
+ gSavedSettings.setF32("RenderFarClip", gAgentCamera.mDrawDistance);
}
}
@@ -3044,29 +3048,29 @@ bool LLAppViewer::initCache()
if(!read_only)
{
- // Purge cache if user requested it
- if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
- gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
- {
- gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
+ // Purge cache if user requested it
+ if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
+ gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
+ {
+ gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
mPurgeCache = true;
- }
+ }
- // We have moved the location of the cache directory over time.
- migrateCacheDirectory();
-
- // Setup and verify the cache location
- std::string cache_location = gSavedSettings.getString("CacheLocation");
- std::string new_cache_location = gSavedSettings.getString("NewCacheLocation");
- if (new_cache_location != cache_location)
- {
- gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"));
- purgeCache(); // purge old cache
- gSavedSettings.setString("CacheLocation", new_cache_location);
- gSavedSettings.setString("CacheLocationTopFolder", gDirUtilp->getBaseFileName(new_cache_location));
- }
- }
+ // We have moved the location of the cache directory over time.
+ migrateCacheDirectory();
+ // Setup and verify the cache location
+ std::string cache_location = gSavedSettings.getString("CacheLocation");
+ std::string new_cache_location = gSavedSettings.getString("NewCacheLocation");
+ if (new_cache_location != cache_location)
+ {
+ gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"));
+ purgeCache(); // purge old cache
+ gSavedSettings.setString("CacheLocation", new_cache_location);
+ gSavedSettings.setString("CacheLocationTopFolder", gDirUtilp->getBaseFileName(new_cache_location));
+ }
+ }
+
if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")))
{
LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL;
@@ -3083,7 +3087,7 @@ bool LLAppViewer::initCache()
LLSplashScreen::update(LLTrans::getString("StartupInitializingTextureCache"));
// Init the texture cache
- // Allocate 80% of the cache size for textures
+ // Allocate 80% of the cache size for textures
const S32 MB = 1024*1024;
S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB;
const S64 MAX_CACHE_SIZE = 1024*MB;
@@ -3350,10 +3354,10 @@ void LLAppViewer::saveFinalSnapshot()
{
if (!mSavedFinalSnapshot && !gNoRender)
{
- gSavedSettings.setVector3d("FocusPosOnLogout", gAgent.calcFocusPositionTargetGlobal());
- gSavedSettings.setVector3d("CameraPosOnLogout", gAgent.calcCameraPositionTargetGlobal());
+ gSavedSettings.setVector3d("FocusPosOnLogout", gAgentCamera.calcFocusPositionTargetGlobal());
+ gSavedSettings.setVector3d("CameraPosOnLogout", gAgentCamera.calcCameraPositionTargetGlobal());
gViewerWindow->setCursor(UI_CURSOR_WAIT);
- gAgent.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch
+ gAgentCamera.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch
gSavedSettings.setBOOL("ShowParcelOwners", FALSE);
idle();
@@ -3635,7 +3639,7 @@ void LLAppViewer::idle()
// Handle pending gesture processing
static LLFastTimer::DeclareTimer ftm("Agent Position");
LLFastTimer t(ftm);
- LLGestureManager::instance().update();
+ LLGestureMgr::instance().update();
gAgent.updateAgentPosition(gFrameDTClamped, yaw, current_mouse.mX, current_mouse.mY);
}
@@ -3763,7 +3767,7 @@ void LLAppViewer::idle()
LLViewerJoystick::getInstance()->moveObjects();
}
- gAgent.updateCamera();
+ gAgentCamera.updateCamera();
}
// update media focus
@@ -4097,7 +4101,7 @@ void LLAppViewer::disconnectViewer()
LLFloaterInventory::cleanup();
gAgentWearables.cleanup();
-
+ gAgentCamera.cleanup();
// Also writes cached agent settings to gSavedSettings
gAgent.cleanup();