diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-15 21:28:37 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-15 21:28:37 +0300 |
commit | af5c556270eb186f62aaece398ed97a870be220a (patch) | |
tree | c94fe2a938f9421c721343d2209f4941b280365d /indra/newview/llstartup.cpp | |
parent | bd42fd13b038dea5bddf06ed8da7b51d08b38bae (diff) | |
parent | 33821bd599d1d9171cc93c38a2bc6c4ab6772c9a (diff) |
Merge from viewer-release
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 a861def704..c8c39ae00f 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 (" "); @@ -1225,6 +1234,7 @@ bool idle_startup() // // Initialize classes w/graphics stuff. // + LLViewerStatsRecorder::instance(); // Since textures work in threads gTextureList.doPrefetchImages(); display_startup(); @@ -2574,6 +2584,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 ) { @@ -2667,19 +2705,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")) @@ -2687,18 +2738,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; |