diff options
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 9 | ||||
-rw-r--r-- | linden/indra/newview/llfloatersnapshot.cpp | 116 |
2 files changed, 82 insertions, 43 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 4bb235e..15ce1a3 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -334,14 +334,11 @@ void LLAppViewer::gst_plugin_path() | |||
334 | { | 334 | { |
335 | LL_INFOS("InitInfo") << "Imprudence is installed at " << buffer << LL_ENDL; | 335 | LL_INFOS("InitInfo") << "Imprudence is installed at " << buffer << LL_ENDL; |
336 | 336 | ||
337 | char plugin_path[255]; | 337 | std::string plugin_path = "GST_PLUGIN_PATH=" + std::string(buffer) + "\\lib\\gstreamer-plugins"; |
338 | strcpy (plugin_path,"GST_PLUGIN_PATH="); | ||
339 | strcat (plugin_path,buffer); | ||
340 | strcat (plugin_path,"\\lib"); | ||
341 | 338 | ||
342 | // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe | 339 | // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe |
343 | putenv(plugin_path); | 340 | const char* gst_plugin_path = plugin_path.c_str(); |
344 | 341 | putenv(gst_plugin_path); | |
345 | LL_INFOS("InitInfo") << "GST_PLUGIN_PATH set to " << getenv("GST_PLUGIN_PATH") << LL_ENDL; | 342 | LL_INFOS("InitInfo") << "GST_PLUGIN_PATH set to " << getenv("GST_PLUGIN_PATH") << LL_ENDL; |
346 | } | 343 | } |
347 | #endif //LL_WINDOWS | 344 | #endif //LL_WINDOWS |
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index 6e66103..f5f6c8e 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp | |||
@@ -763,22 +763,24 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview ) | |||
763 | previewp->getWindow()->incBusyCount(); | 763 | previewp->getWindow()->incBusyCount(); |
764 | previewp->mImageScaled[previewp->mCurImageIndex] = FALSE; | 764 | previewp->mImageScaled[previewp->mCurImageIndex] = FALSE; |
765 | 765 | ||
766 | // grab the raw image and encode it into desired format | 766 | int res = 1; |
767 | res = (gSavedSettings.getBOOL("HighResSnapshot") && previewp->getSnapshotType() == SNAPSHOT_LOCAL) ? 2 : 1; | ||
768 | |||
767 | if(gViewerWindow->rawSnapshot( | 769 | if(gViewerWindow->rawSnapshot( |
768 | previewp->mPreviewImage, | 770 | previewp->mPreviewImage, |
769 | previewp->mWidth[previewp->mCurImageIndex], | 771 | previewp->mWidth[previewp->mCurImageIndex]*res, |
770 | previewp->mHeight[previewp->mCurImageIndex], | 772 | previewp->mHeight[previewp->mCurImageIndex]*res, |
771 | previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"), | 773 | previewp->mKeepAspectRatio, |
772 | previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE, | 774 | previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE, |
773 | gSavedSettings.getBOOL("RenderUIInSnapshot"), | 775 | gSavedSettings.getBOOL("RenderUIInSnapshot"), |
774 | FALSE, | 776 | FALSE, |
775 | previewp->mSnapshotBufferType, | 777 | previewp->mSnapshotBufferType, |
776 | previewp->getMaxImageSize())) | 778 | previewp->getMaxImageSize())) |
777 | { | 779 | { |
778 | previewp->mPreviewImageEncoded->resize( | 780 | previewp->mPreviewImageEncoded->resize( |
779 | previewp->mPreviewImage->getWidth(), | 781 | previewp->mPreviewImage->getWidth(), |
780 | previewp->mPreviewImage->getHeight(), | 782 | previewp->mPreviewImage->getHeight(), |
781 | previewp->mPreviewImage->getComponents()); | 783 | previewp->mPreviewImage->getComponents()); |
782 | 784 | ||
783 | if(previewp->getSnapshotType() == SNAPSHOT_TEXTURE) | 785 | if(previewp->getSnapshotType() == SNAPSHOT_TEXTURE) |
784 | { | 786 | { |
@@ -797,14 +799,24 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview ) | |||
797 | formatted->decode(previewp->mPreviewImageEncoded, 0); | 799 | formatted->decode(previewp->mPreviewImageEncoded, 0); |
798 | } | 800 | } |
799 | } | 801 | } |
800 | else | 802 | else if(previewp->getSnapshotType() == SNAPSHOT_POSTCARD) |
801 | { | 803 | { |
802 | // delete any existing image | ||
803 | previewp->mFormattedImage = NULL; | 804 | previewp->mFormattedImage = NULL; |
804 | // now create the new one of the appropriate format. | ||
805 | // note: postcards hardcoded to use jpeg always. | 805 | // note: postcards hardcoded to use jpeg always. |
806 | LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotType() == SNAPSHOT_POSTCARD | 806 | previewp->mFormattedImage = new LLImageJPEG(previewp->mSnapshotQuality); |
807 | ? LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG : previewp->getSnapshotFormat(); | 807 | |
808 | if(previewp->mFormattedImage->encode(previewp->mPreviewImage, 0)) | ||
809 | { | ||
810 | previewp->mDataSize = previewp->mFormattedImage->getDataSize(); | ||
811 | previewp->mFormattedImage->decode(previewp->mPreviewImageEncoded, 0); | ||
812 | } | ||
813 | } | ||
814 | else //SNAPSHOT_LOCAL | ||
815 | { | ||
816 | previewp->mFormattedImage = NULL; | ||
817 | // save snapshot using the appropriate format. | ||
818 | LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotFormat(); | ||
819 | |||
808 | switch(format) | 820 | switch(format) |
809 | { | 821 | { |
810 | case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: | 822 | case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: |
@@ -864,16 +876,16 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview ) | |||
864 | previewp->mPosTakenGlobal = gAgent.getCameraPositionGlobal(); | 876 | previewp->mPosTakenGlobal = gAgent.getCameraPositionGlobal(); |
865 | previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame | 877 | previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame |
866 | } | 878 | } |
867 | } | 879 | previewp->getWindow()->decBusyCount(); |
868 | previewp->getWindow()->decBusyCount(); | 880 | // only show fullscreen preview when in freeze frame mode |
869 | // only show fullscreen preview when in freeze frame mode | 881 | previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame")); |
870 | previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame")); | 882 | previewp->mSnapshotDelayTimer.stop(); |
871 | previewp->mSnapshotDelayTimer.stop(); | 883 | previewp->mSnapshotActive = FALSE; |
872 | previewp->mSnapshotActive = FALSE; | ||
873 | 884 | ||
874 | if(!previewp->getThumbnailUpToDate()) | 885 | if(!previewp->getThumbnailUpToDate()) |
875 | { | 886 | { |
876 | previewp->generateThumbnailImage() ; | 887 | previewp->generateThumbnailImage() ; |
888 | } | ||
877 | } | 889 | } |
878 | } | 890 | } |
879 | 891 | ||
@@ -1106,10 +1118,6 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) | |||
1106 | { | 1118 | { |
1107 | LLSnapshotLivePreview* previewp = getPreviewView(floaterp); | 1119 | LLSnapshotLivePreview* previewp = getPreviewView(floaterp); |
1108 | 1120 | ||
1109 | LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floaterp); | ||
1110 | if (shot_type != LLSnapshotLivePreview::SNAPSHOT_LOCAL) | ||
1111 | gSavedSettings.setBOOL("HighResSnapshot", FALSE); | ||
1112 | |||
1113 | S32 delta_height = gSavedSettings.getBOOL("AdvanceSnapshot") ? 0 : floaterp->getUIWinHeightShort() - floaterp->getUIWinHeightLong() ; | 1121 | S32 delta_height = gSavedSettings.getBOOL("AdvanceSnapshot") ? 0 : floaterp->getUIWinHeightShort() - floaterp->getUIWinHeightLong() ; |
1114 | 1122 | ||
1115 | LLComboBox* combo; | 1123 | LLComboBox* combo; |
@@ -1457,8 +1465,11 @@ void LLFloaterSnapshot::Impl::onClickHighResCheck(LLUICtrl *ctrl, void* data) | |||
1457 | LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; | 1465 | LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; |
1458 | if (view) | 1466 | if (view) |
1459 | { | 1467 | { |
1460 | BOOL ui_in_snapshot = gSavedSettings.getBOOL("RenderUIInSnapshot"); | 1468 | if (gSavedSettings.getBOOL("RenderUIInSnapshot")) |
1461 | if (ui_in_snapshot) gSavedSettings.setBOOL("RenderUIInSnapshot", FALSE); | 1469 | { |
1470 | gSavedSettings.setBOOL("RenderUIInSnapshot", FALSE); | ||
1471 | checkAutoSnapshot(getPreviewView(view), TRUE); | ||
1472 | } | ||
1462 | view->childSetEnabled("ui_check", !check->get()); | 1473 | view->childSetEnabled("ui_check", !check->get()); |
1463 | checkAutoSnapshot(getPreviewView(view), TRUE); | 1474 | checkAutoSnapshot(getPreviewView(view), TRUE); |
1464 | } | 1475 | } |
@@ -2031,22 +2042,53 @@ void LLFloaterSnapshot::draw() | |||
2031 | } | 2042 | } |
2032 | 2043 | ||
2033 | BOOL ui_in_snapshot = gSavedSettings.getBOOL("RenderUIInSnapshot"); | 2044 | BOOL ui_in_snapshot = gSavedSettings.getBOOL("RenderUIInSnapshot"); |
2045 | BOOL high_res_snapshot = gSavedSettings.getBOOL("HighResSnapshot"); | ||
2034 | 2046 | ||
2035 | if (previewp->getSnapshotType() != LLSnapshotLivePreview::SNAPSHOT_LOCAL) | 2047 | if(ui_in_snapshot && high_res_snapshot) |
2036 | { | 2048 | { |
2049 | llwarns << "Both RenderUIInSnapshot and HighResSnapshot enabled (prolly screwed with the debug settings). Resetting them." << llendl; | ||
2050 | gSavedSettings.setBOOL("HighResSnapshot", FALSE); | ||
2051 | gSavedSettings.setBOOL("RenderUIInSnapshot", FALSE); | ||
2037 | childSetValue("high_res_check", FALSE); | 2052 | childSetValue("high_res_check", FALSE); |
2053 | childSetEnabled("high_res_check", TRUE); | ||
2054 | childSetValue("ui_check", FALSE); | ||
2038 | childSetEnabled("ui_check", TRUE); | 2055 | childSetEnabled("ui_check", TRUE); |
2056 | ui_in_snapshot = FALSE; | ||
2057 | high_res_snapshot = FALSE; | ||
2039 | } | 2058 | } |
2040 | else | 2059 | |
2060 | if(previewp->getSnapshotType() != LLSnapshotLivePreview::SNAPSHOT_LOCAL) | ||
2041 | { | 2061 | { |
2062 | childSetEnabled("high_res_check",FALSE); | ||
2063 | childSetVisible("high_res_check",FALSE); | ||
2064 | childSetEnabled("ui_check",TRUE); | ||
2042 | if (ui_in_snapshot) | 2065 | if (ui_in_snapshot) |
2043 | { | 2066 | { |
2044 | gSavedSettings.setBOOL("HighResSnapshot", FALSE); | 2067 | gSavedSettings.setBOOL("HighResSnapshot", FALSE); |
2045 | childSetEnabled("high_res_check", FALSE); | ||
2046 | } | 2068 | } |
2047 | } | 2069 | } |
2070 | else | ||
2071 | { | ||
2072 | childSetVisible("high_res_check",TRUE); | ||
2073 | if (high_res_snapshot) | ||
2074 | { | ||
2075 | childSetEnabled("high_res_check",TRUE); | ||
2076 | childSetEnabled("ui_check",FALSE); | ||
2077 | } | ||
2078 | else if (ui_in_snapshot) | ||
2079 | { | ||
2080 | childSetEnabled("ui_check",TRUE); | ||
2081 | childSetEnabled("high_res_check",FALSE); | ||
2082 | } | ||
2083 | else | ||
2084 | { | ||
2085 | childSetEnabled("ui_check",TRUE); | ||
2086 | childSetEnabled("high_res_check",TRUE); | ||
2087 | } | ||
2088 | } | ||
2089 | childSetValue("ui_check",gSavedSettings.getBOOL("RenderUIInSnapshot")); | ||
2090 | childSetValue("high_res_check",gSavedSettings.getBOOL("HighResSnapshot")); | ||
2048 | 2091 | ||
2049 | childSetValue("ui_check", ui_in_snapshot); | ||
2050 | childSetToolTip("ui_check", std::string("If selected shows the UI in the snapshot")); | 2092 | childSetToolTip("ui_check", std::string("If selected shows the UI in the snapshot")); |
2051 | } | 2093 | } |
2052 | 2094 | ||