aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatersnapshot.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index 5008509..8b104a3 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -125,7 +125,7 @@ public:
125 void updateSnapshot(BOOL new_snapshot); 125 void updateSnapshot(BOOL new_snapshot);
126 LLFloaterPostcard* savePostcard(); 126 LLFloaterPostcard* savePostcard();
127 void saveTexture(); 127 void saveTexture();
128 void saveLocal(); 128 BOOL saveLocal();
129 129
130 static void onIdle( void* snapshot_preview ); 130 static void onIdle( void* snapshot_preview );
131 131
@@ -381,8 +381,7 @@ void LLSnapshotLivePreview::draw()
381 F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME); 381 F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
382 382
383 // draw "shine" effect 383 // draw "shine" effect
384 LLGLEnable scissor_test(GL_SCISSOR_TEST); 384 LLLocalClipRect clip(getLocalRect());
385 LLUI::setScissorRegionLocal(LLRect(0, mRect.getHeight(), mRect.getWidth(), 0));
386 { 385 {
387 // draw diagonal stripe with gradient that passes over screen 386 // draw diagonal stripe with gradient that passes over screen
388 S32 x1 = gViewerWindow->getWindowWidth() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); 387 S32 x1 = gViewerWindow->getWindowWidth() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
@@ -698,9 +697,9 @@ void LLSnapshotLivePreview::saveTexture()
698 gViewerStats->incStat(LLViewerStats::ST_SNAPSHOT_COUNT ); 697 gViewerStats->incStat(LLViewerStats::ST_SNAPSHOT_COUNT );
699} 698}
700 699
701void LLSnapshotLivePreview::saveLocal() 700BOOL LLSnapshotLivePreview::saveLocal()
702{ 701{
703 gViewerWindow->saveImageNumbered(mRawImage); 702 return gViewerWindow->saveImageNumbered(mRawImage);
704} 703}
705 704
706///---------------------------------------------------------------------------- 705///----------------------------------------------------------------------------
@@ -959,6 +958,8 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data)
959 958
960 if (previewp) 959 if (previewp)
961 { 960 {
961 BOOL succeeded = TRUE; // Only used for saveLocal for now
962
962 if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) 963 if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD)
963 { 964 {
964 LLFloaterPostcard* floater = previewp->savePostcard(); 965 LLFloaterPostcard* floater = previewp->savePostcard();
@@ -977,21 +978,24 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data)
977 } 978 }
978 else 979 else
979 { 980 {
980 previewp->saveLocal(); 981 succeeded = previewp->saveLocal();
981 } 982 }
982 983
983 if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) 984 if (gSavedSettings.getBOOL("CloseSnapshotOnKeep"))
984 { 985 {
985 view->close(); 986 view->close();
986 // only plays sound and anim when keeping a snapshot, and closing the snapshot UI 987 // only plays sound and anim when keeping a snapshot, and closing the snapshot UI,
987 gViewerWindow->playSnapshotAnimAndSound(); 988 // and only if the save succeeded (i.e. was not canceled)
989 if (succeeded)
990 {
991 gViewerWindow->playSnapshotAnimAndSound();
992 }
988 } 993 }
989 else 994 else
990 { 995 {
991 checkAutoSnapshot(previewp); 996 checkAutoSnapshot(previewp);
992 } 997 }
993 } 998 }
994
995} 999}
996 1000
997// static 1001// static