diff options
author | Jacek Antonelli | 2008-09-28 17:21:23 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-28 17:21:46 -0500 |
commit | 31e7c77a411d94bc87f0232588b339149bb29a49 (patch) | |
tree | 49e487700e91713e620e4d33f20b7f7afb5a2fa9 /linden/indra/newview/llappviewer.cpp | |
parent | Second Life viewer sources 1.21.2-RC (diff) | |
download | meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.zip meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.tar.gz meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.tar.bz2 meta-impy-31e7c77a411d94bc87f0232588b339149bb29a49.tar.xz |
Second Life viewer sources 1.21.3-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 9851e47..6c740dd 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -682,12 +682,11 @@ bool LLAppViewer::init() | |||
682 | LLUIImageList::getInstance(), | 682 | LLUIImageList::getInstance(), |
683 | ui_audio_callback, | 683 | ui_audio_callback, |
684 | &LLUI::sGLScaleFactor); | 684 | &LLUI::sGLScaleFactor); |
685 | |||
686 | LLWeb::initClass(); // do this after LLUI | 685 | LLWeb::initClass(); // do this after LLUI |
687 | LLTextEditor::setURLCallbacks(&LLWeb::loadURL, | 686 | LLTextEditor::setURLCallbacks(&LLWeb::loadURL, |
688 | &LLURLDispatcher::dispatchFromTextEditor, | 687 | &LLURLDispatcher::dispatchFromTextEditor, |
689 | &LLURLDispatcher::dispatchFromTextEditor); | 688 | &LLURLDispatcher::dispatchFromTextEditor); |
690 | 689 | ||
691 | LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set | 690 | LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set |
692 | 691 | ||
693 | ///////////////////////////////////////////////// | 692 | ///////////////////////////////////////////////// |
@@ -767,6 +766,8 @@ bool LLAppViewer::init() | |||
767 | CreateLCDDebugWindows(); | 766 | CreateLCDDebugWindows(); |
768 | #endif | 767 | #endif |
769 | 768 | ||
769 | LLFolderViewItem::initClass(); // SJB: Needs to happen after initWindow(), not sure why but related to fonts | ||
770 | |||
770 | gGLManager.getGLInfo(gDebugInfo); | 771 | gGLManager.getGLInfo(gDebugInfo); |
771 | gGLManager.printGLInfoString(); | 772 | gGLManager.printGLInfoString(); |
772 | 773 | ||
@@ -941,6 +942,7 @@ bool LLAppViewer::mainLoop() | |||
941 | LLFastTimer t3(LLFastTimer::FTM_IDLE); | 942 | LLFastTimer t3(LLFastTimer::FTM_IDLE); |
942 | idle(); | 943 | idle(); |
943 | 944 | ||
945 | if (gAres != NULL && gAres->isInitialized()) | ||
944 | { | 946 | { |
945 | pingMainloopTimeout("Main:ServicePump"); | 947 | pingMainloopTimeout("Main:ServicePump"); |
946 | LLFastTimer t4(LLFastTimer::FTM_PUMP); | 948 | LLFastTimer t4(LLFastTimer::FTM_PUMP); |
@@ -1077,14 +1079,17 @@ bool LLAppViewer::mainLoop() | |||
1077 | 1079 | ||
1078 | } | 1080 | } |
1079 | catch(std::bad_alloc) | 1081 | catch(std::bad_alloc) |
1080 | { | 1082 | { |
1081 | llwarns << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ; | ||
1082 | |||
1083 | //stop memory leaking simulation | 1083 | //stop memory leaking simulation |
1084 | if(LLFloaterMemLeak::getInstance()) | 1084 | if(LLFloaterMemLeak::getInstance()) |
1085 | { | 1085 | { |
1086 | LLFloaterMemLeak::getInstance()->stop() ; | 1086 | LLFloaterMemLeak::getInstance()->stop() ; |
1087 | } | 1087 | llwarns << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ; |
1088 | } | ||
1089 | else | ||
1090 | { | ||
1091 | llerrs << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ; | ||
1092 | } | ||
1088 | } | 1093 | } |
1089 | } | 1094 | } |
1090 | 1095 | ||
@@ -1279,6 +1284,7 @@ bool LLAppViewer::cleanup() | |||
1279 | //LLVolumeMgr::cleanupClass(); | 1284 | //LLVolumeMgr::cleanupClass(); |
1280 | LLPrimitive::cleanupVolumeManager(); | 1285 | LLPrimitive::cleanupVolumeManager(); |
1281 | LLWorldMapView::cleanupClass(); | 1286 | LLWorldMapView::cleanupClass(); |
1287 | LLFolderViewItem::cleanupClass(); | ||
1282 | LLUI::cleanupClass(); | 1288 | LLUI::cleanupClass(); |
1283 | 1289 | ||
1284 | // | 1290 | // |
@@ -1480,7 +1486,7 @@ bool LLAppViewer::initLogging() | |||
1480 | return true; | 1486 | return true; |
1481 | } | 1487 | } |
1482 | 1488 | ||
1483 | void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults) | 1489 | bool LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults) |
1484 | { | 1490 | { |
1485 | for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) | 1491 | for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) |
1486 | { | 1492 | { |
@@ -1515,13 +1521,24 @@ void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_default | |||
1515 | } | 1521 | } |
1516 | if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults)) | 1522 | if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults)) |
1517 | { | 1523 | { |
1518 | llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl; | 1524 | // If attempting to load the default global settings (app_settings/settings.xml) |
1525 | // fails, the app should error and quit. | ||
1526 | if(path_index == LL_PATH_APP_SETTINGS && settings_name == sGlobalSettingsName) | ||
1527 | { | ||
1528 | llwarns << "Error: Cannot load default settings from: " << full_settings_path << llendl; | ||
1529 | return false; | ||
1530 | } | ||
1531 | else | ||
1532 | { | ||
1533 | llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl; | ||
1534 | } | ||
1519 | } | 1535 | } |
1520 | else | 1536 | else |
1521 | { | 1537 | { |
1522 | llinfos << "Loaded settings file " << full_settings_path << llendl; | 1538 | llinfos << "Loaded settings file " << full_settings_path << llendl; |
1523 | } | 1539 | } |
1524 | } | 1540 | } |
1541 | return true; | ||
1525 | } | 1542 | } |
1526 | 1543 | ||
1527 | std::string LLAppViewer::getSettingsFileName(const std::string& file) | 1544 | std::string LLAppViewer::getSettingsFileName(const std::string& file) |
@@ -1563,7 +1580,19 @@ bool LLAppViewer::initConfiguration() | |||
1563 | 1580 | ||
1564 | // - load defaults | 1581 | // - load defaults |
1565 | bool set_defaults = true; | 1582 | bool set_defaults = true; |
1566 | loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults); | 1583 | if(!loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults)) |
1584 | { | ||
1585 | std::ostringstream msg; | ||
1586 | msg << "Second Life could not load its default settings file. \n" | ||
1587 | << "The installation may be corrupted. \n"; | ||
1588 | |||
1589 | OSMessageBox( | ||
1590 | msg.str(), | ||
1591 | LLStringUtil::null, | ||
1592 | OSMB_OK); | ||
1593 | |||
1594 | return false; | ||
1595 | } | ||
1567 | 1596 | ||
1568 | // - set procedural settings | 1597 | // - set procedural settings |
1569 | gSavedSettings.setString("ClientSettingsFile", | 1598 | gSavedSettings.setString("ClientSettingsFile", |
@@ -1710,7 +1739,7 @@ bool LLAppViewer::initConfiguration() | |||
1710 | 1739 | ||
1711 | OSMessageBox( | 1740 | OSMessageBox( |
1712 | msg.str().c_str(), | 1741 | msg.str().c_str(), |
1713 | NULL, | 1742 | LLStringUtil::null, |
1714 | OSMB_OK); | 1743 | OSMB_OK); |
1715 | 1744 | ||
1716 | return false; | 1745 | return false; |
@@ -2331,6 +2360,11 @@ void LLAppViewer::handleViewerCrash() | |||
2331 | { | 2360 | { |
2332 | gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); | 2361 | gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); |
2333 | gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName(); | 2362 | gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName(); |
2363 | |||
2364 | const LLVector3& loc = gAgent.getPositionAgent(); | ||
2365 | gDebugInfo["CurrentLocationX"] = loc.mV[0]; | ||
2366 | gDebugInfo["CurrentLocationY"] = loc.mV[1]; | ||
2367 | gDebugInfo["CurrentLocationZ"] = loc.mV[2]; | ||
2334 | } | 2368 | } |
2335 | 2369 | ||
2336 | if(LLAppViewer::instance()->mMainloopTimeout) | 2370 | if(LLAppViewer::instance()->mMainloopTimeout) |