diff options
author | Armin Weatherwax | 2010-02-22 13:47:15 +0100 |
---|---|---|
committer | Jacek Antonelli | 2010-03-04 20:58:10 -0600 |
commit | 3609359ca157d122a15480f19fea18de0015cb3c (patch) | |
tree | 8de3fca09dd17db5598f972344495ad695c508af /linden/indra/newview/llfloatersnapshot.cpp | |
parent | Linux64: for DBUS-Debug build- track where it's crashing (if still). (diff) | |
download | meta-impy-3609359ca157d122a15480f19fea18de0015cb3c.zip meta-impy-3609359ca157d122a15480f19fea18de0015cb3c.tar.gz meta-impy-3609359ca157d122a15480f19fea18de0015cb3c.tar.bz2 meta-impy-3609359ca157d122a15480f19fea18de0015cb3c.tar.xz |
Ported temporary texture uploads from Emerald.
Diffstat (limited to 'linden/indra/newview/llfloatersnapshot.cpp')
-rw-r--r-- | linden/indra/newview/llfloatersnapshot.cpp | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index 6597f9d..b4f2cc2 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp | |||
@@ -80,8 +80,10 @@ | |||
80 | ///---------------------------------------------------------------------------- | 80 | ///---------------------------------------------------------------------------- |
81 | /// Local function declarations, constants, enums, and typedefs | 81 | /// Local function declarations, constants, enums, and typedefs |
82 | ///---------------------------------------------------------------------------- | 82 | ///---------------------------------------------------------------------------- |
83 | S32 LLFloaterSnapshot::sUIWinHeightLong = 546 ; | 83 | |
84 | S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 250 ; | 84 | //Hey, why use XUI files when you can hardcode? Why say "Floater" when you can say "UIWin"? |
85 | S32 LLFloaterSnapshot::sUIWinHeightLong = 568 ;//height of the floater with "more" options | ||
86 | S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 270 ;//dto. "less" options | ||
85 | S32 LLFloaterSnapshot::sUIWinWidth = 215 ; | 87 | S32 LLFloaterSnapshot::sUIWinWidth = 215 ; |
86 | 88 | ||
87 | LLSnapshotFloaterView* gSnapshotFloaterView = NULL; | 89 | LLSnapshotFloaterView* gSnapshotFloaterView = NULL; |
@@ -809,24 +811,14 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) | |||
809 | formatted->decode(previewp->mPreviewImageEncoded, 0); | 811 | formatted->decode(previewp->mPreviewImageEncoded, 0); |
810 | } | 812 | } |
811 | } | 813 | } |
812 | else if(previewp->getSnapshotType() == SNAPSHOT_POSTCARD) | 814 | else |
813 | { | 815 | { |
816 | // delete any existing image | ||
814 | previewp->mFormattedImage = NULL; | 817 | previewp->mFormattedImage = NULL; |
818 | // now create the new one of the appropriate format. | ||
815 | // note: postcards hardcoded to use jpeg always. | 819 | // note: postcards hardcoded to use jpeg always. |
816 | previewp->mFormattedImage = new LLImageJPEG(previewp->mSnapshotQuality); | 820 | LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotType() == SNAPSHOT_POSTCARD |
817 | 821 | ? LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG : previewp->getSnapshotFormat(); | |
818 | if(previewp->mFormattedImage->encode(previewp->mPreviewImage, 0)) | ||
819 | { | ||
820 | previewp->mDataSize = previewp->mFormattedImage->getDataSize(); | ||
821 | previewp->mFormattedImage->decode(previewp->mPreviewImageEncoded, 0); | ||
822 | } | ||
823 | } | ||
824 | else //SNAPSHOT_LOCAL | ||
825 | { | ||
826 | previewp->mFormattedImage = NULL; | ||
827 | // save snapshot using the appropriate format. | ||
828 | LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotFormat(); | ||
829 | |||
830 | switch(format) | 822 | switch(format) |
831 | { | 823 | { |
832 | case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: | 824 | case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: |
@@ -1269,7 +1261,12 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) | |||
1269 | floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); | 1261 | floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); |
1270 | floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !sAspectRatioCheckOff); | 1262 | floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !sAspectRatioCheckOff); |
1271 | floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); | 1263 | floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); |
1272 | 1264 | if(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE) | |
1265 | { | ||
1266 | floater->childSetValue("temp_check", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); | ||
1267 | } | ||
1268 | floater->childSetEnabled("temp_check", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); | ||
1269 | |||
1273 | BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); | 1270 | BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); |
1274 | BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL; | 1271 | BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL; |
1275 | 1272 | ||
@@ -1290,6 +1287,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) | |||
1290 | floater->childSetVisible("freeze_frame_check", is_advance); | 1287 | floater->childSetVisible("freeze_frame_check", is_advance); |
1291 | floater->childSetVisible("auto_snapshot_check", is_advance); | 1288 | floater->childSetVisible("auto_snapshot_check", is_advance); |
1292 | floater->childSetVisible("image_quality_slider", is_advance); | 1289 | floater->childSetVisible("image_quality_slider", is_advance); |
1290 | floater->childSetVisible("temp_check", is_advance); | ||
1293 | 1291 | ||
1294 | LLSnapshotLivePreview* previewp = getPreviewView(floater); | 1292 | LLSnapshotLivePreview* previewp = getPreviewView(floater); |
1295 | BOOL got_bytes = previewp && previewp->getDataSize() > 0; | 1293 | BOOL got_bytes = previewp && previewp->getDataSize() > 0; |
@@ -2085,6 +2083,9 @@ BOOL LLFloaterSnapshot::postBuild() | |||
2085 | sInstance->getRootView()->addChild(previewp); | 2083 | sInstance->getRootView()->addChild(previewp); |
2086 | sInstance->getRootView()->addChild(gSnapshotFloaterView); | 2084 | sInstance->getRootView()->addChild(gSnapshotFloaterView); |
2087 | 2085 | ||
2086 | gSavedSettings.setBOOL("EmeraldTemporaryUpload",FALSE); | ||
2087 | childSetValue("temp_check",FALSE); | ||
2088 | |||
2088 | Impl::sPreviewHandle = previewp->getHandle(); | 2089 | Impl::sPreviewHandle = previewp->getHandle(); |
2089 | 2090 | ||
2090 | impl.updateControls(this); | 2091 | impl.updateControls(this); |
@@ -2103,6 +2104,8 @@ void LLFloaterSnapshot::draw() | |||
2103 | } | 2104 | } |
2104 | 2105 | ||
2105 | // TODO*: Do we need all this? - Jacek | 2106 | // TODO*: Do we need all this? - Jacek |
2107 | //SG & Emerald don't ... let's try and comment it out -Armin | ||
2108 | /* | ||
2106 | if(!isMinimized()) | 2109 | if(!isMinimized()) |
2107 | { | 2110 | { |
2108 | if (previewp && previewp->getDataSize() > 0) | 2111 | if (previewp && previewp->getDataSize() > 0) |
@@ -2194,7 +2197,7 @@ void LLFloaterSnapshot::draw() | |||
2194 | 2197 | ||
2195 | childSetToolTip("ui_check", std::string("If selected shows the UI in the snapshot")); | 2198 | childSetToolTip("ui_check", std::string("If selected shows the UI in the snapshot")); |
2196 | } | 2199 | } |
2197 | 2200 | */ | |
2198 | LLFloater::draw(); | 2201 | LLFloater::draw(); |
2199 | 2202 | ||
2200 | if (previewp) | 2203 | if (previewp) |