summaryrefslogtreecommitdiff
path: root/indra/newview/llfloater360capture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloater360capture.cpp')
-rw-r--r--indra/newview/llfloater360capture.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index f3b924a306..ff30c83f51 100644
--- a/indra/newview/llfloater360capture.cpp
+++ b/indra/newview/llfloater360capture.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file llfloater360capture.cpp
* @author Callum Prentice (callum@lindenlab.com)
* @brief Floater code for the 360 Capture feature
@@ -67,7 +67,7 @@ LLFloater360Capture::LLFloater360Capture(const LLSD& key)
mStartILMode = gAgent.getInterestListMode();
// send everything to us for as long as this floater is open
- gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_360);
+ gAgent.changeInterestListMode(IL_MODE_360);
}
LLFloater360Capture::~LLFloater360Capture()
@@ -91,7 +91,7 @@ LLFloater360Capture::~LLFloater360Capture()
}
}
-BOOL LLFloater360Capture::postBuild()
+bool LLFloater360Capture::postBuild()
{
mCaptureBtn = getChild<LLUICtrl>("capture_button");
mCaptureBtn->setCommitCallback(boost::bind(&LLFloater360Capture::onCapture360ImagesBtn, this));
@@ -360,6 +360,8 @@ void LLFloater360Capture::encodeAndSave(LLPointer<LLImageRaw> raw_image, const s
int jpeg_encode_quality = gSavedSettings.getU32("360CaptureJPEGEncodeQuality");
LLPointer<LLImageJPEG> jpeg_image = new LLImageJPEG(jpeg_encode_quality);
+ LLImageDataSharedLock lock(raw_image);
+
// Actually encode the JPEG image. This is where a lot of time
// is spent now that the snapshot capture process has been
// optimized. The encode_time parameter doesn't appear to be
@@ -410,14 +412,16 @@ void LLFloater360Capture::suspendForAFrame()
// Probably not needed anymore but saving here just in case.
void LLFloater360Capture::mockSnapShot(LLImageRaw* raw)
{
+ LLImageDataLock lock(raw);
+
unsigned int width = raw->getWidth();
unsigned int height = raw->getHeight();
unsigned int depth = raw->getComponents();
unsigned char* pixels = raw->getData();
- for (int y = 0; y < height; y++)
+ for (unsigned int y = 0; y < height; y++)
{
- for (int x = 0; x < width; x++)
+ for (unsigned int x = 0; x < width; x++)
{
unsigned long offset = y * width * depth + x * depth;
unsigned char red = x * 256 / width;
@@ -449,7 +453,7 @@ void LLFloater360Capture::capture360Images()
if (gSavedSettings.getBOOL("360CaptureHideAvatars"))
{
// Turn off the avatar if UI tells us to hide it.
- // Note: the original call to gAvatar.hide(FALSE) did *not* hide
+ // Note: the original call to gAvatar.hide(false) did *not* hide
// attachments and so for most residents, there would be some debris
// left behind in the snapshot.
// Note: this toggles so if it set to on, this will turn it off and
@@ -458,7 +462,7 @@ void LLFloater360Capture::capture360Images()
// was set to off - I think this is what we need
LLPipeline::toggleRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR);
LLPipeline::toggleRenderTypeControl(LLPipeline::RENDER_TYPE_PARTICLES);
- LLPipeline::sRenderAttachedLights = FALSE;
+ LLPipeline::sRenderAttachedLights = false;
}
// these are the 6 directions we will point the camera - essentially,
@@ -484,7 +488,7 @@ void LLFloater360Capture::capture360Images()
// 'GPano:InitialViewHeadingDegrees' field.
// We need to convert from the angle getYaw() gives us into something
// the XMP data field wants (N=0, E=90, S=180, W= 270 etc.)
- mInitialHeadingDeg = (360 + 90 - (int)(camera->getYaw() * RAD_TO_DEG)) % 360;
+ mInitialHeadingDeg = (float)((360 + 90 - (int)(camera->getYaw() * RAD_TO_DEG)) % 360);
LL_INFOS("360Capture") << "Recording a heading of " << (int)(mInitialHeadingDeg)
<< " Image size: " << (S32)mSourceImageSize << LL_ENDL;
@@ -789,12 +793,9 @@ void LLFloater360Capture::freezeWorld(bool enable)
LLEnvironment::instance().pauseCloudScroll();
// freeze all avatars
- LLCharacter* avatarp;
- for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
- iter != LLCharacter::sInstances.end(); ++iter)
+ for (LLCharacter* character : LLCharacter::sInstances)
{
- avatarp = *iter;
- mAvatarPauseHandles.push_back(avatarp->requestPause());
+ mAvatarPauseHandles.push_back(character->requestPause());
}
// freeze everything else
@@ -807,7 +808,7 @@ void LLFloater360Capture::freezeWorld(bool enable)
{
// restart the clouds moving if they were not paused before
// we starting using the 360 capture floater
- if (clouds_scroll_paused == false)
+ if (!clouds_scroll_paused)
{
LLEnvironment::instance().resumeCloudScroll();
}