aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatersnapshot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatersnapshot.cpp')
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index c83eba3..291c437 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -183,7 +183,6 @@ protected:
183 LLQuaternion mCameraRot; 183 LLQuaternion mCameraRot;
184 BOOL mSnapshotActive; 184 BOOL mSnapshotActive;
185 LLViewerWindow::ESnapshotType mSnapshotBufferType; 185 LLViewerWindow::ESnapshotType mSnapshotBufferType;
186 bool mSnapshotSoundPlayed;
187 186
188public: 187public:
189 static std::set<LLSnapshotLivePreview*> sList; 188 static std::set<LLSnapshotLivePreview*> sList;
@@ -209,8 +208,7 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLRect& rect) :
209 mCameraPos(LLViewerCamera::getInstance()->getOrigin()), 208 mCameraPos(LLViewerCamera::getInstance()->getOrigin()),
210 mCameraRot(LLViewerCamera::getInstance()->getQuaternion()), 209 mCameraRot(LLViewerCamera::getInstance()->getQuaternion()),
211 mSnapshotActive(FALSE), 210 mSnapshotActive(FALSE),
212 mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR), 211 mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR)
213 mSnapshotSoundPlayed(false)
214{ 212{
215 mSnapshotDelayTimer.setTimerExpirySec(0.0f); 213 mSnapshotDelayTimer.setTimerExpirySec(0.0f);
216 mSnapshotDelayTimer.start(); 214 mSnapshotDelayTimer.start();
@@ -767,19 +765,6 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview )
767 { 765 {
768 previewp->mRawImageEncoded->resize(previewp->mRawImage->getWidth(), previewp->mRawImage->getHeight(), previewp->mRawImage->getComponents()); 766 previewp->mRawImageEncoded->resize(previewp->mRawImage->getWidth(), previewp->mRawImage->getHeight(), previewp->mRawImage->getComponents());
769 767
770 if (!gSavedSettings.getBOOL("QuietSnapshotsToDisk"))
771 {
772 // Always play the sound once, on window open.
773 // Don't keep playing if automatic
774 // updates are enabled. It's too invasive. JC
775 if (!previewp->mSnapshotSoundPlayed
776 || !gSavedSettings.getBOOL("AutoSnapshot") )
777 {
778 gViewerWindow->playSnapshotAnimAndSound();
779 previewp->mSnapshotSoundPlayed = true;
780 }
781 }
782
783 if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD) 768 if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD)
784 { 769 {
785 // *FIX: just resize and reuse existing jpeg? 770 // *FIX: just resize and reuse existing jpeg?
@@ -923,6 +908,7 @@ void LLSnapshotLivePreview::saveTexture()
923 LLInventoryType::IT_SNAPSHOT, 908 LLInventoryType::IT_SNAPSHOT,
924 PERM_ALL, 909 PERM_ALL,
925 "Snapshot : " + pos_string); 910 "Snapshot : " + pos_string);
911 gViewerWindow->playSnapshotAnimAndSound();
926 } 912 }
927 else 913 else
928 { 914 {
@@ -935,7 +921,12 @@ void LLSnapshotLivePreview::saveTexture()
935 921
936BOOL LLSnapshotLivePreview::saveLocal() 922BOOL LLSnapshotLivePreview::saveLocal()
937{ 923{
938 return gViewerWindow->saveImageNumbered(mRawImage); 924 BOOL success = gViewerWindow->saveImageNumbered(mRawImage);
925 if(success)
926 {
927 gViewerWindow->playSnapshotAnimAndSound();
928 }
929 return success;
939} 930}
940 931
941///---------------------------------------------------------------------------- 932///----------------------------------------------------------------------------
@@ -1079,10 +1070,6 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
1079 } 1070 }
1080 1071
1081 bool use_freeze_frame = floaterp->childGetValue("freeze_frame_check").asBoolean(); 1072 bool use_freeze_frame = floaterp->childGetValue("freeze_frame_check").asBoolean();
1082 // For now, auto-snapshot only works in freeze frame mode.
1083 // This can be changed in the future by taking the FreezeTime check
1084 // out of the onIdle() camera movement detection. JC
1085 floaterp->childSetEnabled("auto_snapshot_check", use_freeze_frame);
1086 1073
1087 if (use_freeze_frame) 1074 if (use_freeze_frame)
1088 { 1075 {
@@ -1119,9 +1106,6 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
1119 } 1106 }
1120 else // turning off freeze frame mode 1107 else // turning off freeze frame mode
1121 { 1108 {
1122 // Force off auto-snapshot, see comment above about onIdle. JC
1123 gSavedSettings.setBOOL("AutoSnapshot", FALSE);
1124
1125 floaterp->getParent()->setMouseOpaque(FALSE); 1109 floaterp->getParent()->setMouseOpaque(FALSE);
1126 floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height); 1110 floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height);
1127 if (previewp) 1111 if (previewp)
@@ -1294,8 +1278,6 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data)
1294 1278
1295 if (previewp) 1279 if (previewp)
1296 { 1280 {
1297 BOOL succeeded = TRUE; // Only used for saveLocal for now
1298
1299 if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) 1281 if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD)
1300 { 1282 {
1301 LLFloaterPostcard* floater = previewp->savePostcard(); 1283 LLFloaterPostcard* floater = previewp->savePostcard();
@@ -1314,7 +1296,7 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data)
1314 } 1296 }
1315 else 1297 else
1316 { 1298 {
1317 succeeded = previewp->saveLocal(); 1299 previewp->saveLocal();
1318 } 1300 }
1319 1301
1320 if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) 1302 if (gSavedSettings.getBOOL("CloseSnapshotOnKeep"))