SL-11402 Save last session image per grid

meow-7.2.2
andreykproductengine 2019-06-12 16:17:37 +03:00
parent 583558dad8
commit 19221d9ccf
5 changed files with 38 additions and 12 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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.

View File

@ -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) )

View File

@ -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);
}
}