aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-10-17 20:01:38 -0500
committerJacek Antonelli2008-10-17 20:01:38 -0500
commitfdf944fb0355249d73c4e25ee86e9ffd378e7d4b (patch)
tree2e5c51fe0e6d5757f984721e01cc097801d927e7 /linden/indra/newview/llappviewer.cpp
parentRebranded Windows-specific installer/support files. (diff)
parentUpdated source to SL version 1.21.6. (diff)
downloadmeta-impy-fdf944fb0355249d73c4e25ee86e9ffd378e7d4b.zip
meta-impy-fdf944fb0355249d73c4e25ee86e9ffd378e7d4b.tar.gz
meta-impy-fdf944fb0355249d73c4e25ee86e9ffd378e7d4b.tar.bz2
meta-impy-fdf944fb0355249d73c4e25ee86e9ffd378e7d4b.tar.xz
Merge branch 'merge-1.21.6' into rebranding
Conflicts: linden/indra/newview/installers/windows/installer_template.nsi linden/indra/newview/llappviewer.cpp
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llappviewer.cpp56
1 files changed, 45 insertions, 11 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 5b3e38d..7262759 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -686,12 +686,11 @@ bool LLAppViewer::init()
686 LLUIImageList::getInstance(), 686 LLUIImageList::getInstance(),
687 ui_audio_callback, 687 ui_audio_callback,
688 &LLUI::sGLScaleFactor); 688 &LLUI::sGLScaleFactor);
689
690 LLWeb::initClass(); // do this after LLUI 689 LLWeb::initClass(); // do this after LLUI
691 LLTextEditor::setURLCallbacks(&LLWeb::loadURL, 690 LLTextEditor::setURLCallbacks(&LLWeb::loadURL,
692 &LLURLDispatcher::dispatchFromTextEditor, 691 &LLURLDispatcher::dispatchFromTextEditor,
693 &LLURLDispatcher::dispatchFromTextEditor); 692 &LLURLDispatcher::dispatchFromTextEditor);
694 693
695 LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set 694 LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set
696 695
697 ///////////////////////////////////////////////// 696 /////////////////////////////////////////////////
@@ -771,6 +770,8 @@ bool LLAppViewer::init()
771 CreateLCDDebugWindows(); 770 CreateLCDDebugWindows();
772#endif 771#endif
773 772
773 LLFolderViewItem::initClass(); // SJB: Needs to happen after initWindow(), not sure why but related to fonts
774
774 gGLManager.getGLInfo(gDebugInfo); 775 gGLManager.getGLInfo(gDebugInfo);
775 gGLManager.printGLInfoString(); 776 gGLManager.printGLInfoString();
776 777
@@ -945,6 +946,7 @@ bool LLAppViewer::mainLoop()
945 LLFastTimer t3(LLFastTimer::FTM_IDLE); 946 LLFastTimer t3(LLFastTimer::FTM_IDLE);
946 idle(); 947 idle();
947 948
949 if (gAres != NULL && gAres->isInitialized())
948 { 950 {
949 pingMainloopTimeout("Main:ServicePump"); 951 pingMainloopTimeout("Main:ServicePump");
950 LLFastTimer t4(LLFastTimer::FTM_PUMP); 952 LLFastTimer t4(LLFastTimer::FTM_PUMP);
@@ -1081,14 +1083,17 @@ bool LLAppViewer::mainLoop()
1081 1083
1082 } 1084 }
1083 catch(std::bad_alloc) 1085 catch(std::bad_alloc)
1084 { 1086 {
1085 llwarns << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ;
1086
1087 //stop memory leaking simulation 1087 //stop memory leaking simulation
1088 if(LLFloaterMemLeak::getInstance()) 1088 if(LLFloaterMemLeak::getInstance())
1089 { 1089 {
1090 LLFloaterMemLeak::getInstance()->stop() ; 1090 LLFloaterMemLeak::getInstance()->stop() ;
1091 } 1091 llwarns << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ;
1092 }
1093 else
1094 {
1095 llerrs << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ;
1096 }
1092 } 1097 }
1093 } 1098 }
1094 1099
@@ -1283,6 +1288,7 @@ bool LLAppViewer::cleanup()
1283 //LLVolumeMgr::cleanupClass(); 1288 //LLVolumeMgr::cleanupClass();
1284 LLPrimitive::cleanupVolumeManager(); 1289 LLPrimitive::cleanupVolumeManager();
1285 LLWorldMapView::cleanupClass(); 1290 LLWorldMapView::cleanupClass();
1291 LLFolderViewItem::cleanupClass();
1286 LLUI::cleanupClass(); 1292 LLUI::cleanupClass();
1287 1293
1288 // 1294 //
@@ -1484,7 +1490,7 @@ bool LLAppViewer::initLogging()
1484 return true; 1490 return true;
1485} 1491}
1486 1492
1487void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults) 1493bool LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults)
1488{ 1494{
1489 for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) 1495 for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr)
1490 { 1496 {
@@ -1519,13 +1525,24 @@ void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_default
1519 } 1525 }
1520 if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults)) 1526 if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults))
1521 { 1527 {
1522 llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl; 1528 // If attempting to load the default global settings (app_settings/settings.xml)
1529 // fails, the app should error and quit.
1530 if(path_index == LL_PATH_APP_SETTINGS && settings_name == sGlobalSettingsName)
1531 {
1532 llwarns << "Error: Cannot load default settings from: " << full_settings_path << llendl;
1533 return false;
1534 }
1535 else
1536 {
1537 llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl;
1538 }
1523 } 1539 }
1524 else 1540 else
1525 { 1541 {
1526 llinfos << "Loaded settings file " << full_settings_path << llendl; 1542 llinfos << "Loaded settings file " << full_settings_path << llendl;
1527 } 1543 }
1528 } 1544 }
1545 return true;
1529} 1546}
1530 1547
1531std::string LLAppViewer::getSettingsFileName(const std::string& file) 1548std::string LLAppViewer::getSettingsFileName(const std::string& file)
@@ -1567,7 +1584,19 @@ bool LLAppViewer::initConfiguration()
1567 1584
1568 // - load defaults 1585 // - load defaults
1569 bool set_defaults = true; 1586 bool set_defaults = true;
1570 loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults); 1587 if(!loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults))
1588 {
1589 std::ostringstream msg;
1590 msg << "Second Life could not load its default settings file. \n"
1591 << "The installation may be corrupted. \n";
1592
1593 OSMessageBox(
1594 msg.str(),
1595 LLStringUtil::null,
1596 OSMB_OK);
1597
1598 return false;
1599 }
1571 1600
1572 // - set procedural settings 1601 // - set procedural settings
1573 gSavedSettings.setString("ClientSettingsFile", 1602 gSavedSettings.setString("ClientSettingsFile",
@@ -1714,7 +1743,7 @@ bool LLAppViewer::initConfiguration()
1714 1743
1715 OSMessageBox( 1744 OSMessageBox(
1716 msg.str().c_str(), 1745 msg.str().c_str(),
1717 NULL, 1746 LLStringUtil::null,
1718 OSMB_OK); 1747 OSMB_OK);
1719 1748
1720 return false; 1749 return false;
@@ -2339,6 +2368,11 @@ void LLAppViewer::handleViewerCrash()
2339 { 2368 {
2340 gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); 2369 gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName();
2341 gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName(); 2370 gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName();
2371
2372 const LLVector3& loc = gAgent.getPositionAgent();
2373 gDebugInfo["CurrentLocationX"] = loc.mV[0];
2374 gDebugInfo["CurrentLocationY"] = loc.mV[1];
2375 gDebugInfo["CurrentLocationZ"] = loc.mV[2];
2342 } 2376 }
2343 2377
2344 if(LLAppViewer::instance()->mMainloopTimeout) 2378 if(LLAppViewer::instance()->mMainloopTimeout)
@@ -2654,7 +2688,7 @@ bool LLAppViewer::initCache()
2654 std::string cache_dir = gDirUtilp->getOSUserAppDir(); 2688 std::string cache_dir = gDirUtilp->getOSUserAppDir();
2655 std::string new_cache_dir = gDirUtilp->getOSCacheDir(); 2689 std::string new_cache_dir = gDirUtilp->getOSCacheDir();
2656 cache_dir = cache_dir + "/cache"; 2690 cache_dir = cache_dir + "/cache";
2657 new_cache_dir = new_cache_dir + "/" + "SecondLife"; 2691 new_cache_dir = new_cache_dir + "/SecondLife";
2658 if (gDirUtilp->fileExists(cache_dir)) 2692 if (gDirUtilp->fileExists(cache_dir))
2659 { 2693 {
2660 gDirUtilp->setCacheDir(cache_dir); 2694 gDirUtilp->setCacheDir(cache_dir);