diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 9b7b0cc25c..8eb454d093 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -879,6 +879,8 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & } // If the user only supplies one animation frame (after the ignored reference frame 0), hold for mFrameTime. + // If the user supples exactly one total frame, it isn't clear if that is a pose or reference frame, and the + // behavior is not defined. In this case, retain historical undefined behavior. mDuration = llmax((F32)(mNumFrames - NUMBER_OF_UNPLAYED_FRAMES), 1.0f) * mFrameTime; if (!mLoop) { @@ -1392,11 +1394,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp) continue; } - if (frame == 0) { - LL_WARNS("BVH") << "ERROR: [line: " << getLineNumber() << "] Joint " << ki - joint->mKeys.begin() << " not marked to ignore rotation for initial frame. Not serializing." << LL_ENDL; - return FALSE; - } - time = (F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START) * mFrameTime; // Time elapsed before this frame starts. + time = llmax((F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START), 0.0f) * mFrameTime; // Time elapsed before this frame starts. if (mergeParent) { @@ -1472,11 +1470,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp) continue; } - if (frame == 0) { - LL_WARNS("BVH") << "ERROR: [line: " << getLineNumber() << "] Joint " << ki - joint->mKeys.begin() << " not marked to ignore position for initial frame. Not serializing." << LL_ENDL; - return FALSE; - } - time = (F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START) * mFrameTime; // Time elapsed before this frame starts. + time = llmax((F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START), 0.0f) * mFrameTime; // Time elapsed before this frame starts. LLVector3 inPos = (LLVector3(ki->mPos) - relKey) * ~first_frame_rot;// * fixup_rot; LLVector3 outPos = inPos * frameRot * offsetRot; diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index b68e9e0f82..5f52bc0b15 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -116,14 +116,20 @@ void LLAlignedArray::resize(U32 size) template T& LLAlignedArray::operator[](int idx) { - llassert(idx < mElementCount); + if(idx >= mElementCount) + { + LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL; + } return mArray[idx]; } template const T& LLAlignedArray::operator[](int idx) const { - llassert(idx < mElementCount); + if (idx >= mElementCount) + { + LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL; + } return mArray[idx]; } diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index d350abc90a..f61d692973 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -348,6 +348,7 @@ public: // support right-click context menus for avatar/group lists enum ContextMenuType { MENU_NONE, MENU_AVATAR, MENU_GROUP }; void setContextMenu(const ContextMenuType &menu) { mContextMenuType = menu; } + ContextMenuType getContextMenuType() { return mContextMenuType; } // Overridden from LLView /*virtual*/ void draw(); diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 75df82c15d..b62b861be0 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -102,6 +102,7 @@ BOOL LLFloater360Capture::postBuild() mWebBrowser = getChild("360capture_contents"); mWebBrowser->addObserver(this); + mWebBrowser->setAllowFileDownload(true); // There is a group of radio buttons that define the quality // by each having a 'value' that is returns equal to the pixel diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 6a852baaa1..a750033d60 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -1490,7 +1490,11 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLViewerDynamicT mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR); mDummyAvatar->mSpecialRenderMode = 1; mDummyAvatar->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET); - mDummyAvatar->hideSkirt(); + + // on idle overall apperance update will set skirt to visible, so either + // call early or account for mSpecialRenderMode in updateMeshVisibility + mDummyAvatar->updateOverallAppearance(); + mDummyAvatar->hideSkirt(); // stop extraneous animations mDummyAvatar->stopMotion( ANIM_AGENT_HEAD_ROT, TRUE ); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index b6bd6ce76e..4a5b6243f3 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -46,6 +46,7 @@ #include "lluictrlfactory.h" // LLDefaultChildRegistry #include "llkeyboard.h" #include "llviewermenu.h" +#include "llviewermenufile.h" // LLFilePickerThread // linden library includes #include "llfocusmgr.h" @@ -105,7 +106,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mTrusted(p.trusted_content), mWindowShade(NULL), mHoverTextChanged(false), - mContextMenu(NULL) + mContextMenu(NULL), + mAllowFileDownload(false) { { LLColor4 color = p.caret_color().get(); @@ -1165,8 +1167,23 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) case MEDIA_EVENT_FILE_DOWNLOAD: { - //llinfos << "Media event - file download requested - filename is " << self->getFileDownloadFilename() << llendl; - //LLNotificationsUtil::add("MediaFileDownloadUnsupported"); + if (mAllowFileDownload) + { + // pick a file from SAVE FILE dialog + // for now the only thing that should be allowed to save is 360s + std::string suggested_filename = self->getFileDownloadFilename(); + LLFilePicker::ESaveFilter filter = LLFilePicker::FFSAVE_ALL; + if (suggested_filename.find(".jpg") != std::string::npos || suggested_filename.find(".jpeg") != std::string::npos) + filter = LLFilePicker::FFSAVE_JPEG; + if (suggested_filename.find(".png") != std::string::npos) + filter = LLFilePicker::FFSAVE_PNG; + + (new LLMediaFilePicker(self, filter, suggested_filename))->getFile(); + } + else + { + LLNotificationsUtil::add("MediaFileDownloadUnsupported"); + } }; break; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index b0baeb0ca6..2372e3d7b0 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -151,6 +151,8 @@ public: void setTrustedContent(bool trusted); + void setAllowFileDownload(bool allow) { mAllowFileDownload = allow; } + // over-rides virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleKeyUpHere(KEY key, MASK mask); @@ -206,7 +208,8 @@ public: mClearCache, mHoverTextChanged, mDecoupleTextureSize, - mUpdateScrolls; + mUpdateScrolls, + mAllowFileDownload; std::string mHomePageUrl, mHomePageMimeType, diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index de04ec5e63..81324a9a27 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -295,6 +295,25 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) return handled; } +// virtual +BOOL LLNameListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + LLNameListItem* hit_item = dynamic_cast(hitItem(x, y)); + LLFloater* floater = gFloaterView->getParentFloater(this); + if (floater && floater->isFrontmost() && hit_item) + { + if(hit_item->isGroup()) + { + ContextMenuType prev_menu = getContextMenuType(); + setContextMenu(MENU_GROUP); + BOOL handled = LLScrollListCtrl::handleRightMouseDown(x, y, mask); + setContextMenu(prev_menu); + return handled; + } + } + return LLScrollListCtrl::handleRightMouseDown(x, y, mask); +} + // public void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos, BOOL enabled) diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index ca81c8bfd9..5d88f356db 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -191,6 +191,7 @@ public: /*virtual*/ void updateColumns(bool force_update); /*virtual*/ void mouseOverHighlightNthItem( S32 index ); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); bool isSpecialType() { return (mNameListType == SPECIAL); } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7e83b0bd45..ed9925c059 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -167,10 +167,8 @@ BOOL LLPanelFace::postBuild() childSetCommitCallback("glossiness",&LLPanelFace::onCommitMaterialGloss, this); childSetCommitCallback("environment",&LLPanelFace::onCommitMaterialEnv, this); childSetCommitCallback("maskcutoff",&LLPanelFace::onCommitMaterialMaskCutoff, this); - - mCommitCallbackRegistrar.add("BuildTool.AddMedia", boost::bind(&LLPanelFace::onClickBtnAddMedia, this)); - mCommitCallbackRegistrar.add("BuildTool.DeleteMedia", boost::bind(&LLPanelFace::onClickBtnDeleteMedia, this)); - mCommitCallbackRegistrar.add("BuildTool.EditMedia", boost::bind(&LLPanelFace::onClickBtnEditMedia, this)); + childSetCommitCallback("add_media", &LLPanelFace::onClickBtnAddMedia, this); + childSetCommitCallback("delete_media", &LLPanelFace::onClickBtnDeleteMedia, this); // childSetCommitCallback("checkbox_sync_settings", &LLPanelFace::onClickMapsSync, this); @@ -2941,32 +2939,34 @@ void LLPanelFace::onSelectNormalTexture(const LLSD& data) ////////////////////////////////////////////////////////////////////////////// // called when a user wants to edit existing media settings on a prim or prim face // TODO: test if there is media on the item and only allow editing if present -void LLPanelFace::onClickBtnEditMedia() +void LLPanelFace::onClickBtnEditMedia(LLUICtrl* ctrl, void* userdata) { - refreshMedia(); + LLPanelFace* self = (LLPanelFace*)userdata; + self->refreshMedia(); LLFloaterReg::showInstance("media_settings"); } ////////////////////////////////////////////////////////////////////////////// // called when a user wants to delete media from a prim or prim face -void LLPanelFace::onClickBtnDeleteMedia() +void LLPanelFace::onClickBtnDeleteMedia(LLUICtrl* ctrl, void* userdata) { LLNotificationsUtil::add("DeleteMedia", LLSD(), LLSD(), deleteMediaConfirm); } ////////////////////////////////////////////////////////////////////////////// // called when a user wants to add media to a prim or prim face -void LLPanelFace::onClickBtnAddMedia() +void LLPanelFace::onClickBtnAddMedia(LLUICtrl* ctrl, void* userdata) { // check if multiple faces are selected if (LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { - refreshMedia(); + LLPanelFace* self = (LLPanelFace*)userdata; + self->refreshMedia(); LLNotificationsUtil::add("MultipleFacesSelected", LLSD(), LLSD(), multipleFacesSelectedConfirm); } else { - onClickBtnEditMedia(); + onClickBtnEditMedia(ctrl, userdata); } } diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 21d5e1bc52..8e913c4872 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -151,9 +151,6 @@ protected: void onCommitNormalTexture(const LLSD& data); void onCancelNormalTexture(const LLSD& data); void onSelectNormalTexture(const LLSD& data); - void onClickBtnEditMedia(); - void onClickBtnDeleteMedia(); - void onClickBtnAddMedia(); void onCommitColor(const LLSD& data); void onCommitShinyColor(const LLSD& data); void onCommitAlpha(const LLSD& data); @@ -211,6 +208,9 @@ protected: static void onCommitMaterialsMedia( LLUICtrl* ctrl, void* userdata); static void onCommitMaterialType( LLUICtrl* ctrl, void* userdata); + static void onClickBtnEditMedia(LLUICtrl* ctrl, void* userdata); + static void onClickBtnDeleteMedia(LLUICtrl* ctrl, void* userdata); + static void onClickBtnAddMedia(LLUICtrl* ctrl, void* userdata); static void onCommitBump( LLUICtrl* ctrl, void* userdata); static void onCommitTexGen( LLUICtrl* ctrl, void* userdata); static void onCommitShiny( LLUICtrl* ctrl, void* userdata); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index e6eedd76bf..ad3e596378 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -926,7 +926,10 @@ bool LLPreviewNotecard::loadNotecardText(const std::string& filename) buffer[nread] = '\0'; fclose(file); - mEditor->setText(LLStringExplicit(buffer)); + std::string text = std::string(buffer); + LLStringUtil::replaceTabsWithSpaces(text, LLTextEditor::spacesPerTab()); + + mEditor->setText(text); delete[] buffer; return true; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ba8801bbce..6f44f524bf 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -78,41 +78,12 @@ #include // for SkinFolder listener #include -class LLMediaFilePicker : public LLFilePickerThread // deletes itself when done -{ -public: - LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) - : LLFilePickerThread(filter, get_multiple), - mPlugin(plugin->getSharedPrt()) - { - } - - LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ESaveFilter filter, const std::string &proposed_name) - : LLFilePickerThread(filter, proposed_name), - mPlugin(plugin->getSharedPrt()) - { - } - - virtual void notify(const std::vector& filenames) - { - mPlugin->sendPickFileResponse(mResponses); - mPlugin = NULL; - } - -private: - boost::shared_ptr mPlugin; -}; void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) { (new LLMediaFilePicker(plugin, filter, get_multiple))->getFile(); // will delete itself } -void init_threaded_picker_save_dialog(LLPluginClassMedia* plugin, LLFilePicker::ESaveFilter filter, std::string &proposed_name) -{ - (new LLMediaFilePicker(plugin, filter, proposed_name))->getFile(); // will delete itself -} - /////////////////////////////////////////////////////////////////////////////// // Move this to its own file. @@ -3301,18 +3272,11 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla case LLViewerMediaObserver::MEDIA_EVENT_FILE_DOWNLOAD: { LL_DEBUGS("Media") << "Media event - file download requested - filename is " << plugin->getFileDownloadFilename() << LL_ENDL; - // pick a file from SAVE FILE dialog - // need a better algorithm that this or else, pass in type of save type - // from event that initiated it - this is okay for now - only thing - // that saves is 360s - std::string suggested_filename = plugin->getFileDownloadFilename(); - LLFilePicker::ESaveFilter filter = LLFilePicker::FFSAVE_ALL; - if (suggested_filename.find(".jpg") != std::string::npos || suggested_filename.find(".jpeg") != std::string::npos) - filter = LLFilePicker::FFSAVE_JPEG; - if (suggested_filename.find(".png") != std::string::npos) - filter = LLFilePicker::FFSAVE_PNG; - init_threaded_picker_save_dialog(plugin, filter, suggested_filename); + //unblock media plugin + const std::vector empty_response; + plugin->sendPickFileResponse(empty_response); + LLNotificationsUtil::add("MediaFileDownloadUnsupported"); } break; diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 9cc8e46187..a615857d22 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -46,6 +46,7 @@ #include "llimagejpeg.h" #include "llimagetga.h" #include "llinventorymodel.h" // gInventory +#include "llpluginclassmedia.h" #include "llresourcedata.h" #include "lltoast.h" #include "llfloaterperms.h" @@ -259,6 +260,25 @@ void LLFilePickerReplyThread::notify(const std::vector& filenames) } } + +LLMediaFilePicker::LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) + : LLFilePickerThread(filter, get_multiple), + mPlugin(plugin->getSharedPrt()) +{ +} + +LLMediaFilePicker::LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ESaveFilter filter, const std::string &proposed_name) + : LLFilePickerThread(filter, proposed_name), + mPlugin(plugin->getSharedPrt()) +{ +} + +void LLMediaFilePicker::notify(const std::vector& filenames) +{ + mPlugin->sendPickFileResponse(mResponses); + mPlugin = NULL; +} + //============================================================================ #if LL_WINDOWS diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index bcde38d591..b3b4ad71b9 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -38,6 +38,7 @@ #include // class LLTransactionID; +class LLPluginClassMedia; void init_menu_file(); @@ -72,6 +73,7 @@ void assign_defaults_and_show_upload_message( const std::string& display_name, std::string& description); +//consider moving all file pickers below to more suitable place class LLFilePickerThread : public LLThread { //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread) public: @@ -128,4 +130,17 @@ private: file_picked_signal_t* mFailureSignal; }; +class LLMediaFilePicker : public LLFilePickerThread +{ +public: + LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple); + LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ESaveFilter filter, const std::string &proposed_name); + + virtual void notify(const std::vector& filenames); + +private: + boost::shared_ptr mPlugin; +}; + + #endif diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 368a5bcf2e..45956f561b 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -499,10 +499,7 @@ top_pad="4" tool_tip="Add Media" label="Choose..." - width="85"> - - + width="85"/> + width="85"/>