diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r-- | indra/newview/llstartup.cpp | 268 |
1 files changed, 112 insertions, 156 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f7de5a8c35..daaa117a9c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -51,7 +51,6 @@ #include "llcameraview.h" #include "llviewercontrol.h" #include "lldir.h" -#include "lleconomy.h" #include "llerrorcontrol.h" #include "llfiltersd2xmlrpc.h" #include "llfocusmgr.h" @@ -324,8 +323,6 @@ BOOL idle_startup() static LLString password; static std::vector<const char*> requested_options; - static U32 region_size = 256; - static F32 region_scale = 1.f; static U64 first_sim_handle = 0; static LLHost first_sim; static std::string first_sim_seed_cap; @@ -376,11 +373,11 @@ BOOL idle_startup() // Initialize stuff that doesn't need data from simulators // - if (gFeatureManagerp->isSafe()) + if (LLFeatureManager::getInstance()->isSafe()) { gViewerWindow->alertXml("DisplaySetToSafe"); } - else if ((gSavedSettings.getS32("LastFeatureVersion") < gFeatureManagerp->getVersion()) && + else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && (gSavedSettings.getS32("LastFeatureVersion") != 0)) { gViewerWindow->alertXml("DisplaySetToRecommended"); @@ -390,7 +387,7 @@ BOOL idle_startup() gViewerWindow->alertXml(gViewerWindow->getInitAlert()); } - gSavedSettings.setS32("LastFeatureVersion", gFeatureManagerp->getVersion()); + gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion()); LLString xml_file = LLUI::locateSkin("xui_version.xml"); LLXMLNodePtr root; @@ -536,11 +533,6 @@ BOOL idle_startup() } } - // initialize the economy - gGlobalEconomy = new LLGlobalEconomy(); - - - //------------------------------------------------- // Init audio, which may be needed for prefs dialog // or audio cues in connection UI. @@ -701,24 +693,19 @@ BOOL idle_startup() // skip directly to message template verification LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } - - // Create selection manager - // Must be done before menus created, because many enabled callbacks - // require its existance. - gSelectMgr = new LLSelectMgr(); - gParcelMgr = new LLViewerParcelMgr(); - gHUDManager = new LLHUDManager(); - gMuteListp = new LLMuteList(); + + // *NOTE: This is where LLViewerParcelMgr::getInstance() used to get allocated before becoming LLViewerParcelMgr::getInstance(). + + // *NOTE: This is where gHUDManager used to bet allocated before becoming LLHUDManager::getInstance(). + + // *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance(). // Initialize UI if (!gNoRender) { // Initialize all our tools. Must be done after saved settings loaded. - if ( gToolMgr == NULL ) - { - gToolMgr = new LLToolMgr(); - gToolMgr->initTools(); - } + // NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton. + LLToolMgr::getInstance()->initTools(); // Quickly get something onscreen to look at. gViewerWindow->initWorldUI(); @@ -920,11 +907,8 @@ BOOL idle_startup() //#define LL_MINIMIAL_REQUESTED_OPTIONS gDebugInfo["GridName"] = gGridInfo[gGridChoice].mLabel; - lldebugs << "STATE_LOGIN_AUTH_INIT" << llendl; - if (!gUserAuthp) - { - gUserAuthp = new LLUserAuth(); - } + // *Note: this is where gUserAuth used to be created. + requested_options.clear(); requested_options.push_back("inventory-root"); requested_options.push_back("inventory-skeleton"); @@ -1009,7 +993,7 @@ BOOL idle_startup() hashed_mac.hex_digest(hashed_mac_string); // TODO if statement here to use web_login_key - gUserAuthp->authenticate( + LLUserAuth::getInstance()->authenticate( sAuthUris[sAuthUriNum].c_str(), auth_method.c_str(), firstname.c_str(), @@ -1039,17 +1023,13 @@ BOOL idle_startup() // in curl, so take "may appear frozen" out of progress bar. JC auth_desc = "Logging in..."; set_startup_status(progress, auth_desc.c_str(), auth_message.c_str()); - if (!gUserAuthp) - { - llerrs << "No userauth in STATE_LOGIN_NO_DATA_YET!" << llendl; - } // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); - LLUserAuth::UserAuthcode error = gUserAuthp->authResponse(); + LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); if(LLUserAuth::E_NO_RESPONSE_YET == error) { //llinfos << "waiting..." << llendl; @@ -1064,17 +1044,13 @@ BOOL idle_startup() if(STATE_LOGIN_DOWNLOADING == LLStartUp::getStartupState()) { lldebugs << "STATE_LOGIN_DOWNLOADING" << llendl; - if (!gUserAuthp) - { - llerrs << "No userauth in STATE_LOGIN_DOWNLOADING!" << llendl; - } // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); - LLUserAuth::UserAuthcode error = gUserAuthp->authResponse(); + LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); if(LLUserAuth::E_DOWNLOADING == error) { //llinfos << "downloading..." << llendl; @@ -1095,14 +1071,14 @@ BOOL idle_startup() const char* reason_response = NULL; const char* message_response = NULL; BOOL successful_login = FALSE; - LLUserAuth::UserAuthcode error = gUserAuthp->authResponse(); + LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); // reset globals gAcceptTOS = FALSE; gAcceptCriticalMessage = FALSE; switch(error) { case LLUserAuth::E_OK: - login_response = gUserAuthp->getResponse("login"); + login_response = LLUserAuth::getInstance()->getResponse("login"); if(login_response && (0 == strcmp(login_response, "true"))) { // Yay, login! @@ -1111,10 +1087,10 @@ BOOL idle_startup() else if(login_response && (0 == strcmp(login_response, "indeterminate"))) { llinfos << "Indeterminate login..." << llendl; - sAuthUris = LLSRV::rewriteURI(gUserAuthp->getResponse("next_url")); + sAuthUris = LLSRV::rewriteURI(LLUserAuth::getInstance()->getResponse("next_url")); sAuthUriNum = 0; - auth_method = gUserAuthp->getResponse("next_method"); - auth_message = gUserAuthp->getResponse("message"); + auth_method = LLUserAuth::getInstance()->getResponse("next_method"); + auth_message = LLUserAuth::getInstance()->getResponse("message"); if(auth_method.substr(0, 5) == "login") { auth_desc.assign("Authenticating..."); @@ -1131,8 +1107,8 @@ BOOL idle_startup() else { emsg << "Login failed.\n"; - reason_response = gUserAuthp->getResponse("reason"); - message_response = gUserAuthp->getResponse("message"); + reason_response = LLUserAuth::getInstance()->getResponse("reason"); + message_response = LLUserAuth::getInstance()->getResponse("message"); if (gHideLinks && reason_response && (0 == strcmp(reason_response, "disabled"))) { @@ -1195,7 +1171,7 @@ BOOL idle_startup() } if(reason_response && (0 == strcmp(reason_response, "update"))) { - auth_message = gUserAuthp->getResponse("message"); + auth_message = LLUserAuth::getInstance()->getResponse("message"); if (show_connect_box) { update_app(TRUE, auth_message); @@ -1210,7 +1186,7 @@ BOOL idle_startup() if(reason_response && (0 == strcmp(reason_response, "optional"))) { llinfos << "Login got optional update" << llendl; - auth_message = gUserAuthp->getResponse("message"); + auth_message = LLUserAuth::getInstance()->getResponse("message"); if (show_connect_box) { update_app(FALSE, auth_message); @@ -1230,7 +1206,7 @@ BOOL idle_startup() if (sAuthUriNum >= (int) sAuthUris.size() - 1) { emsg << "Unable to connect to " << LLAppViewer::instance()->getSecondLifeTitle() << ".\n"; - emsg << gUserAuthp->errorMessage(); + emsg << LLUserAuth::getInstance()->errorMessage(); } else { sAuthUriNum++; std::ostringstream s; @@ -1246,33 +1222,27 @@ BOOL idle_startup() // Version update and we're not showing the dialog if(quit) { - delete gUserAuthp; - gUserAuthp = NULL; + LLUserAuth::getInstance()->reset(); LLAppViewer::instance()->forceQuit(); return FALSE; } if(successful_login) { - if (!gUserAuthp) - { - llerrs << "No userauth on successful login!" << llendl; - } - // unpack login data needed by the application const char* text; - text = gUserAuthp->getResponse("agent_id"); + text = LLUserAuth::getInstance()->getResponse("agent_id"); if(text) gAgentID.set(text); gDebugInfo["AgentID"] = text; - text = gUserAuthp->getResponse("session_id"); + text = LLUserAuth::getInstance()->getResponse("session_id"); if(text) gAgentSessionID.set(text); gDebugInfo["SessionID"] = text; - text = gUserAuthp->getResponse("secure_session_id"); + text = LLUserAuth::getInstance()->getResponse("secure_session_id"); if(text) gAgent.mSecureSessionID.set(text); - text = gUserAuthp->getResponse("first_name"); + text = LLUserAuth::getInstance()->getResponse("first_name"); if(text) { // Remove quotes from string. Login.cgi sends these to force @@ -1281,7 +1251,7 @@ BOOL idle_startup() LLString::replaceChar(firstname, '"', ' '); LLString::trim(firstname); } - text = gUserAuthp->getResponse("last_name"); + text = LLUserAuth::getInstance()->getResponse("last_name"); if(text) lastname.assign(text); gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); @@ -1297,7 +1267,7 @@ BOOL idle_startup() gSavedSettings.setBOOL("RememberPassword", remember_password); gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); - text = gUserAuthp->getResponse("agent_access"); + text = LLUserAuth::getInstance()->getResponse("agent_access"); if(text && (text[0] == 'M')) { gAgent.setTeen(false); @@ -1307,15 +1277,15 @@ BOOL idle_startup() gAgent.setTeen(true); } - text = gUserAuthp->getResponse("start_location"); + text = LLUserAuth::getInstance()->getResponse("start_location"); if(text) agent_start_location.assign(text); - text = gUserAuthp->getResponse("circuit_code"); + text = LLUserAuth::getInstance()->getResponse("circuit_code"); if(text) { gMessageSystem->mOurCircuitCode = strtoul(text, NULL, 10); } - const char* sim_ip_str = gUserAuthp->getResponse("sim_ip"); - const char* sim_port_str = gUserAuthp->getResponse("sim_port"); + const char* sim_ip_str = LLUserAuth::getInstance()->getResponse("sim_ip"); + const char* sim_port_str = LLUserAuth::getInstance()->getResponse("sim_port"); if(sim_ip_str && sim_port_str) { U32 sim_port = strtoul(sim_port_str, NULL, 10); @@ -1325,8 +1295,8 @@ BOOL idle_startup() gMessageSystem->enableCircuit(first_sim, TRUE); } } - const char* region_x_str = gUserAuthp->getResponse("region_x"); - const char* region_y_str = gUserAuthp->getResponse("region_y"); + const char* region_x_str = LLUserAuth::getInstance()->getResponse("region_x"); + const char* region_y_str = LLUserAuth::getInstance()->getResponse("region_y"); if(region_x_str && region_y_str) { U32 region_x = strtoul(region_x_str, NULL, 10); @@ -1334,7 +1304,7 @@ BOOL idle_startup() first_sim_handle = to_region_handle(region_x, region_y); } - const char* look_at_str = gUserAuthp->getResponse("look_at"); + const char* look_at_str = LLUserAuth::getInstance()->getResponse("look_at"); if (look_at_str) { #if !LL_WINDOWS && !LL_DARWIN @@ -1347,10 +1317,10 @@ BOOL idle_startup() agent_start_look_at = ll_vector3_from_sd(sd); } - text = gUserAuthp->getResponse("seed_capability"); + text = LLUserAuth::getInstance()->getResponse("seed_capability"); if (text) first_sim_seed_cap = text; - text = gUserAuthp->getResponse("seconds_since_epoch"); + text = LLUserAuth::getInstance()->getResponse("seconds_since_epoch"); if(text) { U32 server_utc_time = strtoul(text, NULL, 10); @@ -1361,7 +1331,7 @@ BOOL idle_startup() } } - const char* home_location = gUserAuthp->getResponse("home"); + const char* home_location = LLUserAuth::getInstance()->getResponse("home"); if(home_location) { #if !LL_WINDOWS && !LL_DARWIN @@ -1378,9 +1348,9 @@ BOOL idle_startup() gAgent.setHomePosRegion(region_handle, position); } - gAgent.mMOTD.assign(gUserAuthp->getResponse("message")); + gAgent.mMOTD.assign(LLUserAuth::getInstance()->getResponse("message")); LLUserAuth::options_t options; - if(gUserAuthp->getOptions("inventory-root", options)) + if(LLUserAuth::getInstance()->getOptions("inventory-root", options)) { LLUserAuth::response_t::iterator it; it = options[0].find("folder_id"); @@ -1392,7 +1362,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("login-flags", options)) + if(LLUserAuth::getInstance()->getOptions("login-flags", options)) { LLUserAuth::response_t::iterator it; LLUserAuth::response_t::iterator no_flag = options[0].end(); @@ -1420,7 +1390,7 @@ BOOL idle_startup() } } options.clear(); - if (gUserAuthp->getOptions("initial-outfit", options) + if (LLUserAuth::getInstance()->getOptions("initial-outfit", options) && !options.empty()) { LLUserAuth::response_t::iterator it; @@ -1438,7 +1408,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("global-textures", options)) + if(LLUserAuth::getInstance()->getOptions("global-textures", options)) { // Extract sun and moon texture IDs. These are used // in the LLVOSky constructor, but I can't figure out @@ -1553,11 +1523,11 @@ BOOL idle_startup() display_startup(); + // This is where we used to initialize gWorldp. Original comment said: // World initialization must be done after above window init - gWorldp = new LLWorld(region_size, region_scale); // User might have overridden far clip - gWorldp->setLandFarClip( gAgent.mDrawDistance ); + LLWorld::getInstance()->setLandFarClip( gAgent.mDrawDistance ); // Before we create the first region, we need to set the agent's mOriginGlobal // This is necessary because creating objects before this is set will result in a @@ -1565,9 +1535,9 @@ BOOL idle_startup() gAgent.initOriginGlobal(from_region_handle(first_sim_handle)); - gWorldp->addRegion(first_sim_handle, first_sim); + LLWorld::getInstance()->addRegion(first_sim_handle, first_sim); - LLViewerRegion *regionp = gWorldp->getRegionFromHandle(first_sim_handle); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle); llinfos << "Adding initial simulator " << regionp->getOriginGlobal() << llendl; LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); @@ -1603,7 +1573,7 @@ BOOL idle_startup() { update_texture_fetch(); - if ( gViewerWindow != NULL && gToolMgr != NULL ) + if ( gViewerWindow != NULL) { // This isn't the first logon attempt, so show the UI gViewerWindow->setNormalControlsVisible( TRUE ); } @@ -1659,18 +1629,14 @@ BOOL idle_startup() LLAppViewer::instance()->loadNameCache(); } - // Data storage for map of world. - if ( gWorldMap == NULL ) - { - gWorldMap = new LLWorldMap(); - } + // *Note: this is where gWorldMap used to be initialized. // register null callbacks for audio until the audio system is initialized gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL); //reset statistics - gViewerStats->resetStats(); + LLViewerStats::getInstance()->resetStats(); if (!gNoRender) { @@ -1700,14 +1666,14 @@ BOOL idle_startup() } // Make sure agent knows correct aspect ratio - gCamera->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); + LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); if (gViewerWindow->mWindow->getFullscreen()) { - gCamera->setAspect(gViewerWindow->getDisplayAspectRatio()); + LLViewerCamera::getInstance()->setAspect(gViewerWindow->getDisplayAspectRatio()); } else { - gCamera->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); + LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); } // Move agent to starting location. The position handed to us by @@ -1820,10 +1786,10 @@ BOOL idle_startup() // But not on first login, because you can't see your avatar then if (!gAgent.isFirstLogin()) { - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gHUDManager->sendEffects(); + LLHUDManager::getInstance()->sendEffects(); } LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT @@ -1869,17 +1835,12 @@ BOOL idle_startup() //--------------------------------------------------------------------- if (STATE_INVENTORY_SEND == LLStartUp::getStartupState()) { - if (!gUserAuthp) - { - llerrs << "No userauth in STATE_INVENTORY_SEND!" << llendl; - } - // unpack thin inventory LLUserAuth::options_t options; options.clear(); //bool dump_buffer = false; - if(gUserAuthp->getOptions("inventory-lib-root", options) + if(LLUserAuth::getInstance()->getOptions("inventory-lib-root", options) && !options.empty()) { // should only be one @@ -1891,7 +1852,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("inventory-lib-owner", options) + if(LLUserAuth::getInstance()->getOptions("inventory-lib-owner", options) && !options.empty()) { // should only be one @@ -1903,7 +1864,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("inventory-skel-lib", options) + if(LLUserAuth::getInstance()->getOptions("inventory-skel-lib", options) && gInventoryLibraryOwner.notNull()) { if(!gInventory.loadSkeleton(options, gInventoryLibraryOwner)) @@ -1912,7 +1873,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("inventory-skeleton", options)) + if(LLUserAuth::getInstance()->getOptions("inventory-skeleton", options)) { if(!gInventory.loadSkeleton(options, gAgent.getID())) { @@ -1922,7 +1883,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("buddy-list", options)) + if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) { LLUserAuth::options_t::iterator it = options.begin(); LLUserAuth::options_t::iterator end = options.end(); @@ -1953,7 +1914,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("ui-config", options)) + if(LLUserAuth::getInstance()->getOptions("ui-config", options)) { LLUserAuth::options_t::iterator it = options.begin(); LLUserAuth::options_t::iterator end = options.end(); @@ -1971,7 +1932,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("tutorial_setting", options)) + if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) { LLUserAuth::options_t::iterator it = options.begin(); LLUserAuth::options_t::iterator end = options.end(); @@ -1995,16 +1956,16 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("event_categories", options)) + if(LLUserAuth::getInstance()->getOptions("event_categories", options)) { LLEventInfo::loadCategories(options); } - if(gUserAuthp->getOptions("event_notifications", options)) + if(LLUserAuth::getInstance()->getOptions("event_notifications", options)) { gEventNotifier.load(options); } options.clear(); - if(gUserAuthp->getOptions("classified_categories", options)) + if(LLUserAuth::getInstance()->getOptions("classified_categories", options)) { LLClassifiedInfo::loadCategories(options); } @@ -2019,7 +1980,7 @@ BOOL idle_startup() LLLandmark::registerCallbacks(msg); // request mute list - gMuteListp->requestFromServer(gAgent.getID()); + LLMuteList::getInstance()->requestFromServer(gAgent.getID()); // Get L$ and ownership credit information msg->newMessageFast(_PREHASH_MoneyBalanceRequest); @@ -2057,13 +2018,12 @@ BOOL idle_startup() // We have a region, and just did a big inventory download. // We can estimate the user's connection speed, and set their // max bandwidth accordingly. JC - if (gSavedSettings.getBOOL("FirstLoginThisInstall") - && gUserAuthp) + if (gSavedSettings.getBOOL("FirstLoginThisInstall")) { // This is actually a pessimistic computation, because TCP may not have enough // time to ramp up on the (small) default inventory file to truly measure max // bandwidth. JC - F64 rate_bps = gUserAuthp->getLastTransferRateBPS(); + F64 rate_bps = LLUserAuth::getInstance()->getLastTransferRateBPS(); const F32 FAST_RATE_BPS = 600.f * 1024.f; const F32 FASTER_RATE_BPS = 750.f * 1024.f; F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); @@ -2110,7 +2070,7 @@ BOOL idle_startup() // many gesture downloads, if this is the user's first // time on this machine or -purge has been run. LLUserAuth::options_t gesture_options; - if (gUserAuthp->getOptions("gestures", gesture_options)) + if (LLUserAuth::getInstance()->getOptions("gestures", gesture_options)) { llinfos << "Gesture Manager loading " << gesture_options.size() << llendl; @@ -2274,7 +2234,7 @@ BOOL idle_startup() else if (wearables_time > MAX_WEARABLES_TIME) { gViewerWindow->alertXml("ClothingLoading"); - gViewerStats->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); LLStartUp::setStartupState( STATE_CLEANUP ); } else @@ -2334,13 +2294,9 @@ BOOL idle_startup() // If we've got a startup URL, dispatch it LLStartUp::dispatchURL(); - + // Clean up the userauth stuff. - if (gUserAuthp) - { - delete gUserAuthp; - gUserAuthp = NULL; - } + LLUserAuth::getInstance()->reset(); LLStartUp::setStartupState( STATE_STARTED ); @@ -3073,7 +3029,7 @@ void init_stat_view() stat_viewp = new LLStatView("basic stat view", "Basic", "OpenDebugStatBasic", rect); gDebugView->mFloaterStatsp->addStatView(stat_viewp); - stat_barp = stat_viewp->addStat("FPS", &(gViewerStats->mFPSStat)); + stat_barp = stat_viewp->addStat("FPS", &(LLViewerStats::getInstance()->mFPSStat)); stat_barp->setUnitLabel(" fps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 45.f; @@ -3083,7 +3039,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = TRUE; - stat_barp = stat_viewp->addStat("Bandwidth", &(gViewerStats->mKBitStat)); + stat_barp = stat_viewp->addStat("Bandwidth", &(LLViewerStats::getInstance()->mKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 900.f; @@ -3092,7 +3048,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = FALSE; - stat_barp = stat_viewp->addStat("Packet Loss", &(gViewerStats->mPacketsLostPercentStat)); + stat_barp = stat_viewp->addStat("Packet Loss", &(LLViewerStats::getInstance()->mPacketsLostPercentStat)); stat_barp->setUnitLabel(" %"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 5.f; @@ -3103,7 +3059,7 @@ void init_stat_view() stat_barp->mDisplayMean = TRUE; stat_barp->mPrecision = 1; - stat_barp = stat_viewp->addStat("Ping Sim", &(gViewerStats->mSimPingStat)); + stat_barp = stat_viewp->addStat("Ping Sim", &(LLViewerStats::getInstance()->mSimPingStat)); stat_barp->setUnitLabel(" msec"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1000.f; @@ -3223,31 +3179,31 @@ void init_stat_view() net_statviewp = new LLStatView("network stat view", "Network", "OpenDebugStatNet", rect); stat_viewp->addChildAtEnd(net_statviewp); - stat_barp = net_statviewp->addStat("Packets In", &(gViewerStats->mPacketsInStat)); + stat_barp = net_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mPacketsInStat)); stat_barp->setUnitLabel("/sec"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Packets Out", &(gViewerStats->mPacketsOutStat)); + stat_barp = net_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mPacketsOutStat)); stat_barp->setUnitLabel("/sec"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Objects", &(gViewerStats->mObjectKBitStat)); + stat_barp = net_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mObjectKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Texture", &(gViewerStats->mTextureKBitStat)); + stat_barp = net_statviewp->addStat("Texture", &(LLViewerStats::getInstance()->mTextureKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Asset", &(gViewerStats->mAssetKBitStat)); + stat_barp = net_statviewp->addStat("Asset", &(LLViewerStats::getInstance()->mAssetKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Layers", &(gViewerStats->mLayersKBitStat)); + stat_barp = net_statviewp->addStat("Layers", &(LLViewerStats::getInstance()->mLayersKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Actual In", &(gViewerStats->mActualInKBitStat)); + stat_barp = net_statviewp->addStat("Actual In", &(LLViewerStats::getInstance()->mActualInKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1024.f; @@ -3256,7 +3212,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = FALSE; - stat_barp = net_statviewp->addStat("Actual Out", &(gViewerStats->mActualOutKBitStat)); + stat_barp = net_statviewp->addStat("Actual Out", &(LLViewerStats::getInstance()->mActualOutKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 512.f; @@ -3265,7 +3221,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = FALSE; - stat_barp = net_statviewp->addStat("VFS Pending Ops", &(gViewerStats->mVFSPendingOperations)); + stat_barp = net_statviewp->addStat("VFS Pending Ops", &(LLViewerStats::getInstance()->mVFSPendingOperations)); stat_barp->setUnitLabel(" "); stat_barp->mPerSec = FALSE; stat_barp->mDisplayBar = FALSE; @@ -3275,7 +3231,7 @@ void init_stat_view() LLStatView *sim_statviewp = new LLStatView("sim stat view", "Simulator", "OpenDebugStatSim", rect); gDebugView->mFloaterStatsp->addStatView(sim_statviewp); - stat_barp = sim_statviewp->addStat("Time Dilation", &(gViewerStats->mSimTimeDilation)); + stat_barp = sim_statviewp->addStat("Time Dilation", &(LLViewerStats::getInstance()->mSimTimeDilation)); stat_barp->mPrecision = 2; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1.f; @@ -3285,7 +3241,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Sim FPS", &(gViewerStats->mSimFPS)); + stat_barp = sim_statviewp->addStat("Sim FPS", &(LLViewerStats::getInstance()->mSimFPS)); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 200.f; stat_barp->mTickSpacing = 20.f; @@ -3294,7 +3250,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Physics FPS", &(gViewerStats->mSimPhysicsFPS)); + stat_barp = sim_statviewp->addStat("Physics FPS", &(LLViewerStats::getInstance()->mSimPhysicsFPS)); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 66.f; @@ -3304,7 +3260,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Agent Updates/Sec", &(gViewerStats->mSimAgentUPS)); + stat_barp = sim_statviewp->addStat("Agent Updates/Sec", &(LLViewerStats::getInstance()->mSimAgentUPS)); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 100.f; @@ -3314,7 +3270,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Main Agents", &(gViewerStats->mSimMainAgents)); + stat_barp = sim_statviewp->addStat("Main Agents", &(LLViewerStats::getInstance()->mSimMainAgents)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 80.f; @@ -3324,7 +3280,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Child Agents", &(gViewerStats->mSimChildAgents)); + stat_barp = sim_statviewp->addStat("Child Agents", &(LLViewerStats::getInstance()->mSimChildAgents)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 40.f; @@ -3334,7 +3290,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Objects", &(gViewerStats->mSimObjects)); + stat_barp = sim_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mSimObjects)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 30000.f; @@ -3344,7 +3300,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Active Objects", &(gViewerStats->mSimActiveObjects)); + stat_barp = sim_statviewp->addStat("Active Objects", &(LLViewerStats::getInstance()->mSimActiveObjects)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 800.f; @@ -3354,7 +3310,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Active Scripts", &(gViewerStats->mSimActiveScripts)); + stat_barp = sim_statviewp->addStat("Active Scripts", &(LLViewerStats::getInstance()->mSimActiveScripts)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 800.f; @@ -3364,7 +3320,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Script Perf", &(gViewerStats->mSimLSLIPS)); + stat_barp = sim_statviewp->addStat("Script Perf", &(LLViewerStats::getInstance()->mSimLSLIPS)); stat_barp->setUnitLabel(" ips"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3375,7 +3331,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Packets In", &(gViewerStats->mSimInPPS)); + stat_barp = sim_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mSimInPPS)); stat_barp->setUnitLabel(" pps"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3386,7 +3342,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Packets Out", &(gViewerStats->mSimOutPPS)); + stat_barp = sim_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mSimOutPPS)); stat_barp->setUnitLabel(" pps"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3397,7 +3353,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Pending Downloads", &(gViewerStats->mSimPendingDownloads)); + stat_barp = sim_statviewp->addStat("Pending Downloads", &(LLViewerStats::getInstance()->mSimPendingDownloads)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 800.f; @@ -3407,7 +3363,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Pending Uploads", &(gViewerStats->mSimPendingUploads)); + stat_barp = sim_statviewp->addStat("Pending Uploads", &(LLViewerStats::getInstance()->mSimPendingUploads)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 100.f; @@ -3417,7 +3373,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Total Unacked Bytes", &(gViewerStats->mSimTotalUnackedBytes)); + stat_barp = sim_statviewp->addStat("Total Unacked Bytes", &(LLViewerStats::getInstance()->mSimTotalUnackedBytes)); stat_barp->setUnitLabel(" kb"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3432,7 +3388,7 @@ void init_stat_view() sim_time_viewp = new LLStatView("sim perf view", "Time (ms)", "", rect); sim_statviewp->addChildAtEnd(sim_time_viewp); - stat_barp = sim_time_viewp->addStat("Total Frame Time", &(gViewerStats->mSimFrameMsec)); + stat_barp = sim_time_viewp->addStat("Total Frame Time", &(LLViewerStats::getInstance()->mSimFrameMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3443,7 +3399,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Net Time", &(gViewerStats->mSimNetMsec)); + stat_barp = sim_time_viewp->addStat("Net Time", &(LLViewerStats::getInstance()->mSimNetMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3454,7 +3410,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(gViewerStats->mSimSimPhysicsMsec)); + stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3465,7 +3421,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Sim Time (Other)", &(gViewerStats->mSimSimOtherMsec)); + stat_barp = sim_time_viewp->addStat("Sim Time (Other)", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3476,7 +3432,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Agent Time", &(gViewerStats->mSimAgentMsec)); + stat_barp = sim_time_viewp->addStat("Agent Time", &(LLViewerStats::getInstance()->mSimAgentMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3487,7 +3443,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Images Time", &(gViewerStats->mSimImagesMsec)); + stat_barp = sim_time_viewp->addStat("Images Time", &(LLViewerStats::getInstance()->mSimImagesMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3498,7 +3454,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Script Time", &(gViewerStats->mSimScriptMsec)); + stat_barp = sim_time_viewp->addStat("Script Time", &(LLViewerStats::getInstance()->mSimScriptMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; |