diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r-- | indra/newview/llstartup.cpp | 73 |
1 files changed, 62 insertions, 11 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0d99b35aee..6e0a36be49 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -113,7 +113,7 @@ #include "llgroupmgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llimagebmp.h" +#include "llimage.h" #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" @@ -162,6 +162,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" #include "llvoavatar.h" @@ -209,8 +210,8 @@ bool gAgentMovementCompleted = false; S32 gMaxAgentGroups; -std::string SCREEN_HOME_FILENAME = "screen_home.bmp"; -std::string SCREEN_LAST_FILENAME = "screen_last.bmp"; +const std::string SCREEN_HOME_FILENAME = "screen_home%s.png"; +const std::string SCREEN_LAST_FILENAME = "screen_last%s.png"; LLPointer<LLViewerTexture> gStartTexture; @@ -348,6 +349,14 @@ bool idle_startup() // to work. gIdleCallbacks.callFunctions(); gViewerWindow->updateUI(); + + // There is a crash on updateClass, this is an attempt to get more information + if (LLMortician::graveyardCount()) + { + std::stringstream log_stream; + LLMortician::logClass(log_stream); + LL_INFOS() << log_stream.str() << LL_ENDL; + } LLMortician::updateClass(); const std::string delims (" "); @@ -1220,6 +1229,7 @@ bool idle_startup() // // Initialize classes w/graphics stuff. // + LLViewerStatsRecorder::instance(); // Since textures work in threads gTextureList.doPrefetchImages(); display_startup(); @@ -2567,6 +2577,34 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) return false; } +std::string get_screen_filename(const std::string& pattern) +{ + if (LLGridManager::getInstance()->isInProductionGrid()) + { + return llformat(pattern.c_str(), ""); + } + else + { + const std::string& grid_id_str = LLGridManager::getInstance()->getGridId(); + const std::string& grid_id_lower = utf8str_tolower(grid_id_str); + std::string grid = "." + grid_id_lower; + return llformat(pattern.c_str(), grid.c_str()); + } +} + +//static +std::string LLStartUp::getScreenLastFilename() +{ + return get_screen_filename(SCREEN_LAST_FILENAME); +} + +//static +std::string LLStartUp::getScreenHomeFilename() +{ + return get_screen_filename(SCREEN_HOME_FILENAME); +} + +//static void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { @@ -2660,19 +2698,32 @@ void init_start_screen(S32 location_id) LL_DEBUGS("AppInit") << "Loading startup bitmap..." << LL_ENDL; + U8 image_codec = IMG_CODEC_PNG; std::string temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter(); if ((S32)START_LOCATION_ID_LAST == location_id) { - temp_str += SCREEN_LAST_FILENAME; + temp_str += LLStartUp::getScreenLastFilename(); } else { - temp_str += SCREEN_HOME_FILENAME; + std::string path = temp_str + LLStartUp::getScreenHomeFilename(); + + if (!gDirUtilp->fileExists(path) && LLGridManager::getInstance()->isInProductionGrid()) + { + // Fallback to old file, can be removed later + // Home image only sets when user changes home, so it will take time for users to switch to pngs + temp_str += "screen_home.bmp"; + image_codec = IMG_CODEC_BMP; + } + else + { + temp_str = path; + } } - LLPointer<LLImageBMP> start_image_bmp = new LLImageBMP; - + LLPointer<LLImageFormatted> start_image_frmted = LLImageFormatted::createFromType(image_codec); + // Turn off start screen to get around the occasional readback // driver bug if(!gSavedSettings.getBOOL("UseStartScreen")) @@ -2680,18 +2731,18 @@ void init_start_screen(S32 location_id) LL_INFOS("AppInit") << "Bitmap load disabled" << LL_ENDL; return; } - else if(!start_image_bmp->load(temp_str) ) + else if(!start_image_frmted->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; gStartTexture = NULL; } else { - gStartImageWidth = start_image_bmp->getWidth(); - gStartImageHeight = start_image_bmp->getHeight(); + gStartImageWidth = start_image_frmted->getWidth(); + gStartImageHeight = start_image_frmted->getHeight(); LLPointer<LLImageRaw> raw = new LLImageRaw; - if (!start_image_bmp->decode(raw, 0.0f)) + if (!start_image_frmted->decode(raw, 0.0f)) { LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; gStartTexture = NULL; |