diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/lldate.cpp | 23 | ||||
-rw-r--r-- | indra/llcommon/llthread.h | 2 | ||||
-rw-r--r-- | indra/llimage/llimagepng.cpp | 1 | ||||
-rw-r--r-- | indra/llmessage/llares.cpp | 4 | ||||
-rw-r--r-- | indra/llmessage/llhttpclient.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llagentcamera.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 79 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 4 |
8 files changed, 78 insertions, 54 deletions
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index de7f2ead74..a7ef28b431 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -248,8 +248,27 @@ bool LLDate::fromStream(std::istream& s) s >> fractional; seconds_since_epoch += fractional; } - c = s.get(); // skip the Z - if (c != 'Z') { return false; } + + c = s.peek(); // check for offset + if (c == '+' || c == '-') + { + S32 offset_sign = (c == '+') ? 1 : -1; + S32 offset_hours = 0; + S32 offset_minutes = 0; + S32 offset_in_seconds = 0; + + s >> offset_hours; + + c = s.get(); // skip the colon a get the minutes if there are any + if (c == ':') + { + s >> offset_minutes; + } + + offset_in_seconds = (offset_hours * 60 + offset_sign * offset_minutes) * 60; + seconds_since_epoch -= offset_in_seconds; + } + else if (c != 'Z') { return false; } // skip the Z mSecondsSinceEpoch = seconds_since_epoch; return true; diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index adef1a9192..dbb8ec5231 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -135,7 +135,7 @@ class LL_COMMON_API LLMutex { public: LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex - ~LLMutex(); + virtual ~LLMutex(); void lock(); // blocks void unlock(); diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index b5de104e61..a6ab246a2c 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -135,6 +135,7 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer)) { setLastError(pngWrapper.getErrorMessage()); + delete[] mTmpWriteBuffer; return FALSE; } diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp index 78561b37aa..5b7e5138ef 100644 --- a/indra/llmessage/llares.cpp +++ b/indra/llmessage/llares.cpp @@ -108,7 +108,8 @@ LLAres::LLAres() : mInitSuccess(false), mListener(new LLAresListener(this)) { - if (ares_init(&chan_) != ARES_SUCCESS) + if (ares_library_init( ARES_LIB_INIT_ALL ) != ARES_SUCCESS || + ares_init(&chan_) != ARES_SUCCESS) { llwarns << "Could not succesfully initialize ares!" << llendl; return; @@ -120,6 +121,7 @@ LLAres::LLAres() : LLAres::~LLAres() { ares_destroy(chan_); + ares_library_cleanup(); } void LLAres::cancel() diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 9c2e4b5658..e8dc207114 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -199,6 +199,7 @@ namespace fileBuffer = new U8 [fileSize]; vfile.read(fileBuffer, fileSize); ostream.write((char*)fileBuffer, fileSize); + delete [] fileBuffer; eos = true; return STATUS_DONE; } diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c3f075fd49..977f1c9fa8 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2312,12 +2312,6 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came startCameraAnimation(); } - // Remove any pitch from the avatar - //LLVector3 at = gAgent.getFrameAgent().getAtAxis(); - //at.mV[VZ] = 0.f; - //at.normalize(); - //gAgent.resetAxes(at); - if (mCameraMode != CAMERA_MODE_CUSTOMIZE_AVATAR) { updateLastCamera(); @@ -2338,9 +2332,11 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came if (isAgentAvatarValid()) { if(avatar_animate) - { - // Remove any pitch from the avatar - LLVector3 at = gAgent.getFrameAgent().getAtAxis(); + { + // slamming the avatar's axis to the camera so that when the rotation + // completes it correctly points to the front of the avatar + // Remove any pitch or rotation from the avatar + LLVector3 at = LLViewerCamera::getInstance()->getAtAxis(); at.mV[VZ] = 0.f; at.normalize(); gAgent.resetAxes(at); @@ -2360,6 +2356,10 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came mAnimationDuration = gSavedSettings.getF32("ZoomTime"); } } + + // this is what sets the avatar as the mFocusTargetGlobal + setFocusGlobal(LLVector3d::zero); + gAgentAvatarp->updateMeshTextures(); } else diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 00981d3c25..129dd55e48 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -164,8 +164,6 @@ public: void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); LLFloaterPostcard* savePostcard(); - void confirmSavingTexture(bool set_as_profile_pic = false); - bool onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic); void saveTexture(bool set_as_profile_pic = false); BOOL saveLocal(); void saveWeb(std::string url); @@ -981,27 +979,6 @@ void profile_pic_upload_callback(const LLUUID& uuid) floater->setAsProfilePic(uuid); } -void LLSnapshotLivePreview::confirmSavingTexture(bool set_as_profile_pic) -{ - LLSD args; - args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), - boost::bind(&LLSnapshotLivePreview::onSavingTextureConfirmed, this, _1, _2, set_as_profile_pic)); -} - -bool LLSnapshotLivePreview::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if (option == 0) - { - saveTexture(set_as_profile_pic); - } - - return false; -} - - void LLSnapshotLivePreview::saveTexture(bool set_as_profile_pic) { // gen a new uuid for this asset @@ -1180,6 +1157,9 @@ public: static void onCommitSnapshotFormat(LLUICtrl* ctrl, void* data); static void onCommitCustomResolution(LLUICtrl *ctrl, void* data); static void onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type); + static void confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic = false); + static void onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic); + static void checkCloseOnKeep(LLFloaterSnapshot* view); static void onCommitProfilePic(LLFloaterSnapshot* view); static void showAdvanced(LLFloaterSnapshot* view, const BOOL visible); static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ; @@ -1719,13 +1699,7 @@ public: void LLFloaterSnapshot::Impl::onCommitProfilePic(LLFloaterSnapshot* view) { - //first save to harddrive - LLSnapshotLivePreview* previewp = getPreviewView(view); - - if(previewp) - { - previewp->confirmSavingTexture(true); - } + confirmSavingTexture(view, true); } void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type) @@ -1739,14 +1713,17 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh if (type == LLSnapshotLivePreview::SNAPSHOT_WEB) { previewp->saveWeb(view->getString("share_to_web_url")); + checkCloseOnKeep(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_LOCAL) { previewp->saveLocal(); + checkCloseOnKeep(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) { - previewp->confirmSavingTexture(); + // uploads and then calls checkCloseOnKeep() on confirmation from user + confirmSavingTexture(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) { @@ -1759,16 +1736,40 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh gSnapshotFloaterView->addChild(floater); view->addDependentFloater(floater, FALSE); } + checkCloseOnKeep(view); } + } +} - if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) - { - view->closeFloater(); - } - else - { - checkAutoSnapshot(previewp); - } +void LLFloaterSnapshot::Impl::confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic) +{ + LLSD args; + args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), + boost::bind(&onSavingTextureConfirmed, _1, _2, view, set_as_profile_pic)); +} + +void LLFloaterSnapshot::Impl::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + LLSnapshotLivePreview* previewp = getPreviewView(view); + previewp->saveTexture(set_as_profile_pic); + checkCloseOnKeep(view); + } +} + +void LLFloaterSnapshot::Impl::checkCloseOnKeep(LLFloaterSnapshot* view) +{ + if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) + { + view->closeFloater(); + } + else + { + checkAutoSnapshot(getPreviewView(view)); } } diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index e23643da0b..445bde1206 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -352,12 +352,12 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we if (visible) { - mEditWearable->setWearable(wearable); - mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency if (!disable_camera_switch && gSavedSettings.getBOOL("AppearanceCameraMovement") ) { gAgentCamera.changeCameraToCustomizeAvatar(); } + mEditWearable->setWearable(wearable); + mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency } else { |