diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-06-12 16:17:37 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-06-12 16:17:37 +0300 |
commit | 19221d9ccf38a5b10e7e2ecefb1ad121f1fb51d7 (patch) | |
tree | 0fb998504f706803aceb81866228c6a3a4e152b5 /indra/newview | |
parent | 583558dad8bf03e9d1da997a994d3bc422d1fe11 (diff) |
SL-11402 Save last session image per grid
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llstartup.h | 6 | ||||
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 4 |
5 files changed, 38 insertions, 12 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e201d56815..24886b01fb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4505,7 +4505,7 @@ void LLAppViewer::saveFinalSnapshot() std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_LAST_FILENAME; + snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); mSavedFinalSnapshot = TRUE; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e9d3cfa993..e34a9beb49 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -210,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.bmp"; +const std::string SCREEN_LAST_FILENAME = "screen_last%s.bmp"; LLPointer<LLViewerTexture> gStartTexture; @@ -2577,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 ) { @@ -2674,11 +2702,11 @@ void init_start_screen(S32 location_id) if ((S32)START_LOCATION_ID_LAST == location_id) { - temp_str += SCREEN_LAST_FILENAME; + temp_str += LLStartUp::getScreenLastFilename(); } else { - temp_str += SCREEN_HOME_FILENAME; + temp_str += LLStartUp::getScreenHomeFilename(); } LLPointer<LLImageBMP> start_image_bmp = new LLImageBMP; diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index d434e86f82..db37207022 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -41,10 +41,6 @@ bool idle_startup(); void release_start_screen(); bool login_alert_done(const LLSD& notification, const LLSD& response); -// constants, variables, & enumerations -extern std::string SCREEN_HOME_FILENAME; -extern std::string SCREEN_LAST_FILENAME; - // start location constants enum EStartLocation { @@ -95,6 +91,8 @@ public: static void setStartupState( EStartupState state ); static EStartupState getStartupState() { return gStartupState; }; static std::string getStartupStateString() { return startupStateToString(gStartupState); }; + static std::string getScreenLastFilename(); // screenshot taken on exit + static std::string getScreenHomeFilename(); // screenshot taken on setting Home static void multimediaInit(); // Initialize LLViewerMedia multimedia engine. diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index e2554bc9bc..fd49d3b3d3 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1588,7 +1588,7 @@ void render_disconnected_background() LL_INFOS() << "Loading last bitmap..." << LL_ENDL; std::string temp_str; - temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_LAST_FILENAME; + temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getScreenLastFilename(); LLPointer<LLImageBMP> image_bmp = new LLImageBMP; if( !image_bmp->load(temp_str) ) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c8f75c79c4..b70b077618 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5107,7 +5107,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; + snap_filename += LLStartUp::getScreenHomeFilename(); gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } @@ -5190,7 +5190,7 @@ static void process_special_alert_messages(const std::string & message) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; + snap_filename += LLStartUp::getScreenHomeFilename(); gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } } |