aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r--linden/indra/newview/llappviewer.cpp139
1 files changed, 97 insertions, 42 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index a026391..9afcfe6 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -427,6 +427,8 @@ static void settings_to_globals()
427 LLVOTree::sTreeFactor = gSavedSettings.getF32("RenderTreeLODFactor"); 427 LLVOTree::sTreeFactor = gSavedSettings.getF32("RenderTreeLODFactor");
428 LLVOAvatar::sLODFactor = gSavedSettings.getF32("RenderAvatarLODFactor"); 428 LLVOAvatar::sLODFactor = gSavedSettings.getF32("RenderAvatarLODFactor");
429 LLVOAvatar::sMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible"); 429 LLVOAvatar::sMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible");
430 LLVOVolume::sSculptSAThresh = gSavedSettings.getF32("RenderSculptSAThreshold");
431 LLVOVolume::sSculptSAMax = gSavedSettings.getF32("RenderSculptSAMax");
430 LLVOAvatar::sVisibleInFirstPerson = gSavedSettings.getBOOL("FirstPersonAvatarVisible"); 432 LLVOAvatar::sVisibleInFirstPerson = gSavedSettings.getBOOL("FirstPersonAvatarVisible");
431 // clamp auto-open time to some minimum usable value 433 // clamp auto-open time to some minimum usable value
432 LLFolderView::sAutoOpenTime = llmax(0.25f, gSavedSettings.getF32("FolderAutoOpenDelay")); 434 LLFolderView::sAutoOpenTime = llmax(0.25f, gSavedSettings.getF32("FolderAutoOpenDelay"));
@@ -612,6 +614,10 @@ bool LLAppViewer::init()
612 // 614 //
613 // OK to write stuff to logs now, we've now crash reported if necessary 615 // OK to write stuff to logs now, we've now crash reported if necessary
614 // 616 //
617
618 // Always add the version to the top of the log--makes debugging easier -- MC
619 llinfos << ViewerInfo::prettyInfo() << llendl;
620
615 if (!initConfiguration()) 621 if (!initConfiguration())
616 return false; 622 return false;
617 623
@@ -1289,35 +1295,6 @@ bool LLAppViewer::cleanup()
1289 1295
1290 llinfos << "Global stuff deleted" << llendflush; 1296 llinfos << "Global stuff deleted" << llendflush;
1291 1297
1292 if (gAudioStream)
1293 {
1294 // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
1295
1296 delete gAudioStream;
1297 gAudioStream = NULL;
1298 }
1299
1300 if (gAudiop)
1301 {
1302 // shut down the audio subsystem
1303
1304 bool want_longname = false;
1305 if (gAudiop->getDriverName(want_longname) == "FMOD")
1306 {
1307 // This hack exists because fmod likes to occasionally
1308 // crash or hang forever when shutting down, for no
1309 // apparent reason.
1310 llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush;
1311 }
1312 else
1313 {
1314 gAudiop->shutdown();
1315 }
1316
1317 delete gAudiop;
1318 gAudiop = NULL;
1319 }
1320
1321 // Note: this is where LLFeatureManager::getInstance()-> used to be deleted. 1298 // Note: this is where LLFeatureManager::getInstance()-> used to be deleted.
1322 1299
1323 // Patch up settings for next time 1300 // Patch up settings for next time
@@ -1328,13 +1305,17 @@ bool LLAppViewer::cleanup()
1328 llinfos << "Settings patched up" << llendflush; 1305 llinfos << "Settings patched up" << llendflush;
1329 1306
1330 // delete some of the files left around in the cache. 1307 // delete some of the files left around in the cache.
1331 removeCacheFiles("*.wav"); 1308 if (!gSavedSettings.getBOOL("KeepUnpackedCacheFiles"))
1309 {
1310 LL_INFOS("AppCache") << "Purging unpacked files..." << llendl;
1311 removeCacheFiles("*.wav");
1312 removeCacheFiles("*.lso");
1313 removeCacheFiles("*.dsf");
1314 removeCacheFiles("*.bodypart");
1315 removeCacheFiles("*.clothing");
1316 }
1332 removeCacheFiles("*.tmp"); 1317 removeCacheFiles("*.tmp");
1333 removeCacheFiles("*.lso");
1334 removeCacheFiles("*.out"); 1318 removeCacheFiles("*.out");
1335 removeCacheFiles("*.dsf");
1336 removeCacheFiles("*.bodypart");
1337 removeCacheFiles("*.clothing");
1338 1319
1339 llinfos << "Cache files removed" << llendflush; 1320 llinfos << "Cache files removed" << llendflush;
1340 1321
@@ -1553,6 +1534,36 @@ bool LLAppViewer::cleanup()
1553 end_messaging_system(); 1534 end_messaging_system();
1554 llinfos << "Message system deleted." << llendflush; 1535 llinfos << "Message system deleted." << llendflush;
1555 1536
1537 if (gAudioStream)
1538 {
1539 // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
1540
1541 delete gAudioStream;
1542 gAudioStream = NULL;
1543 }
1544
1545 if (gAudiop)
1546 {
1547 // shut down the audio subsystem
1548
1549 bool want_longname = false;
1550 if (gAudiop->getDriverName(want_longname) == "FMOD")
1551 {
1552 // This hack exists because fmod likes to occasionally
1553 // crash or hang forever when shutting down, for no
1554 // apparent reason.
1555 llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush;
1556 }
1557 else
1558 {
1559 gAudiop->shutdown();
1560 }
1561
1562 delete gAudiop;
1563 gAudiop = NULL;
1564 }
1565 llinfos << "Audio system deleted" << llendl;
1566
1556 // *NOTE:Mani - The following call is not thread safe. 1567 // *NOTE:Mani - The following call is not thread safe.
1557 LLCurl::cleanupClass(); 1568 LLCurl::cleanupClass();
1558 llinfos << "LLCurl cleaned up." << llendflush; 1569 llinfos << "LLCurl cleaned up." << llendflush;
@@ -2966,10 +2977,11 @@ bool LLAppViewer::initCache()
2966{ 2977{
2967 mPurgeCache = false; 2978 mPurgeCache = false;
2968 // Purge cache if user requested it 2979 // Purge cache if user requested it
2969 if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || 2980 if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || // cmd-line -- MC
2970 gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) 2981 gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) // ui -- MC
2971 { 2982 {
2972 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); 2983 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
2984 gSavedSettings.setBOOL("PurgeCacheOnStartup", FALSE);
2973 mPurgeCache = true; 2985 mPurgeCache = true;
2974 } 2986 }
2975 // Purge cache if it belongs to an old version 2987 // Purge cache if it belongs to an old version
@@ -2993,7 +3005,7 @@ bool LLAppViewer::initCache()
2993 cache_location = gSavedSettings.getString("CacheLocation"); 3005 cache_location = gSavedSettings.getString("CacheLocation");
2994 } 3006 }
2995 std::string new_cache_location = gSavedSettings.getString("NewCacheLocation"); 3007 std::string new_cache_location = gSavedSettings.getString("NewCacheLocation");
2996 if ((new_cache_location != cache_location) && new_cache_location != "") 3008 if (new_cache_location != cache_location)
2997 { 3009 {
2998 gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")); 3010 gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"));
2999 purgeCache(); // purge old cache 3011 purgeCache(); // purge old cache
@@ -3001,7 +3013,7 @@ bool LLAppViewer::initCache()
3001 cache_location = new_cache_location; 3013 cache_location = new_cache_location;
3002 } 3014 }
3003 3015
3004 if (!gDirUtilp->setCacheDir(cache_location)) 3016 if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")))
3005 { 3017 {
3006 LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL; 3018 LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL;
3007 gSavedSettings.setString("CacheLocation", ""); 3019 gSavedSettings.setString("CacheLocation", "");
@@ -3178,10 +3190,53 @@ bool LLAppViewer::initCache()
3178 3190
3179void LLAppViewer::purgeCache() 3191void LLAppViewer::purgeCache()
3180{ 3192{
3181 LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl; 3193 LL_INFOS("AppCache") << "Begin purging cachees..." << llendl;
3182 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); 3194 if (gSavedSettings.getBOOL("PurgeCacheOnStartup")) // purging from cmd line
3183 std::string mask = gDirUtilp->getDirDelimiter() + "*.*"; 3195 {
3184 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask); 3196 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
3197 removeCacheFiles("*.*");
3198 }
3199 else // purging cache from ui
3200 {
3201 if (gSavedSettings.getBOOL("ClearTextureCache"))
3202 {
3203 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
3204 gSavedSettings.setBOOL("ClearTextureCache", FALSE);
3205 }
3206
3207 if (gSavedSettings.getBOOL("ClearObjectCache"))
3208 {
3209 removeCacheFiles("*.slc");
3210 gSavedSettings.setBOOL("ClearObjectCache", FALSE);
3211 }
3212
3213 if (gSavedSettings.getBOOL("ClearInvCache"))
3214 {
3215 removeCacheFiles("*.inv.gz");
3216 removeCacheFiles(std::string(VFS_DATA_FILE_BASE) + "*");
3217 removeCacheFiles(std::string(VFS_INDEX_FILE_BASE) + "*");
3218 removeCacheFiles("*.lso");
3219 removeCacheFiles("*.bodypart");
3220 removeCacheFiles("*.clothing");
3221 gSavedSettings.setBOOL("ClearInvCache", FALSE);
3222 }
3223
3224 if (gSavedSettings.getBOOL("ClearNameCache"))
3225 {
3226 // ick @ not making these variables -- MC
3227 removeCacheFiles("name.cache");
3228 removeCacheFiles("avatar_name_cache.xml");
3229 removeCacheFiles("*.cached_mute");
3230 gSavedSettings.setBOOL("ClearNameCache", FALSE);
3231 }
3232
3233 if (gSavedSettings.getBOOL("ClearSoundsCache"))
3234 {
3235 removeCacheFiles("*.wav");
3236 removeCacheFiles("*.dsf");
3237 gSavedSettings.setBOOL("ClearSoundsCache", FALSE);
3238 }
3239 }
3185} 3240}
3186 3241
3187const std::string& LLAppViewer::getSecondLifeTitle() const 3242const std::string& LLAppViewer::getSecondLifeTitle() const