summaryrefslogtreecommitdiff
path: root/indra/newview/llfloater360capture.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-03-21 16:04:33 +0800
committerErik Kundiman <erik@megapahit.org>2025-03-21 19:36:44 +0800
commit2fb48eb9be6df00c3baed955fd84f4d8a1ea1d9a (patch)
treeb6ba5ff2c3ebc24477e3c6d701f91672c7499132 /indra/newview/llfloater360capture.cpp
parent0cdb7d97f67b3a67097e56e71021cb6120ec8a8b (diff)
parent895a6739d3d02e11750e9ada72b730d02998d4c0 (diff)
Merge tag 'Second_Life_Release#895a6739-2025.03' into 2025.03
Diffstat (limited to 'indra/newview/llfloater360capture.cpp')
-rw-r--r--indra/newview/llfloater360capture.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index ff30c83f51..25970f8a08 100644
--- a/indra/newview/llfloater360capture.cpp
+++ b/indra/newview/llfloater360capture.cpp
@@ -33,6 +33,7 @@
#include "llagentui.h"
#include "llbase64.h"
#include "llcallbacklist.h"
+#include "lldate.h"
#include "llenvironment.h"
#include "llimagejpeg.h"
#include "llmediactrl.h"
@@ -692,7 +693,15 @@ void LLFloater360Capture::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
);
// execute the command on the page
- mWebBrowser->getMediaPlugin()->executeJavaScript(cmd);
+ LLPluginClassMedia* plugin = mWebBrowser->getMediaPlugin();
+ if (plugin)
+ {
+ plugin->executeJavaScript(cmd);
+ }
+ else
+ {
+ LL_WARNS("360Capture") << "No media plugin found" << LL_ENDL;
+ }
}
}
break;
@@ -773,7 +782,15 @@ void LLFloater360Capture::onSaveLocalBtn()
// send it to the browser instance, triggering the equirectangular capture
// process and complimentary offer to save the image
- mWebBrowser->getMediaPlugin()->executeJavaScript(cmd);
+ LLPluginClassMedia* plugin = mWebBrowser->getMediaPlugin();
+ if (plugin)
+ {
+ plugin->executeJavaScript(cmd);
+ }
+ else
+ {
+ LL_WARNS("360Capture") << "No media plugin found" << LL_ENDL;
+ }
}
// We capture all 6 images sequentially and if parts of the world are moving
@@ -863,15 +880,7 @@ const std::string LLFloater360Capture::generate_proposed_filename()
filename << "_";
// add in the current HH-MM-SS (with leading 0's) so users can easily save many shots in same folder
- std::time_t cur_epoch = std::time(nullptr);
- std::tm* tm_time = std::localtime(&cur_epoch);
- filename << std::setfill('0') << std::setw(4) << (tm_time->tm_year + 1900);
- filename << std::setfill('0') << std::setw(2) << (tm_time->tm_mon + 1);
- filename << std::setfill('0') << std::setw(2) << tm_time->tm_mday;
- filename << "_";
- filename << std::setfill('0') << std::setw(2) << tm_time->tm_hour;
- filename << std::setfill('0') << std::setw(2) << tm_time->tm_min;
- filename << std::setfill('0') << std::setw(2) << tm_time->tm_sec;
+ filename << LLDate::now().toLocalDateString("%Y%m%d_%H%M%S");
// the unusual way we save the output image (originates in the
// embedded browser and not the C++ code) means that the system