diff options
author | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2007-06-21 22:40:22 +0000 |
commit | e03bb0606a10f29c8b94909a713a5bb5c69e88b7 (patch) | |
tree | 6d8d07894579438c8cc70e08f5730c3c95dfe768 /indra/newview | |
parent | 2638f12f95eea692502836cf6548b4a0b234d009 (diff) |
merge -r62831:64079 branches/maintenance to release
Diffstat (limited to 'indra/newview')
92 files changed, 1387 insertions, 300 deletions
diff --git a/indra/newview/fmodwrapper.cpp b/indra/newview/fmodwrapper.cpp index 99fd95434f..452d2fb9d7 100644 --- a/indra/newview/fmodwrapper.cpp +++ b/indra/newview/fmodwrapper.cpp @@ -16,4 +16,4 @@ void* fmodwrapper(void) // When building the fmodwrapper library, the linker doesn't seem to want to bring in libfmod.a unless I explicitly // reference at least one symbol in the library. This seemed like the simplest way. return (void*)&FSOUND_Init; -}
\ No newline at end of file +} diff --git a/indra/newview/licenses-linux.txt b/indra/newview/licenses-linux.txt index 1892b810f1..826e044d0a 100644 --- a/indra/newview/licenses-linux.txt +++ b/indra/newview/licenses-linux.txt @@ -547,3 +547,96 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +============== +libpng license +============== + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are +Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors: + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and +must not be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from + any source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. diff --git a/indra/newview/licenses-mac.txt b/indra/newview/licenses-mac.txt index 6fcf461933..24539e52b0 100644 --- a/indra/newview/licenses-mac.txt +++ b/indra/newview/licenses-mac.txt @@ -432,3 +432,96 @@ jloup@gzip.org Mark Adler madler@alumni.caltech.edu + +============== +libpng license +============== + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are +Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors: + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and +must not be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from + any source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. diff --git a/indra/newview/licenses-win32.txt b/indra/newview/licenses-win32.txt index 6fcf461933..24539e52b0 100644 --- a/indra/newview/licenses-win32.txt +++ b/indra/newview/licenses-win32.txt @@ -432,3 +432,96 @@ jloup@gzip.org Mark Adler madler@alumni.caltech.edu + +============== +libpng license +============== + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are +Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors: + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and +must not be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from + any source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index 048aaf6382..d77da8814c 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -38,7 +38,7 @@ export LL_GL_BASICEXT=x ## you're building your own viewer, bear in mind that the executable ## in the bin directory will be stripped: you should replace it with ## an unstripped binary before you run. -#export LL_WRAPPER='valgrind --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp' +#export LL_WRAPPER='valgrind --smc-check=all --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp' ## - Avoids an often-buggy X feature that doesn't really benefit us anyway. export SDL_VIDEO_X11_DGAMOUSE=0 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c6155197f6..f2cb9ea9ca 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1999,11 +1999,6 @@ void LLAgent::setAFK() return; } - if (!gAllowAFK) - { - return; - } - if (!gAgent.getRegion()) { // Don't set AFK if we're not talking to a region yet. diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 4b6e8c6996..2ee6634467 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -220,7 +220,7 @@ public: const LLUUID &getGroupID() const { return mGroupID; } ECameraMode getCameraMode() const { return mCameraMode; } BOOL getFocusOnAvatar() const { return mFocusOnAvatar; } - LLViewerObject* getFocusObject() const { return mFocusObject; } + LLPointer<LLViewerObject>& getFocusObject() { return mFocusObject; } F32 getFocusObjectDist() const { return mFocusObjectDist; } BOOL inPrelude(); BOOL canManageEstate() const; diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 789beaae39..79faec1211 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -122,7 +122,7 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content) else { LLHTTPClient::postFile(uploader, mFileName, this); - }
+ } } void LLAssetUploadResponder::uploadFailure(const LLSD& content) diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 4beea0d112..1a65903dcd 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -427,7 +427,7 @@ void LLChatBar::sendChat( EChatType type ) if (!text.empty()) { // store sent line in history, duplicates will get filtered - mInputEditor->updateHistory(); + if (mInputEditor) mInputEditor->updateHistory(); // Check if this is destined for another channel S32 channel = 0; stripChannelNumber(text, &channel); diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp index 938a6ebd11..c62459f461 100644 --- a/indra/newview/lldebugmessagebox.cpp +++ b/indra/newview/lldebugmessagebox.cpp @@ -57,6 +57,9 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy addChild(mSlider2); addChild(mSlider3); break; + default: + llwarns << "Unhandled var type " << var_type << llendl; + break; } mAnimateButton = new LLButton("Animate", LLRect(20, 45, 180, 25), "", onAnimateClicked, this); @@ -165,12 +168,17 @@ void LLDebugVarMessageBox::slider_changed(LLUICtrl* ctrl, void* user_data) *((S32*)msg_box->mVarData) = (S32)msg_box->mSlider1->getValue().asInteger(); break; case VAR_TYPE_VEC3: + { LLVector3* vec_p = (LLVector3*)msg_box->mVarData; vec_p->setVec((F32)msg_box->mSlider1->getValue().asReal(), (F32)msg_box->mSlider2->getValue().asReal(), (F32)msg_box->mSlider3->getValue().asReal()); break; } + default: + llwarns << "Unhandled var type " << msg_box->mVarType << llendl; + break; + } } void LLDebugVarMessageBox::onAnimateClicked(void* user_data) @@ -197,10 +205,15 @@ void LLDebugVarMessageBox::draw() snprintf(text, sizeof(text), "%d", *((S32*)mVarData)); /* Flawfinder: ignore */ break; case VAR_TYPE_VEC3: + { LLVector3* vec_p = (LLVector3*)mVarData; snprintf(text, sizeof(text), "%.3f %.3f %.3f", vec_p->mV[VX], vec_p->mV[VY], vec_p->mV[VZ]); /* Flawfinder: ignore */ break; } + default: + llwarns << "Unhandled var type " << mVarType << llendl; + break; + } mText->setText(text); if(mAnimate) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 5af5353c1b..16f463c32a 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1304,7 +1304,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* if (parent) { - av = (LLVOAvatar*) parent->getVObj(); + av = (LLVOAvatar*) parent->getVObj().get(); if (!av->isVisible()) { diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 6192d405af..782775d338 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -62,8 +62,8 @@ public: const LLViewerRegion* getRegion() const { return mVObjp->getRegion(); } const LLTextureEntry* getTextureEntry(U8 which) const { return mVObjp->getTE(which); } - LLViewerObject* getVObj() { return mVObjp; } - const LLViewerObject* getVObj() const { return mVObjp; } + LLPointer<LLViewerObject>& getVObj() { return mVObjp; } + const LLViewerObject *getVObj() const { return mVObjp; } LLVOVolume* getVOVolume() const; // cast mVObjp tp LLVOVolume if OK const LLMatrix4& getWorldMatrix() const { return mXform.getWorldMatrix(); } diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index b2e7272336..2626a8bd31 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -466,15 +466,20 @@ void LLRenderPass::renderInvisible(U32 mask) std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[LLRenderPass::PASS_INVISIBLE]; - U32* indices_pointer = NULL; for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i) { LLDrawInfo& params = **i; - params.mVertexBuffer->setBuffer(mask); - indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, - GL_UNSIGNED_INT, indices_pointer+params.mOffset); - gPipeline.mTrianglesDrawn += params.mCount/3; + + if (params.mVertexBuffer) + { + params.mVertexBuffer->setBuffer(mask); + U32 *indices_pointer = + (U32 *) params.mVertexBuffer->getIndicesPointer(); + glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, + params.mCount, GL_UNSIGNED_INT, + indices_pointer + params.mOffset); + gPipeline.mTrianglesDrawn += params.mCount / 3; + } } } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ee0ed22e35..f484cebe72 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -299,7 +299,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) { return; } - avatarp = (LLVOAvatar *)(facep->getDrawable()->getVObj()); + avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); } if (avatarp->isDead() || avatarp->mDrawable.isNull()) @@ -505,7 +505,7 @@ void LLDrawPoolAvatar::renderForSelect() { return; } - LLVOAvatar *avatarp = (LLVOAvatar *)(facep->getDrawable()->getVObj()); + LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) { diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 350ad6a652..e6e0f5c965 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -144,7 +144,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting) U32* indicesp = (U32*) face->mVertexBuffer->getIndicesPointer(); // Render each of the trees - LLVOTree *treep = (LLVOTree *)drawablep->getVObj(); + LLVOTree *treep = (LLVOTree *)drawablep->getVObj().get(); LLColor4U color(255,255,255,255); diff --git a/indra/newview/lldriverparam.h b/indra/newview/lldriverparam.h index 06850e3eaf..8cdaa893c8 100644 --- a/indra/newview/lldriverparam.h +++ b/indra/newview/lldriverparam.h @@ -84,7 +84,7 @@ protected: typedef std::vector<LLDrivenEntry> entry_list_t; entry_list_t mDriven; LLViewerVisualParam* mCurrentDistortionParam; - LLVOAvatar* mAvatarp; + LLPointer<LLVOAvatar> mAvatarp; }; #endif // LL_LLDRIVERPARAM_H diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 6d1c384b5a..4452a134ae 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -1,8 +1,8 @@ -/** +/** * @file lleventpoll.cpp - * @brief Implementation of the LLEventPoll class. + * @brief Implementation of the LLEventPoll class. * - * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. * $License$ */ diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 044ae33ccc..14f3d4ad2b 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1378,7 +1378,7 @@ void LLFace::enableLights() const } if (isState(LIGHT)) { - const LLVOVolume* vovolume = (const LLVOVolume*)(mDrawablep->getVObj()); + const LLVOVolume* vovolume = (const LLVOVolume*)mDrawablep->getVObj(); gPipeline.setAmbient(vovolume->getLightColor()); } } diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 6f43460f70..51e918e1d5 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -29,7 +29,7 @@ LLFilePicker LLFilePicker::sInstance; #if LL_WINDOWS #define SOUND_FILTER L"Sounds (*.wav)\0*.wav\0" -#define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg)\0*.tga;*.bmp;*.jpg;*.jpeg\0" +#define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)\0*.tga;*.bmp;*.jpg;*.jpeg;*.png\0" #define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0" #ifdef _CORY_TESTING #define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0" @@ -491,10 +491,12 @@ Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callB if (fileInfo.filetype != 'JPEG' && fileInfo.filetype != 'JPG ' && fileInfo.filetype != 'BMP ' && fileInfo.filetype != 'TGA ' && fileInfo.filetype != 'BMPf' && fileInfo.filetype != 'TPIC' && + fileInfo.filetype != 'PNG ' && (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("jpeg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && CFStringCompare(fileInfo.extension, CFSTR("jpg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && CFStringCompare(fileInfo.extension, CFSTR("bmp"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("tga"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) + CFStringCompare(fileInfo.extension, CFSTR("tga"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && + CFStringCompare(fileInfo.extension, CFSTR("png"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) ) { result = false; @@ -1149,7 +1151,7 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) case FFLOAD_ANIM: caption += "Animations (*.bvh)"; break; case FFLOAD_IMAGE: - caption += "Images (*.tga; *.bmp; *.jpg; *.jpeg)"; break; + caption += "Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)"; break; default:; break; } diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 4a4e1a9ed4..9f05e59ac8 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -40,6 +40,18 @@ void LLFirstUse::disableFirstUse() } } +// static +void LLFirstUse::resetFirstUse() +{ + // Set all first-use warnings to disabled + for (std::set<LLString>::iterator iter = sConfigVariables.begin(); + iter != sConfigVariables.end(); ++iter) + { + gSavedSettings.setWarning(*iter, TRUE); + } +} + + // Called whenever the viewer detects that your balance went up void LLFirstUse::useBalanceIncrease(S32 delta) { @@ -194,3 +206,25 @@ void LLFirstUse::useFlexible() } } +// static +void LLFirstUse::useDebugMenus() +{ + if (gSavedSettings.getWarning("FirstDebugMenus")) + { + gSavedSettings.setWarning("FirstDebugMenus", FALSE); + + LLNotifyBox::showXml("FirstDebugMenus"); + } +} + +// static +void LLFirstUse::useSculptedPrim() +{ + if (gSavedSettings.getWarning("FirstSculptedPrim")) + { + gSavedSettings.setWarning("FirstSculptedPrim", FALSE); + + LLNotifyBox::showXml("FirstSculptedPrim"); + + } +} diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index b367619196..134699d1ec 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -46,6 +46,10 @@ object or from inventory. 11. FIrst time you run the client on a system without QuickTime installed. 12. First time you create a flexible object. + +13. First time you open the debug menus (ctrl-alt-shift D) + +14. First time you create/edit a sculpted prim. */ class LLFirstUse @@ -56,6 +60,7 @@ public: // Sets all controls back to show the dialogs. static void disableFirstUse(); + static void resetFirstUse(); // These methods are called each time the appropriate action is // taken. The functions themselves handle only showing the dialog @@ -74,6 +79,8 @@ public: static void useInventory(); static void useSandbox(); static void useFlexible(); + static void useDebugMenus(); + static void useSculptedPrim(); protected: static std::set<LLString> sConfigVariables; diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 5a7a12c38d..3107b062b7 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -232,12 +232,6 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons //--------------------------------------------------------------------------------- BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE)) - { - return FALSE; // (we are not initialized or updated) - } - - LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE); if (mVO->mDrawable.isNull()) { @@ -252,6 +246,8 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 LLViewerObject* parent = (LLViewerObject*) mVO->getParent(); parent->mDrawable->mQuietCount = 0; } + + LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE); S32 new_res = mAttributes->getSimulateLOD(); @@ -264,6 +260,8 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 { mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS; } + + // Bottom cap at 1/4 the original number of sections if (mRenderRes < mAttributes->getSimulateLOD()-1) { @@ -281,6 +279,10 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 setAttributesOfAllSections(); mInitialized = TRUE; } + if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE)) + { + return FALSE; // (we are not initialized or updated) + } if (mVO->mDrawable->isVisible() && !mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) && @@ -604,7 +606,7 @@ void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped) BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) { - LLVOVolume *volume = (LLVOVolume*)mVO; + LLVOVolume *volume = (LLVOVolume*)mVO.get(); if (volume->mDrawable.isNull()) // Not sure why this is happening, but it is... { @@ -720,7 +722,7 @@ void LLVolumeImplFlexible::updateRelativeXform() { LLQuaternion delta_rot; LLVector3 delta_pos, delta_scale; - LLVOVolume* vo = (LLVOVolume*) mVO; + LLVOVolume* vo = (LLVOVolume*) mVO.get(); //matrix from local space to parent relative/global space delta_rot = vo->mDrawable->isSpatialRoot() ? LLQuaternion() : vo->mDrawable->getRotation(); diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h index 5a782bc617..3a26604913 100644 --- a/indra/newview/llflexibleobject.h +++ b/indra/newview/llflexibleobject.h @@ -91,7 +91,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface //-------------------------------------- // private members //-------------------------------------- - LLViewerObject* mVO; + LLPointer<LLViewerObject> mVO; LLTimer mTimer; LLVector3 mAnchorPosition; LLVector3 mParentPosition; diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index 858d586274..fe6f19e962 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -41,7 +41,7 @@ protected: F32 mCameraZoom; LLVector3 mCameraOffset; LLVector3 mCameraRelPos; - LLVOAvatar* mDummyAvatar; + LLPointer<LLVOAvatar> mDummyAvatar; }; class LLFloaterAnimPreview : public LLFloaterNameDesc diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 93eb24f36d..75c68acb78 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -130,12 +130,22 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLString& line, const edit->appendColoredText(line, false, prepend_newline, color); } +void log_chat_text(const LLChat& chat) +{ + LLString histstr; + if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp")) + histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText; + else + histstr = chat.mText; + + LLLogChat::saveHistory("chat",histstr); +} // static void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) { - LLLogChat::saveHistory("chat",chat.mText); + log_chat_text(chat); } LLColor4 color = get_text_color(chat); @@ -344,10 +354,14 @@ void LLFloaterChat::addChat(const LLChat& chat, gConsole->addLine(chat.mText, size, text_color); } - if( !from_instant_message || gSavedSettings.getBOOL("IMInChatHistory") ) - { + if(from_instant_message && gSavedPerAccountSettings.getBOOL("LogChatIM")) + log_chat_text(chat); + + if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) + addChatHistory(chat,false); + + if(!from_instant_message) addChatHistory(chat); - } } LLColor4 get_text_color(const LLChat& chat) @@ -380,6 +394,10 @@ LLColor4 get_text_color(const LLChat& chat) { text_color = gSavedSettings.getColor4("ScriptErrorColor"); } + else if ( chat.mChatType == CHAT_TYPE_OWNER ) + { + text_color = gSavedSettings.getColor4("llOwnerSayChatColor"); + } else { text_color = gSavedSettings.getColor4("ObjectChatColor"); diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 4f7ef34fe1..457a87adb2 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -13,6 +13,7 @@ #include "llimagebmp.h" #include "llimagetga.h" #include "llimagejpeg.h" +#include "llimagepng.h" #include "llagent.h" #include "llbutton.h" @@ -305,6 +306,10 @@ bool LLFloaterImagePreview::loadImage(const char *src_filename) { codec = IMG_CODEC_JPEG; } + else if( 0 == strnicmp(ext, ".png", 4) ) + { + codec = IMG_CODEC_PNG; + } LLPointer<LLImageRaw> raw_image = new LLImageRaw; @@ -362,6 +367,21 @@ bool LLFloaterImagePreview::loadImage(const char *src_filename) } } break; + case IMG_CODEC_PNG: + { + LLPointer<LLImagePNG> png_image = new LLImagePNG; + + if (!png_image->load(src_filename)) + { + return false; + } + + if (!png_image->decode(raw_image)) + { + return false; + } + } + break; default: return false; } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 233357453d..daf3067d7b 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -2,7 +2,7 @@ * @file llfloaterinspect.cpp * @brief Floater for object inspection tool * - * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc. + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. * $License$ */ diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index d221879d0e..99bae0f73b 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -1,10 +1,10 @@ /** -* @file llfloaterfriends.h +* @file llfloaterinspect.h * @author Cube * @date 2006-12-16 * @brief Declaration of class for displaying object attributes * -* Copyright (c) 2005-$CurrentYear$, Linden Research, Inc. +* Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. * $License$ */ diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 9f990d47b7..b1143c4e7b 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1537,6 +1537,13 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo { LLPanelLandObjects* self = LLFloaterLand::getCurrentPanelLandObjects(); + if (!self) + { + llwarns << "Received message for nonexistent LLPanelLandObject" + << llendl; + return; + } + const LLFontGL* FONT = LLFontGL::sSansSerif; // Extract all of the owners. diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index ecab84f5d9..3eaff0101c 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -56,12 +56,12 @@ LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LL mJPEGImage(jpeg), mViewerImage(img), mImageScale(img_scale), - mPosTakenGlobal(pos_taken_global) + mPosTakenGlobal(pos_taken_global), + mHasFirstMsgFocus(false) { init(); } - void LLFloaterPostcard::init() { // pick up the user's up-to-date email address @@ -108,25 +108,24 @@ BOOL LLFloaterPostcard::postBuild() gAgent.buildFullname(name_string); childSetValue("name_form", LLSD(name_string)); - - // XUI:translate - LLString msg("Postcard from "); - msg += gSecondLife; - childSetValue("subject_form", LLSD(msg)); LLTextEditor *MsgField = LLUICtrlFactory::getTextEditorByName(this, "msg_form"); if (MsgField) { - MsgField->setText("Check this out!"); MsgField->setWordWrap(TRUE); - } - childSetFocus("to_form", TRUE); + // For the first time a user focusess to .the msg box, all text will be selected. + MsgField->setFocusChangedCallback(onMsgFormFocusRecieved); + MsgField->setCallbackUserData(this); + } + childSetFocus("to_form", TRUE); + return TRUE; } + // static LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLImageGL *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global) { @@ -247,46 +246,16 @@ void LLFloaterPostcard::onClickSend(void* data) return; } - if (self->mJPEGImage.notNull()) + LLString subject(self->childGetValue("subject_form").asString().c_str()); + if(subject.empty() || !self->mHasFirstMsgFocus) { - self->mTransactionID.generate(); - self->mAssetID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID()); - LLVFile::writeFile(self->mJPEGImage->getData(), self->mJPEGImage->getDataSize(), gVFS, self->mAssetID, LLAssetType::AT_IMAGE_JPEG); - - // upload the image - std::string url = gAgent.getRegion()->getCapability("SendPostcard"); - if(!url.empty()) - { - llinfos << "Send Postcard via capability" << llendl; - LLSD body = LLSD::emptyMap(); - // the capability already encodes: agent ID, region ID - body["pos-global"] = self->mPosTakenGlobal.getValue(); - body["to"] = self->childGetValue("to_form").asString(); - body["from"] = self->childGetValue("from_form").asString(); - body["name"] = self->childGetValue("name_form").asString(); - body["subject"] = self->childGetValue("subject_form").asString(); - body["msg"] = self->childGetValue("msg_form").asString(); - body["allow-publish"] = self->childGetValue("allow_publish_check").asBoolean(); - body["mature-publish"] = self->childGetValue("mature_check").asBoolean(); - LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, self->mAssetID, LLAssetType::AT_IMAGE_JPEG)); - } - else - { - gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)self, FALSE); - } - - LLUploadDialog::modalUploadDialog("Uploading...\n\nPostcard"); - - // don't destroy the window until the upload is done - // this way we keep the information in the form - self->setVisible(FALSE); + gViewerWindow->alertXml("PromptMissingSubjMsg", missingSubjMsgAlertCallback, self); + return; + } - // also remove any dependency on another floater - // so that we can be sure to outlive it while we - // need to. - LLFloater* dependee = self->getDependee(); - if (dependee) - dependee->removeDependentFloater(self); + if (self->mJPEGImage.notNull()) + { + self->sendPostcard(); } else { @@ -355,3 +324,86 @@ void LLFloaterPostcard::updateUserInfo(const char *email) } } } + +void LLFloaterPostcard::onMsgFormFocusRecieved(LLUICtrl* receiver, void* data) +{ + LLFloaterPostcard* self = (LLFloaterPostcard *)data; + if(self) + { + LLTextEditor* msgForm = LLUICtrlFactory::getTextEditorByName(self, "msg_form"); + if(msgForm && msgForm == receiver && msgForm->hasFocus() && !(self->mHasFirstMsgFocus)) + { + self->mHasFirstMsgFocus = true; + msgForm->setText(LLString("")); + } + } +} + +void LLFloaterPostcard::missingSubjMsgAlertCallback(S32 option, void* data) +{ + if(data) + { + LLFloaterPostcard* self = static_cast<LLFloaterPostcard*>(data); + if(0 == option) + { + // User clicked OK + if((self->childGetValue("subject_form").asString()).empty()) + { + // Stuff the subject back into the form. + self->childSetValue("subject_form", self->childGetText("default_subject")); + } + + if(!self->mHasFirstMsgFocus) + { + // The user never switched focus to the messagee window. + // Using the default string. + // XUI: translate + self->childSetValue("msg_form", self->childGetText("default_message")); + } + + self->sendPostcard(); + } + } +} + +void LLFloaterPostcard::sendPostcard() +{ + mTransactionID.generate(); + mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID()); + LLVFile::writeFile(mJPEGImage->getData(), mJPEGImage->getDataSize(), gVFS, mAssetID, LLAssetType::AT_IMAGE_JPEG); + + // upload the image + std::string url = gAgent.getRegion()->getCapability("SendPostcard"); + if(!url.empty()) + { + llinfos << "Send Postcard via capability" << llendl; + LLSD body = LLSD::emptyMap(); + // the capability already encodes: agent ID, region ID + body["pos-global"] = mPosTakenGlobal.getValue(); + body["to"] = childGetValue("to_form").asString(); + body["from"] = childGetValue("from_form").asString(); + body["name"] = childGetValue("name_form").asString(); + body["subject"] = childGetValue("subject_form").asString(); + body["msg"] = childGetValue("msg_form").asString(); + body["allow-publish"] = childGetValue("allow_publish_check").asBoolean(); + body["mature-publish"] = childGetValue("mature_check").asBoolean(); + LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, mAssetID, LLAssetType::AT_IMAGE_JPEG)); + } + else + { + gAssetStorage->storeAssetData(mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)this, FALSE); + } + + LLUploadDialog::modalUploadDialog("Uploading...\n\nPostcard"); + + // don't destroy the window until the upload is done + // this way we keep the information in the form + setVisible(FALSE); + + // also remove any dependency on another floater + // so that we can be sure to outlive it while we + // need to. + LLFloater* dependee = getDependee(); + if (dependee) + dependee->removeDependentFloater(this); +} diff --git a/indra/newview/llfloaterpostcard.h b/indra/newview/llfloaterpostcard.h index 542d117403..7ca1278776 100644 --- a/indra/newview/llfloaterpostcard.h +++ b/indra/newview/llfloaterpostcard.h @@ -29,7 +29,7 @@ public: virtual void init(); virtual BOOL postBuild(); virtual void draw(); - + static LLFloaterPostcard* showFromSnapshot(LLImageJPEG *jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global); static void onClickCancel(void* data); @@ -42,6 +42,11 @@ public: static void updateUserInfo(const char *email); + static void onMsgFormFocusRecieved(LLUICtrl* receiver, void* data); + static void missingSubjMsgAlertCallback(S32 option, void* data); + + void sendPostcard(); + protected: LLPointer<LLImageJPEG> mJPEGImage; @@ -50,6 +55,7 @@ protected: LLAssetID mAssetID; LLVector2 mImageScale; LLVector3d mPosTakenGlobal; + boolean mHasFirstMsgFocus; static LLLinkedList<LLFloaterPostcard> sInstances; }; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index f377fae8af..71491f16e6 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -305,6 +305,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) } childSetText("object_name", object_owner); childSetText("owner_name", object_owner); + childSetText("abuser_name_edit", object_owner); + mAbuserID = object_id; } else { @@ -556,10 +558,12 @@ LLFloaterReporter* LLFloaterReporter::createNewBugReporter() -void LLFloaterReporter::setPickedObjectProperties(const char *object_name, const char *owner_name) +void LLFloaterReporter::setPickedObjectProperties(const char *object_name, const char *owner_name, const LLUUID owner_id) { childSetText("object_name", object_name); childSetText("owner_name", owner_name); + childSetText("abuser_name_edit", owner_name); + mAbuserID = owner_id; } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index e8483b98ef..30de56fb87 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -86,7 +86,7 @@ public: // static static void processRegionInfo(LLMessageSystem* msg); - void setPickedObjectProperties(const char *object_name, const char *owner_name); + void setPickedObjectProperties(const char *object_name, const char *owner_name, const LLUUID owner_id); private: void takeScreenshot(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 224bd4650f..b708a4261f 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -196,7 +196,7 @@ BOOL LLFloaterTools::postBuild() mRadioSelectFace = LLUICtrlFactory::getCheckBoxByName(this,"radio select face"); childSetCommitCallback("radio select face",commit_select_tool,gToolFace); mCheckSelectIndividual = LLUICtrlFactory::getCheckBoxByName(this,"checkbox edit linked parts"); - childSetValue("checkbox edit linked parts",(BOOL)!gSavedSettings.getBOOL("SelectLinkedSet")); + childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); childSetCommitCallback("checkbox edit linked parts",commit_select_component,this); mCheckSnapToGrid = LLUICtrlFactory::getCheckBoxByName(this,"checkbox snap to grid"); childSetValue("checkbox snap to grid",(BOOL)gSavedSettings.getBOOL("SnapEnabled")); @@ -436,7 +436,7 @@ void LLFloaterTools::draw() mDirty = FALSE; } - mCheckSelectIndividual->set(!gSavedSettings.getBOOL("SelectLinkedSet")); + // mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts")); LLFloater::draw(); } @@ -547,7 +547,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mCheckSelectIndividual) { mCheckSelectIndividual->setVisible(edit_visible); - mCheckSelectIndividual->set(!gSavedSettings.getBOOL("SelectLinkedSet")); + //mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts")); } mRadioPosition ->set( tool == gToolTranslate ); @@ -726,7 +726,7 @@ void LLFloaterTools::onClose(bool app_quitting) // exit component selection mode gSelectMgr->promoteSelectionToRoot(); - gSavedSettings.setBOOL("SelectLinkedSet", TRUE); + gSavedSettings.setBOOL("EditLinkedParts", FALSE); gViewerWindow->showCursor(); @@ -902,7 +902,7 @@ void commit_select_component(LLUICtrl *ctrl, void *data) } BOOL select_individuals = floaterp->mCheckSelectIndividual->get(); - gSavedSettings.setBOOL("SelectLinkedSet", !select_individuals); + gSavedSettings.setBOOL("EditLinkedParts", select_individuals); floaterp->dirty(); if (select_individuals) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index f712067492..d50c54b938 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2502,6 +2502,7 @@ LLFolderView::LLFolderView( const LLString& name, LLViewerImage* root_folder_ico mLastScrollItem( NULL ), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), + mNeedsAutoRename(FALSE), mDebugFilters(FALSE), mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME), // This gets overridden by a pref immediately mFilter(name), @@ -4934,3 +4935,39 @@ LLString LLInventoryFilter::getFilterText() } return mFilterText; } + +void LLInventoryFilter::toLLSD(LLSD& data) +{ + data["filter_types"] = (LLSD::Integer)getFilterTypes(); + data["min_date"] = (LLSD::Integer)getMinDate(); + data["max_date"] = (LLSD::Integer)getMaxDate(); + data["hours_ago"] = (LLSD::Integer)getHoursAgo(); + data["show_folder_state"] = (LLSD::Integer)getShowFolderState(); + data["permissions"] = (LLSD::Integer)getFilterPermissions(); + data["substring"] = (LLSD::String)getFilterSubString(); + data["sort_order"] = (LLSD::Integer)getSortOrder(); +} + +void LLInventoryFilter::fromLLSD(LLSD& data) +{ + if(data.has("filter_types")) + setFilterTypes((U32)data["filter_types"].asInteger()); + + if(data.has("min_date") && data.has("max_date")) + setDateRange((U32)data["min_date"].asInteger(), (U32)data["max_date"].asInteger()); + + if(data.has("hours_ago")) + setHoursAgo((U32)data["hours_ago"].asInteger()); + + if(data.has("show_folder_state")) + setShowFolderState((EFolderShow)data["show_folder_state"].asInteger()); + + if(data.has("permissions")) + setFilterPermissions((PermissionMask)data["permissions"].asInteger()); + + if(data.has("substring")) + setFilterSubString(LLString(data["substring"].asString())); + + if(data.has("sort_order")) + setSortOrder((U32)data["sort_order"].asInteger()); +} diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 248118dfdf..97071862de 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -216,6 +216,9 @@ public: //RN: this is public to allow system to externally force a global refilter void setModified(EFilterBehavior behavior = FILTER_RESTART); + void toLLSD(LLSD& data); + void fromLLSD(LLSD& data); + protected: struct filter_ops { @@ -839,6 +842,9 @@ public: static void idle(void* user_data); BOOL needsAutoSelect() { return mNeedsAutoSelect && !mAutoSelectOverride; } + BOOL needsAutoRename() { return mNeedsAutoRename; } + void setNeedsAutoRename(BOOL val) { mNeedsAutoRename = val; } + BOOL getDebugFilters() { return mDebugFilters; } // DEBUG only @@ -870,6 +876,7 @@ protected: LLCoordGL mLastScrollOffset; BOOL mNeedsAutoSelect; BOOL mAutoSelectOverride; + BOOL mNeedsAutoRename; BOOL mDebugFilters; U32 mSortOrder; diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index c95faed438..350a20607c 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -456,6 +456,7 @@ void LLHUDEffectLookAt::calcTargetPosition() { //sets the lookat point in front of the avatar mTargetOffsetGlobal.setVec(5.0, 0.0, 0.0); + local_offset.setVec(mTargetOffsetGlobal); } mTargetPos = avatarp->mHeadp->getWorldPosition(); diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index 02a3576dff..3beff41cd4 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -45,7 +45,8 @@ LLHUDIcon::LLHUDIcon(const U8 type) : LLHUDObject(type), mImagep(NULL), mPickID(0), - mScale(0.1f) + mScale(0.1f), + mHidden(FALSE) { sIconInstances.push_back(this); } @@ -61,6 +62,9 @@ void LLHUDIcon::renderIcon(BOOL for_select) LLGLDepthTest gls_depth(GL_TRUE); LLGLState no_texture(GL_TEXTURE_2D, for_select ? FALSE : TRUE); + if (mHidden) + return; + if (mSourceObject.isNull() || mImagep.isNull()) { markDead(); diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h index 9835ff455b..c61e3951da 100644 --- a/indra/newview/llhudicon.h +++ b/indra/newview/llhudicon.h @@ -51,6 +51,9 @@ public: static BOOL iconsNearby(); + BOOL getHidden() const { return mHidden; } + void setHidden( BOOL hide ) { mHidden = hide; } + protected: LLHUDIcon(const U8 type); ~LLHUDIcon(); @@ -64,6 +67,7 @@ private: F32 mDistance; S32 mPickID; F32 mScale; + BOOL mHidden; typedef std::vector<LLPointer<LLHUDIcon> > icon_instance_t; static icon_instance_t sIconInstances; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index bb261e6a96..aba3401d3c 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -73,7 +73,8 @@ LLHUDText::LLHUDText(const U8 type) : mOffsetY(0), mTextAlignment(ALIGN_TEXT_CENTER), mVertAlignment(ALIGN_VERT_CENTER), - mLOD(0) + mLOD(0), + mHidden(FALSE) { mColor = LLColor4(1.f, 1.f, 1.f, 1.f); mDoFade = TRUE; @@ -113,7 +114,7 @@ void LLHUDText::renderForSelect() void LLHUDText::renderText(BOOL for_select) { - if (!mVisible) + if (!mVisible || mHidden) { return; } diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index a2e328acd1..3e4474378b 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -95,8 +95,9 @@ public: void setUseBubble(BOOL use_bubble) { mUseBubble = use_bubble; } S32 getLOD() { return mLOD; } BOOL getVisible() { return mVisible; } + BOOL getHidden() const { return mHidden; } + void setHidden( BOOL hide ) { mHidden = hide; } void setOnHUDAttachment(BOOL on_hud) { mOnHUDAttachment = on_hud; } - static void renderAllHUD(); static void addPickable(std::set<LLViewerObject*> &pick_list); static void reshape(); @@ -144,6 +145,7 @@ private: ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; S32 mLOD; + BOOL mHidden; static std::set<LLPointer<LLHUDText> > sTextObjects; static std::vector<LLPointer<LLHUDText> > sVisibleTextObjects; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index a7c110fec4..b2278f2752 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -154,6 +154,8 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, mInputEditor(NULL), mHistoryEditor(NULL), mSessionUUID(session_id), + mSessionInitRequested(FALSE), + mSessionInitialized(FALSE), mOtherParticipantUUID(other_participant_id), mDialog(dialog), mTyping(FALSE), @@ -161,9 +163,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, mTypingLineStartIndex(0), mSentTypingState(TRUE), mFirstKeystrokeTimer(), - mLastKeystrokeTimer(), - mSessionInitialized(FALSE), - mSessionInitRequested(FALSE) + mLastKeystrokeTimer() { init(session_label); } @@ -179,6 +179,8 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, mInputEditor(NULL), mHistoryEditor(NULL), mSessionUUID(session_id), + mSessionInitRequested(FALSE), + mSessionInitialized(FALSE), mOtherParticipantUUID(other_participant_id), mDialog(dialog), mTyping(FALSE), @@ -186,9 +188,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, mTypingLineStartIndex(0), mSentTypingState(TRUE), mFirstKeystrokeTimer(), - mLastKeystrokeTimer(), - mSessionInitialized(FALSE), - mSessionInitRequested(FALSE) + mLastKeystrokeTimer() { mSessionInitialTargetIDs = ids; init(session_label); @@ -407,7 +407,11 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 if (log_to_file && gSavedPerAccountSettings.getBOOL("LogInstantMessages") ) { - LLString histstr = timestring + utf8msg; + LLString histstr; + if (gSavedPerAccountSettings.getBOOL("IMLogTimestamp")) + histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + utf8msg; + else + histstr = utf8msg; LLLogChat::saveHistory(getTitle(),histstr); } diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 2c26fede2d..5e77a2f7f9 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -9,18 +9,40 @@ #include "llviewerprecompiledheaders.h" #include "lllogchat.h" - +#include "viewer.h" + const S32 LOG_RECALL_SIZE = 2048; //static LLString LLLogChat::makeLogFileName(LLString filename) { - filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename.c_str()); filename += ".txt"; return filename; } +LLString LLLogChat::timestamp(bool withdate) +{ + U32 utc_time; + utc_time = time_corrected(); + + // There's only one internal tm buffer. + struct tm* timep; + + // Convert to Pacific, based on server's opinion of whether + // it's daylight savings time there. + timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); + + LLString text; + if (withdate) + text = llformat("[%d/%02d/%02d %d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); + else + text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min); + + return text; +} + + //static void LLLogChat::saveHistory(LLString filename, LLString line) { diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index ac2d710b64..a1bd6a247f 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -13,6 +13,7 @@ class LLLogChat { public: + static LLString timestamp(bool withdate = false); static LLString makeLogFileName(LLString(filename)); static void saveHistory(LLString filename, LLString line); static void loadHistory(LLString filename, void (*callback)(LLString,void*),void* userdata); diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index a9ddcd9f1c..4d646cba0c 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -540,7 +540,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi LLGLEnable tex(GL_TEXTURE_2D); if (fractional_portion != 0) { - snprintf(fraction_string, sizeof(fraction_string), "%c%d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); /* Flawfinder: ignore */ + snprintf(fraction_string, sizeof(fraction_string), "%c%02d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); /* Flawfinder: ignore */ gViewerWindow->setupViewport(1, -1); hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 5a52fc5b0a..416f5b6f6a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -361,7 +361,7 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) objectp; objectp = mObjectSelection->getNextObject()) { - can_rotate = can_rotate && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); + can_rotate = can_rotate && objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } if (!can_rotate) diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 14da426d9a..f975aa76ed 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1202,7 +1202,7 @@ void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_updat mLastUpdateFlags = update_flags; // enforce minimum update delay and don't stream updates on sub-object selections - if( elapsed_time > UPDATE_DELAY && gSavedSettings.getBOOL("SelectLinkedSet") ) + if( elapsed_time > UPDATE_DELAY && !gSavedSettings.getBOOL("EditLinkedParts") ) { gSelectMgr->sendMultipleUpdate( update_flags ); update_timer.reset(); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 6171971c16..bdb6380368 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -278,7 +278,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) objectp; objectp = mObjectSelection->getNextObject()) { - can_move = can_move && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); + can_move = can_move && objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } if (!can_move) diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 75be1be4a6..8b07dfbfeb 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -356,8 +356,10 @@ BOOL LLMuteList::loadFromFile(const LLString& filename) id_buffer[0] = '\0'; name_buffer[0] = '\0'; S32 type = 0; + U32 flags = 0; sscanf( /* Flawfinder: ignore */ - buffer, " %d %254s %254[^|]", &type, id_buffer, name_buffer); + buffer, " %d %254s %254[^|]| %u\n", &type, id_buffer, name_buffer, + &flags); LLUUID id = LLUUID(id_buffer); LLMute mute(id, name_buffer, (LLMute::EType)type); if (mute.mID.isNull() diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index ea18b2838f..f699027835 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -47,6 +47,7 @@ #include "pipeline.h" #include "viewer.h" #include "llvieweruictrlfactory.h" +#include "llfirstuse.h" #include "lldrawpool.h" @@ -236,32 +237,36 @@ BOOL LLPanelObject::postBuild() // Sculpt mCtrlSculptTexture = LLUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); - mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE)); - mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt ); - mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt ); - mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt ); - mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt); - mCtrlSculptTexture->setCallbackUserData( this ); - // Don't allow (no copy) or (no transfer) textures to be selected during immediate mode - mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - // Allow any texture to be used during non-immediate mode. - mCtrlSculptTexture->setNonImmediateFilterPermMask(PERM_NONE); - LLAggregatePermissions texture_perms; - if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) - { - BOOL can_copy = - texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || - texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL; - BOOL can_transfer = - texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY || - texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL; - mCtrlSculptTexture->setCanApplyImmediately(can_copy && can_transfer); - } - else - { - mCtrlSculptTexture->setCanApplyImmediately(FALSE); + if (mCtrlSculptTexture) + { + mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE)); + mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt ); + mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt ); + mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt ); + mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt); + mCtrlSculptTexture->setCallbackUserData( this ); + // Don't allow (no copy) or (no transfer) textures to be selected during immediate mode + mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); + // Allow any texture to be used during non-immediate mode. + mCtrlSculptTexture->setNonImmediateFilterPermMask(PERM_NONE); + LLAggregatePermissions texture_perms; + if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) + { + BOOL can_copy = + texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || + texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL; + BOOL can_transfer = + texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY || + texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL; + mCtrlSculptTexture->setCanApplyImmediately(can_copy && can_transfer); + } + else + { + mCtrlSculptTexture->setCanApplyImmediately(FALSE); + } } + // Start with everyone disabled clearCtrls(); @@ -327,9 +332,9 @@ void LLPanelObject::getState( ) } // can move or rotate only linked group with move permissions, or sub-object with move and modify perms - BOOL enable_move = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); + BOOL enable_move = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); BOOL enable_scale = objectp->permMove() && objectp->permModify(); - BOOL enable_rotate = objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || gSavedSettings.getBOOL("SelectLinkedSet")); + BOOL enable_rotate = objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); LLVector3 vec; if (enable_move) @@ -618,6 +623,7 @@ void LLPanelObject::getState( ) if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) { selected_item = MI_SCULPT; + LLFirstUse::useSculptedPrim(); } @@ -1024,7 +1030,11 @@ void LLPanelObject::getState( ) { mTextureCtrl->setTentative(FALSE); mTextureCtrl->setEnabled(editable); - mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); + if (editable) + mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); + else + mTextureCtrl->setImageAssetID(LLUUID::null); + if (mObject != objectp) // we've just selected a new object, so save for undo mSculptTextureRevert = sculpt_params->getSculptTexture(); diff --git a/indra/newview/llpolymesh.h b/indra/newview/llpolymesh.h index 2874f11798..577f5c7dfb 100644 --- a/indra/newview/llpolymesh.h +++ b/indra/newview/llpolymesh.h @@ -340,7 +340,7 @@ protected: typedef LLAssocList<std::string, LLPolyMeshSharedData*> LLPolyMeshSharedDataTable; static LLPolyMeshSharedDataTable sGlobalSharedMeshList; - LLVOAvatar* mAvatarp; + LLPointer<LLVOAvatar> mAvatarp; }; //----------------------------------------------------------------------------- @@ -406,7 +406,7 @@ protected: joint_vec_map_t mJointScales; joint_vec_map_t mJointOffsets; LLVector3 mDefaultVec; - LLVOAvatar* mAvatar; + LLPointer<LLVOAvatar> mAvatar; }; #endif // LL_LLPOLYMESH_H diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 6698ee7505..274da6d3d1 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -375,9 +375,9 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, root->resetRot(); // leave component mode - if (!gSavedSettings.getBOOL("SelectLinkedSet")) + if (gSavedSettings.getBOOL("EditLinkedParts")) { - gSavedSettings.setBOOL("SelectLinkedSet", TRUE); + gSavedSettings.setBOOL("EditLinkedParts", FALSE); promoteSelectionToRoot(); } @@ -443,9 +443,9 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const LLDynamicArray< } // leave component mode - if (!gSavedSettings.getBOOL("SelectLinkedSet")) + if (gSavedSettings.getBOOL("EditLinkedParts")) { - gSavedSettings.setBOOL("SelectLinkedSet", TRUE); + gSavedSettings.setBOOL("EditLinkedParts", FALSE); promoteSelectionToRoot(); } @@ -928,7 +928,7 @@ LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects() void LLSelectMgr::deselectHighlightedObjects() { - BOOL select_linked_set = gSavedSettings.getBOOL("SelectLinkedSet"); + BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); for (std::set<LLPointer<LLViewerObject> >::iterator iter = mRectSelectedObjects.begin(); iter != mRectSelectedObjects.end(); iter++) { @@ -3229,7 +3229,7 @@ void LLSelectMgr::sendMultipleUpdate(U32 type) { if (type == UPD_NONE) return; // send individual updates when selecting textures or individual objects - ESendType send_type = (gSavedSettings.getBOOL("SelectLinkedSet") && !getTEMode()) ? SEND_ONLY_ROOTS : SEND_ROOTS_FIRST; + ESendType send_type = (!gSavedSettings.getBOOL("EditLinkedParts") && !getTEMode()) ? SEND_ONLY_ROOTS : SEND_ROOTS_FIRST; if (send_type == SEND_ONLY_ROOTS) { // tell simulator to apply to whole linked sets @@ -4486,7 +4486,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use LLString fullname(first_name); fullname.append(" "); fullname.append(last_name); - reporterp->setPickedObjectProperties(name, fullname.c_str()); + reporterp->setPickedObjectProperties(name, fullname.c_str(), owner_id); } } @@ -4649,7 +4649,7 @@ void LLSelectMgr::updateSilhouettes() // persists from frame to frame to avoid regenerating object silhouettes // mHighlightedObjects includes all siblings of rect selected objects - BOOL select_linked_set = gSavedSettings.getBOOL("SelectLinkedSet"); + BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); // generate list of roots from current object selection for (std::set<LLPointer<LLViewerObject> >::iterator iter = mRectSelectedObjects.begin(); @@ -5599,7 +5599,7 @@ BOOL LLSelectMgr::canUndo() //----------------------------------------------------------------------------- void LLSelectMgr::undo() { - BOOL select_linked_set = gSavedSettings.getBOOL("SelectLinkedSet"); + BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); LLUUID group_id(gAgent.getGroupID()); sendListToRegions("Undo", packAgentAndSessionAndGroupID, packObjectID, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST); } @@ -5617,7 +5617,7 @@ BOOL LLSelectMgr::canRedo() //----------------------------------------------------------------------------- void LLSelectMgr::redo() { - BOOL select_linked_set = gSavedSettings.getBOOL("SelectLinkedSet"); + BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); LLUUID group_id(gAgent.getGroupID()); sendListToRegions("Redo", packAgentAndSessionAndGroupID, packObjectID, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST); } @@ -5794,7 +5794,7 @@ void LLObjectSelection::deleteAllNodes() LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp) { - std::map<LLViewerObject*, LLSelectNode*>::iterator found_it = mSelectNodeMap.find(objectp); + std::map<LLPointer<LLViewerObject>, LLSelectNode*>::iterator found_it = mSelectNodeMap.find(objectp); if (found_it != mSelectNodeMap.end()) { return found_it->second; diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 65f58da1cc..33c8371cb7 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -168,7 +168,7 @@ private: LLPointer<LLViewerObject> mPrimaryObject; std::list<LLSelectNode*>::iterator mCurrentNode; S32 mCurrentTE; - std::map<LLViewerObject*, LLSelectNode*> mSelectNodeMap; + std::map<LLPointer<LLViewerObject>, LLSelectNode*> mSelectNodeMap; ESelectType mSelectType; }; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 43417d0006..039124c6fd 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1504,7 +1504,7 @@ public: for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i) { LLDrawable* drawable = *i; - if (drawable->getVObj() && !group->mSpatialPartition->mRenderByGroup) + if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup) { gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE); } diff --git a/indra/newview/llsrv.cpp b/indra/newview/llsrv.cpp new file mode 100644 index 0000000000..cd05d9c107 --- /dev/null +++ b/indra/newview/llsrv.cpp @@ -0,0 +1,193 @@ +/** + * @file llsrv.cpp + * @brief Wrapper for DNS SRV record lookups + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llsrv.h" + +using namespace std; + +#if LL_WINDOWS + +#undef UNICODE +#include <winsock2.h> +#include <windns.h> + +vector<LLSRVRecord> LLSRV::query(const string& name) +{ + vector<LLSRVRecord> recs; + DNS_RECORD *rec; + DNS_STATUS status; + + status = DnsQuery(name.c_str(), DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &rec, NULL); + if (!status) + { + for (DNS_RECORD *cur = rec; cur != NULL; cur = cur->pNext) + { + if (cur->wType != DNS_TYPE_SRV) + { + continue; + } + recs.push_back(LLSRVRecord(cur->Data.Srv.wPriority, + cur->Data.Srv.wWeight, + cur->Data.Srv.pNameTarget, + cur->Data.Srv.wPort)); + } + DnsRecordListFree(rec, DnsFreeRecordListDeep); + } + + return recs; +} + +#else // !LL_WINDOWS + +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <arpa/nameser_compat.h> +#include <resolv.h> + +#include <netdb.h> + +vector<LLSRVRecord> LLSRV::query(const string& queryName) +{ + unsigned char response[16384]; + vector<LLSRVRecord> recs; + char name[1024]; + int len; + + len = res_query(queryName.c_str(), ns_c_in, ns_t_srv, response, + sizeof(response)); + + if (len == -1) + { + llinfos << "Query failed for " << queryName << llendl; + return recs; + } + else if (len > (int) sizeof(response)) + { + llinfos << "Response too big for " << queryName + << " (capacity " << sizeof(response) + << ", response " << len << ")" << llendl; + return recs; + } + + // We "should" be using libresolv's ns_initparse and ns_parserr to + // parse the result of our query. However, libresolv isn't + // packaged correctly on Linux (as of BIND 9), so neither of these + // functions is available without statically linking against + // libresolv. Ugh! So we parse the response ourselves. + + const unsigned char *pos = response + sizeof(HEADER); + const unsigned char *end = response + len; + const HEADER *hdr = (const HEADER *) response; + + // Skip over the query embedded in the response. + + for (int q = ntohs(hdr->qdcount); q > 0; --q) + { + len = dn_expand(response, end, pos, name, sizeof(name)); + + if (len == -1) + { + llinfos << "Could not expand queried name in RR response" << llendl; + return recs; + } + + pos += len + NS_QFIXEDSZ; + } + + for (int a = ntohs(hdr->ancount); a > 0; --a) + { + static const ns_rr *rr; + + len = dn_expand(response, end, pos, name, sizeof(name) - 1); + if (len == -1) + { + llinfos << "Could not expand response name in RR response" << llendl; + return recs; + } + + // Skip over the resource name and headers we don't care about. + + pos += len + sizeof(rr->type) + sizeof(rr->rr_class) + + sizeof(rr->ttl) + sizeof(rr->rdlength); + + U16 prio; + U16 weight; + U16 port; + + NS_GET16(prio, pos); + NS_GET16(weight, pos); + NS_GET16(port, pos); + + len = dn_expand(response, end, pos, name, sizeof(name) - 1); + + if (len == -1) + { + llinfos << "Could not expand name in RR response" << llendl; + return recs; + } + + recs.push_back(LLSRVRecord(prio, weight, name, port)); + } + + // There are likely to be more records in the response, but we + // don't care about those, at least for now. + + return recs; +} + +#endif // LL_WINDOWS + +vector<string> LLSRV::rewriteURI(const string& uriStr) +{ + LLURI uri(uriStr); + const string& scheme = uri.scheme(); + llinfos << "Rewriting " << uriStr << llendl; + string serviceName("_" + scheme + "._tcp." + uri.hostName()); + llinfos << "Querying for " << serviceName << llendl; + vector<LLSRVRecord> srvs(LLSRV::query(serviceName)); + vector<string> rewritten; + + if (srvs.empty()) + { + llinfos << "No query results; using " << uriStr << llendl; + rewritten.push_back(uriStr); + } + else + { + vector<LLSRVRecord>::const_iterator iter; + size_t maxSrvs = 3; + size_t i; + + llinfos << "Got " << srvs.size() << " results" << llendl; + if (srvs.size() > maxSrvs) + { + llinfos << "Clamping to " << maxSrvs << llendl; + } + + for (iter = srvs.begin(), i = 0; + iter != srvs.end() && i < maxSrvs; ++iter, ++i) + { + LLURI newUri(scheme, + uri.userName(), + uri.password(), + iter->target(), + uri.defaultPort() ? iter->port() : uri.hostPort(), + uri.escapedPath(), + uri.escapedQuery()); + string newUriStr(newUri.asString()); + + llinfos << "Rewrite[" << i << "] " << newUriStr << llendl; + + rewritten.push_back(newUriStr); + } + } + + return rewritten; +} diff --git a/indra/newview/llsrv.h b/indra/newview/llsrv.h new file mode 100644 index 0000000000..14a64e639e --- /dev/null +++ b/indra/newview/llsrv.h @@ -0,0 +1,46 @@ +/** + * @file llsrv.h + * @brief Wrapper for DNS SRV record lookups + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LL_LLSRV_H +#define LL_LLSRV_H + +class LLSRV; + +class LLSRVRecord +{ + friend class LLSRV; + +protected: + U16 mPriority; + U16 mWeight; + std::string mTarget; + U16 mPort; + + LLSRVRecord(U16 priority, U16 weight, const std::string& target, + U16 port) : + mPriority(priority), + mWeight(weight), + mTarget(target), + mPort(port) { + } + +public: + U16 priority() const { return mPriority; } + U16 weight() const { return mWeight; } + const std::string& target() const { return mTarget; } + U16 port() const { return mPort; } +}; + +class LLSRV +{ +public: + static std::vector<LLSRVRecord> query(const std::string& name); + static std::vector<std::string> rewriteURI(const std::string& uri); +}; + +#endif // LL_LLSRV_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f2d0d594f8..cce0d17e96 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -97,6 +97,7 @@ #include "llpreviewscript.h" #include "llselectmgr.h" #include "llsky.h" +#include "llsrv.h" #include "llstatview.h" #include "llsurface.h" #include "lltexturecache.h" @@ -265,7 +266,8 @@ BOOL idle_startup() // auth/transform loop will do. static F32 progress = 0.10f; - static std::string auth_uri; + static std::vector<std::string> auth_uris; + static int auth_uri_num = -1; static std::string auth_method; static std::string auth_desc; static std::string auth_message; @@ -1089,7 +1091,11 @@ BOOL idle_startup() gSavedSettings.setBOOL("UseDebugMenus", TRUE); requested_options.push_back("god-connect"); } - auth_uri = getLoginURI(); + if (auth_uris.empty()) + { + auth_uris = getLoginURIs(); + } + auth_uri_num = 0; auth_method = "login_to_simulator"; auth_desc = "Logging in. "; auth_desc += gSecondLife; @@ -1132,7 +1138,7 @@ BOOL idle_startup() hashed_mac.hex_digest(hashed_mac_string); gUserAuthp->authenticate( - auth_uri.c_str(), + auth_uris[auth_uri_num].c_str(), auth_method.c_str(), firstname.c_str(), lastname.c_str(), @@ -1228,7 +1234,8 @@ BOOL idle_startup() else if(login_response && (0 == strcmp(login_response, "indeterminate"))) { llinfos << "Indeterminate login..." << llendl; - auth_uri = gUserAuthp->getResponse("next_url"); + auth_uris = LLSRV::rewriteURI(gUserAuthp->getResponse("next_url")); + auth_uri_num = 0; auth_method = gUserAuthp->getResponse("next_method"); auth_message = gUserAuthp->getResponse("message"); if(auth_method.substr(0, 5) == "login") @@ -1331,13 +1338,33 @@ BOOL idle_startup() case LLUserAuth::E_SSL_PEER_CERTIFICATE: case LLUserAuth::E_UNHANDLED_ERROR: default: - emsg << "Unable to connect to " << gSecondLife << ".\n"; - emsg << gUserAuthp->errorMessage(); + if (auth_uri_num >= (int) auth_uris.size()) + { + emsg << "Unable to connect to " << gSecondLife << ".\n"; + emsg << gUserAuthp->errorMessage(); + } else { + std::ostringstream s; + s << "Logging in (attempt " << (auth_uri_num + 1) << "). "; + auth_desc = s.str(); + gStartupState = STATE_LOGIN_AUTHENTICATE; + auth_uri_num++; + return do_normal_idle; + } break; case LLUserAuth::E_SSL_CACERT: case LLUserAuth::E_SSL_CONNECT_ERROR: - emsg << "Unable to establish a secure connection to the login server.\n"; - emsg << gUserAuthp->errorMessage(); + if (auth_uri_num >= (int) auth_uris.size()) + { + emsg << "Unable to establish a secure connection to the login server.\n"; + emsg << gUserAuthp->errorMessage(); + } else { + std::ostringstream s; + s << "Logging in (attempt " << (auth_uri_num + 1) << "). "; + auth_desc = s.str(); + gStartupState = STATE_LOGIN_AUTHENTICATE; + auth_uri_num++; + return do_normal_idle; + } break; } diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 178c83f61e..11a95d4837 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -2294,7 +2294,7 @@ LLColor4 LLTexParamColor::getNetColor() { llassert( getInfo()->mNumColors >= 1 ); - F32 effective_weight = ( mAvatar && (mAvatar->getSex() & getSex()) ) ? mCurWeight : getDefaultWeight(); + F32 effective_weight = ( mAvatar.notNull() && (mAvatar->getSex() & getSex()) ) ? mCurWeight : getDefaultWeight(); S32 index_last = getInfo()->mNumColors - 1; F32 scaled_weight = effective_weight * index_last; diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index bda865eb2e..1dd0f0b657 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -266,7 +266,7 @@ protected: typedef std::vector<LLTexLayer *> layer_list_t; layer_list_t mLayerList; LLTexLayerSetBuffer* mComposite; - LLVOAvatar* mAvatar; + LLPointer<LLVOAvatar> mAvatar; BOOL mUpdatesEnabled; BOOL mHasBump; @@ -423,7 +423,7 @@ public: protected: typedef std::vector<LLTexParamColor *> param_list_t; param_list_t mParamList; - LLVOAvatar* mAvatar; + LLPointer<LLVOAvatar> mAvatar; LLTexGlobalColorInfo *mInfo; }; @@ -469,7 +469,7 @@ protected: LLVector3 mAvgDistortionVec; LLTexGlobalColor* mTexGlobalColor; // either has mTexGlobalColor or mTexLayer as its parent LLTexLayer* mTexLayer; - LLVOAvatar* mAvatar; // redundant, but simplifies the code + LLPointer<LLVOAvatar> mAvatar; // redundant, but simplifies the code }; //----------------------------------------------------------------------------- @@ -549,7 +549,7 @@ public: ~LLBakedUploadData() {} LLUUID mID; - LLVOAvatar* mAvatar; + LLPointer<LLVOAvatar> mAvatar; LLTexLayerSetBuffer* mLayerSetBuffer; LLUUID mWearableAssets[WT_COUNT]; }; diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 1a3fe79551..11034798a0 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1,5 +1,5 @@ /** - * @file texturecache.cpp + * @file lltexturecache.cpp * @brief Object which handles local texture caching * * Copyright (c) 2000-$CurrentYear$, Linden Research, Inc. @@ -1264,6 +1264,7 @@ LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 prio { if (mReadOnly) { + delete responder; return LLWorkerThread::nullHandle(); } if (mDoPurge) @@ -1285,6 +1286,7 @@ LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 prio mWriters[handle] = worker; return handle; } + delete responder; return LLWorkerThread::nullHandle(); } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 958635c796..4ac08f2a81 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -99,7 +99,8 @@ public: // LLFloater overrides virtual void onClose(bool app_quitting); - + virtual BOOL postBuild(); + // New functions void setImageID( const LLUUID& image_asset_id); void updateImageStats(); @@ -143,6 +144,8 @@ protected: LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. LLUUID mOriginalImageAssetID; + std::string mLabel; + LLTextBox* mTentativeLabel; LLTextBox* mResolutionLabel; @@ -177,6 +180,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mImageAssetID( owner->getImageAssetID() ), mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ), mOriginalImageAssetID(owner->getImageAssetID()), + mLabel(label), mTentativeLabel(NULL), mResolutionLabel(NULL), mIsDirty( FALSE ), @@ -436,6 +440,21 @@ void LLFloaterTexturePicker::onClose(bool app_quitting) } // virtual +BOOL LLFloaterTexturePicker::postBuild() +{ + LLFloater::postBuild(); + + if (!mLabel.empty()) + { + std::string pick = childGetText("pick title"); + + setTitle(pick + mLabel); + } + + return TRUE; +} + +// virtual void LLFloaterTexturePicker::draw() { if (mOwner) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ce5649e06e..8d9d2b88a5 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1,5 +1,5 @@ /** - * @file lltexturecache.cpp + * @file lltexturefetch.cpp * @brief Object which fetches textures from the cache and/or network * * Copyright (c) 2000-$CurrentYear$, Linden Research, Inc. diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index f3b253a4e5..353862dd54 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -101,7 +101,7 @@ BOOL LLToolComposite::isSelecting() void LLToolComposite::handleSelect() { - if (gSavedSettings.getBOOL("SelectLinkedSet")) + if (!gSavedSettings.getBOOL("EditLinkedParts")) { gSelectMgr->promoteSelectionToRoot(); } @@ -142,7 +142,7 @@ void LLToolCompInspect::pickCallback(S32 x, S32 y, MASK mask) if (!gToolInspect->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolInspect->mSelectRect->handleObjectSelection(hit_obj, mask, !gSavedSettings.getBOOL("SelectLinkedSet"), FALSE); + gToolInspect->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } @@ -216,7 +216,7 @@ void LLToolCompTranslate::pickCallback(S32 x, S32 y, MASK mask) if (!gToolTranslate->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolTranslate->mSelectRect->handleObjectSelection(hit_obj, mask, !gSavedSettings.getBOOL("SelectLinkedSet"), FALSE); + gToolTranslate->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } @@ -230,7 +230,7 @@ void LLToolCompTranslate::pickCallback(S32 x, S32 y, MASK mask) BOOL can_move = gToolTranslate->mManip->getSelection()->getObjectCount() != 0; for (LLViewerObject* objectp = gToolTranslate->mManip->getSelection()->getFirstObject(); objectp; objectp = gToolTranslate->mManip->getSelection()->getNextObject()) { - can_move = can_move && objectp->permMove() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); + can_move = can_move && objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } if( LLManip::LL_NO_PART != gToolTranslate->mManip->getHighlightedPart() && can_move) @@ -344,7 +344,7 @@ void LLToolCompScale::pickCallback(S32 x, S32 y, MASK mask) if (!gToolStretch->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolStretch->mSelectRect->handleObjectSelection(hit_obj, mask, !gSavedSettings.getBOOL("SelectLinkedSet"), FALSE); + gToolStretch->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } @@ -545,7 +545,7 @@ void LLToolCompRotate::pickCallback(S32 x, S32 y, MASK mask) if (!gToolRotate->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolRotate->mSelectRect->handleObjectSelection(hit_obj, mask, !gSavedSettings.getBOOL("SelectLinkedSet"), FALSE); + gToolRotate->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 68eec329aa..5b17848a4c 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -42,7 +42,7 @@ LLToolPie *gToolPie = NULL; -LLViewerObject* LLToolPie::sClickActionObject = NULL; +LLPointer<LLViewerObject> LLToolPie::sClickActionObject; LLHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL; U8 LLToolPie::sClickAction = 0; diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 6c3a200dbc..e19cd749f4 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -53,7 +53,7 @@ protected: BOOL mHitLand; LLUUID mHitObjectID; BOOL mMouseOutsideSlop; // for this drag, has mouse moved outside slop region - static LLViewerObject* sClickActionObject; + static LLPointer<LLViewerObject> sClickActionObject; static U8 sClickAction; static LLHandle<LLObjectSelection> sLeftClickSelection; }; diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 1223bc5104..475fc4a0d1 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -209,7 +209,7 @@ LLHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObject * BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) { - mIgnoreGroup = !gSavedSettings.getBOOL("SelectLinkedSet"); + mIgnoreGroup = gSavedSettings.getBOOL("EditLinkedParts"); LLViewerObject* object = gObjectList.findObject(mSelectObjectID); LLToolSelect::handleObjectSelection(object, mask, mIgnoreGroup, FALSE); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index cc31aaef67..959af911b7 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -551,7 +551,7 @@ U32 LLInventoryCallbackManager::registerCB(LLPointer<LLInventoryCallback> cb) void LLInventoryCallbackManager::fire(U32 callback_id, const LLUUID& item_id) { - if (!callback_id) + if (!callback_id || item_id.isNull()) return; std::map<U32, LLPointer<LLInventoryCallback> >::iterator i; diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index e0354a8c10..d52d522b59 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -59,7 +59,7 @@ public: S32 getGroup() { return mGroup; } S32 getPieSlice() { return mPieSlice; } - BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject; } + BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject.notNull(); } LLViewerObject *getObject() { return mAttachedObject; } S32 getNumObjects() { return (mAttachedObject ? 1 : 0); } const LLUUID& getItemID() { return mItemID; } @@ -79,7 +79,7 @@ protected: protected: LLJoint* mJoint; - LLViewerObject* mAttachedObject; + LLPointer<LLViewerObject> mAttachedObject; BOOL mAttachmentDirty; // does attachment drawable need to be fixed up? BOOL mVisibleInFirst; LLVector3 mOriginalPos; diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 17c9a1fc10..8129e41727 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -101,11 +101,7 @@ void agent_slide_left( EKeystate s ) if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { - if (frame_count == 0) - { - // only send nudge on first frame - gAgent.moveLeftNudge(1); - } + gAgent.moveLeftNudge(1); } else { @@ -122,11 +118,7 @@ void agent_slide_right( EKeystate s ) if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { - if (frame_count == 0) - { - // only send nudge on first frame - gAgent.moveLeftNudge(-1); - } + gAgent.moveLeftNudge(-1); } else { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9aaac2af66..d18859e356 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -224,7 +224,7 @@ const LLString SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); #if LL_WINDOWS static const char* SOUND_EXTENSIONS = ".wav"; -static const char* IMAGE_EXTENSIONS = ".tga .bmp .jpg .jpeg"; +static const char* IMAGE_EXTENSIONS = ".tga .bmp .jpg .jpeg .png"; static const char* ANIM_EXTENSIONS = ".bvh"; #ifdef _CORY_TESTING static const char* GEOMETRY_EXTENSIONS = ".slg"; @@ -1239,7 +1239,7 @@ void init_debug_avatar_menu(LLMenuGL* menu) sub_menu = new LLMenuGL("Character Tests"); sub_menu->append(new LLMenuItemToggleGL("Go Away/AFK When Idle", - &gAllowAFK)); + &gAllowIdleAFK)); sub_menu->append(new LLMenuItemCallGL("Appearance To XML", &LLVOAvatar::dumpArchetypeXML)); @@ -4130,7 +4130,7 @@ class LLToolsBuyOrTake : public view_listener_t { S32 total_price = selection_price(); - if (total_price <= gStatusBar->getBalance()) + if (total_price <= gStatusBar->getBalance() || total_price == 0) { handle_buy(NULL); } @@ -4422,7 +4422,7 @@ class LLToolsEnableLink : public view_listener_t // user can modify at least one of the selected objects. // in component mode, can't link - if (gSavedSettings.getBOOL("SelectLinkedSet")) + if (!gSavedSettings.getBOOL("EditLinkedParts")) { if(gSelectMgr->selectGetAllRootsValid() && gSelectMgr->getSelection()->getRootObjectCount() >= 2) { @@ -4822,6 +4822,12 @@ void show_debug_menus() if ( gMenuBarView ) { BOOL debug = gSavedSettings.getBOOL("UseDebugMenus"); + + if(debug) + { + LLFirstUse::useDebugMenus(); + } + gMenuBarView->setItemVisible(CLIENT_MENU_NAME, debug); gMenuBarView->setItemEnabled(CLIENT_MENU_NAME, debug); gMenuBarView->setItemVisible(SERVER_MENU_NAME, debug); @@ -6907,6 +6913,23 @@ class LLToolsShowSelectionLightRadius : public view_listener_t } }; +class LLToolsEditLinkedParts : public view_listener_t +{ + bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + { + BOOL select_individuals = gSavedSettings.getBOOL("EditLinkedParts"); + if (select_individuals) + { + gSelectMgr->demoteSelectionToIndividuals(); + } + else + { + gSelectMgr->promoteSelectionToRoot(); + } + return true; + } +}; + void reload_personal_settings_overrides(void *) { llinfos << "Loading overrides from " << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,"overrides.xml") << llendl; @@ -7600,6 +7623,7 @@ void initialize_menus() addMenu(new LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding"); addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection"); addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius"); + addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts"); addMenu(new LLToolsSnapObjectXY(), "Tools.SnapObjectXY"); addMenu(new LLToolsUseSelectionForGrid(), "Tools.UseSelectionForGrid"); addMenu(new LLToolsLink(), "Tools.Link"); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index eec6c8f481..2b69c20d15 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -541,6 +541,21 @@ void upload_new_resource(const LLString& src_filename, std::string name, return; } } + else if( LLString::compareInsensitive(ext.c_str(),".png") == 0 ) + { + asset_type = LLAssetType::AT_TEXTURE; + if (!LLViewerImageList::createUploadFile(src_filename, + filename, + IMG_CODEC_PNG )) + { + sprintf(error_message, "Problem with file %s:\n\n%s\n", + src_filename.c_str(), LLImageBase::getLastError().c_str()); + args["[FILE]"] = src_filename; + args["[ERROR]"] = LLImageBase::getLastError(); + upload_error(error_message, "ProblemWithFile", filename, args); + return; + } + } else if(LLString::compareInsensitive(ext.c_str(),".wav") == 0) { asset_type = LLAssetType::AT_SOUND; // tag it as audio diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3b28148c4f..aa6993098d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -134,6 +134,22 @@ LLFrameTimer gThrottleTimer; const U32 OFFER_THROTTLE_MAX_COUNT=5; //number of items per time period const F32 OFFER_THROTTLE_TIME=10.f; //time period in seconds +//script permissions +const LLString SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = + { + "ScriptTakeMoney", + "ActOnControlInputs", + "RemapControlInputs", + "AnimateYourAvatar", + "AttachToYourAvatar", + "ReleaseOwnership", + "LinkAndDelink", + "AddAndRemoveJoints", + "ChangePermissions", + "TrackYourCamera", + "ControlYourCamera" + }; + struct LLFriendshipOffer { LLUUID mFromID; @@ -4223,8 +4239,8 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) class LLScriptQuestionCBData { public: - LLScriptQuestionCBData(const LLUUID &taskid, const LLUUID &itemid, const LLHost &sender, S32 questions) - : mTaskID(taskid), mItemID(itemid), mSender(sender), mQuestions(questions) + LLScriptQuestionCBData(const LLUUID &taskid, const LLUUID &itemid, const LLHost &sender, S32 questions, const char *object_name, const char *owner_name) + : mTaskID(taskid), mItemID(itemid), mSender(sender), mQuestions(questions), mObjectName(object_name), mOwnerName(owner_name) { } @@ -4232,17 +4248,138 @@ public: LLUUID mItemID; LLHost mSender; S32 mQuestions; + LLString mObjectName; + LLString mOwnerName; }; +void notify_cautioned_script_question(LLScriptQuestionCBData* cbdata, S32 orig_questions, BOOL granted) +{ + // only continue if at least some permissions were requested + if (orig_questions) + { + // "'[OBJECTNAME]', an object owned by '[OWNERNAME]', + // located in [REGIONNAME] at [REGIONPOS], + // has been <granted|denied> permission to: [PERMISSIONS]." + + LLUIString notice(LLNotifyBox::getTemplateMessage(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied")); + + // always include the object name and owner name + notice.setArg("[OBJECTNAME]", cbdata->mObjectName); + notice.setArg("[OWNERNAME]", cbdata->mOwnerName); + + // try to lookup viewerobject that corresponds to the object that + // requested permissions (here, taskid->requesting object id) + BOOL foundpos = FALSE; + LLViewerObject* viewobj = gObjectList.findObject(cbdata->mTaskID); + if (viewobj) + { + // found the viewerobject, get it's position in its region + LLVector3 objpos(viewobj->getPosition()); + + // try to lookup the name of the region the object is in + LLViewerRegion* viewregion = viewobj->getRegion(); + if (viewregion) + { + // got the region, so include the region and 3d coordinates of the object + notice.setArg("[REGIONNAME]", viewregion->getName()); + LLString formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); + notice.setArg("[REGIONPOS]", formatpos); + + foundpos = TRUE; + } + } + + if (!foundpos) + { + // unable to determine location of the object + notice.setArg("[REGIONNAME]", "(unknown region)"); + notice.setArg("[REGIONPOS]", "(unknown position)"); + } + + // check each permission that was requested, and list each + // permission that has been flagged as a caution permission + BOOL caution = FALSE; + S32 count = 0; + LLString perms; + for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) + { + if ((orig_questions & LSCRIPTRunTimePermissionBits[i]) && LLNotifyBox::getTemplateIsCaution(SCRIPT_QUESTIONS[i])) + { + count++; + caution = TRUE; + + // add a comma before the permission description if it is not the first permission + // added to the list or the last permission to check + if ((count > 1) && (i < SCRIPT_PERMISSION_EOF)) + { + perms.append(", "); + } + + perms.append(LLNotifyBox::getTemplateMessage(SCRIPT_QUESTIONS[i])); + } + } + + notice.setArg("[PERMISSIONS]", perms); + + // log a chat message as long as at least one requested permission + // is a caution permission + if (caution) + { + LLChat chat(notice.getString()); + LLFloaterChat::addChat(chat, FALSE, FALSE); + } + } +} + +void script_question_decline_cb(S32 option, void* user_data) +{ + LLMessageSystem *msg = gMessageSystem; + LLScriptQuestionCBData *cbdata = (LLScriptQuestionCBData *)user_data; + + // remember the permissions requested so they can be checked + // when it comes time to log a chat message + S32 orig = cbdata->mQuestions; + + // this callback will always decline all permissions requested + // (any question flags set in the ScriptAnswerYes message + // will be interpreted as having been granted, so clearing all + // the bits will deny every permission) + cbdata->mQuestions = 0; + + // respond with the permissions denial + msg->newMessageFast(_PREHASH_ScriptAnswerYes); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_Data); + msg->addUUIDFast(_PREHASH_TaskID, cbdata->mTaskID); + msg->addUUIDFast(_PREHASH_ItemID, cbdata->mItemID); + msg->addS32Fast(_PREHASH_Questions, cbdata->mQuestions); + msg->sendReliable(cbdata->mSender); + + // log a chat message, if appropriate + notify_cautioned_script_question(cbdata, orig, FALSE); + + delete cbdata; +} void script_question_cb(S32 option, void* user_data) { LLMessageSystem *msg = gMessageSystem; LLScriptQuestionCBData *cbdata = (LLScriptQuestionCBData *)user_data; + S32 orig = cbdata->mQuestions; + + // check whether permissions were granted or denied + BOOL allowed = TRUE; + // the "yes/accept" button is the first button in the template, making it button 0 + // if any other button was clicked, the permissions were denied if (option != 0) { cbdata->mQuestions = 0; - } + allowed = FALSE; + } + + // reply with the permissions granted or denied msg->newMessageFast(_PREHASH_ScriptAnswerYes); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -4252,27 +4389,20 @@ void script_question_cb(S32 option, void* user_data) msg->addUUIDFast(_PREHASH_ItemID, cbdata->mItemID); msg->addS32Fast(_PREHASH_Questions, cbdata->mQuestions); msg->sendReliable(cbdata->mSender); + + // only log a chat message if caution prompts are enabled + if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + { + // log a chat message, if appropriate + notify_cautioned_script_question(cbdata, orig, allowed); + } + delete cbdata; } - void process_script_question(LLMessageSystem *msg, void **user_data) { // XUI:translate owner name -> [FIRST] [LAST] - const LLString script_questions[SCRIPT_PERMISSION_EOF] = - { - "ScriptTakeMoney", - "ActOnControlInputs", - "RemapControlInputs", - "AnimateYourAvatar", - "AttachToYourAvatar", - "ReleaseOwnership", - "LinkAndDelink", - "AddAndRemoveJoints", - "ChangePermissions", - "TrackYourCamera", - "ControlYourCamera" - }; LLHost sender = msg->getSender(); @@ -4282,7 +4412,9 @@ void process_script_question(LLMessageSystem *msg, void **user_data) char object_name[255]; /* Flawfinder: ignore */ char owner_name[DB_FULL_NAME_BUF_SIZE]; /* Flawfinder: ignore */ + // taskid -> object key of object requesting permissions msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid ); + // itemid -> script asset key of script requesting permissions msg->getUUIDFast(_PREHASH_Data, _PREHASH_ItemID, itemid ); msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectName, 255, object_name); msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectOwner, DB_FULL_NAME_BUF_SIZE, owner_name); @@ -4291,23 +4423,48 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLString script_question; if (questions) { + BOOL caution = FALSE; S32 count = 0; LLString::format_map_t args; args["[OBJECTNAME]"] = object_name; args["[NAME]"] = owner_name; + + // check the received permission flags against each permission for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) { if (questions & LSCRIPTRunTimePermissionBits[i]) { count++; - script_question += " " + LLNotifyBox::getTemplateMessage(script_questions[i]) + "\n"; + script_question += " " + LLNotifyBox::getTemplateMessage(SCRIPT_QUESTIONS[i]) + "\n"; + + // check whether permission question should cause special caution dialog + caution |= LLNotifyBox::getTemplateIsCaution(SCRIPT_QUESTIONS[i]); } } args["[QUESTIONS]"] = script_question; - LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions); + LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name); + + // check whether cautions are even enabled or not + if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + { + if (caution) + { + // display the caution permissions prompt + LLNotifyBox::showXml("ScriptQuestionCaution", args, TRUE, script_question_cb, cbdata); + } + else + { + // display the permissions request normally + LLNotifyBox::showXml("ScriptQuestion", args, FALSE, script_question_cb, cbdata); + } + } + else + { + // fall back to default behavior if cautions are entirely disabled + LLNotifyBox::showXml("ScriptQuestion", args, FALSE, script_question_cb, cbdata); + } - LLNotifyBox::showXml("ScriptQuestion", args, script_question_cb, cbdata); } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 710ba186f9..e53f779473 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1551,7 +1551,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Bad, we got a cycle somehow. // Kill both the parent and the child, and // set cache misses for both of them. - llwarns << "Attempting to recover from parenting cycle!" << llendl + llwarns << "Attempting to recover from parenting cycle!" << llendl; llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl; llwarns << "Adding to cache miss list" << llendl; setParent(NULL); @@ -1575,6 +1575,24 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, sent_parentp->addChild(this); } + if( mPartSourcep.notNull() ) + { + LLViewerPartSourceScript *partSourceScript = mPartSourcep.get(); + partSourceScript->setSuspended( FALSE ); + } + + if( mText.notNull() ) + { + LLHUDText *hudText = mText.get(); + hudText->setHidden( FALSE ); + } + + if( mIcon.notNull() ) + { + LLHUDIcon *hudIcon = mIcon.get(); + hudIcon->setHidden( FALSE ); + } + setChanged(MOVED | SILHOUETTE); } else @@ -1589,6 +1607,23 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U32 port = mesgsys->getSenderPort(); gObjectList.orphanize(this, parent_id, ip, port); + if( mPartSourcep.notNull() ) + { + LLViewerPartSourceScript *partSourceScript = mPartSourcep.get(); + partSourceScript->setSuspended( TRUE ); + } + + if( mText.notNull() ) + { + LLHUDText *hudText = mText.get(); + hudText->setHidden( TRUE ); + } + + if( mIcon.notNull() ) + { + LLHUDIcon *hudIcon = mIcon.get(); + hudIcon->setHidden( TRUE ); + } } } } @@ -1666,7 +1701,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Bad, we got a cycle somehow. // Kill both the parent and the child, and // set cache misses for both of them. - llwarns << "Attempting to recover from parenting cycle!" << llendl + llwarns << "Attempting to recover from parenting cycle!" << llendl; llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl; llwarns << "Adding to cache miss list" << llendl; setParent(NULL); @@ -4128,7 +4163,11 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow if (audio_uuid.isNull()) { - if (mAudioSourcep && mAudioSourcep->isLoop() && !mAudioSourcep->hasPendingPreloads()) + if (!mAudioSourcep) + { + return; + } + if (mAudioSourcep->isLoop() && !mAudioSourcep->hasPendingPreloads()) { // We don't clear the sound if it's a loop, it'll go away on its own. // At least, this appears to be how the scripts work. @@ -4138,29 +4177,22 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow gAudiop->cleanupAudioSource(mAudioSourcep); mAudioSourcep = NULL; } - else if (mAudioSourcep) - { - if (mAudioSourcep->isLoop()) - { - // Just shut off the sound - mAudioSourcep->play(LLUUID::null); - } + else if (flags & LL_SOUND_FLAG_STOP) + { + // Just shut off the sound + mAudioSourcep->play(LLUUID::null); } return; } - if (flags & LL_SOUND_FLAG_LOOP) + if (flags & LL_SOUND_FLAG_LOOP + && mAudioSourcep && mAudioSourcep->isLoop() && mAudioSourcep->getCurrentData() + && mAudioSourcep->getCurrentData()->getID() == audio_uuid) { - if (mAudioSourcep && mAudioSourcep->isLoop() && mAudioSourcep->getCurrentData()) - { - if (mAudioSourcep->getCurrentData()->getID() == audio_uuid) - { - //llinfos << "Already playing this sound on a loop, ignoring" << llendl; - return; - } - } + //llinfos << "Already playing this sound on a loop, ignoring" << llendl; + return; } - // don't clean up before previous sound is done. Solves: SL-33486 + // don't clean up before previous sound is done. Solves: SL-33486 if ( mAudioSourcep && mAudioSourcep->isDone() ) { gAudiop->cleanupAudioSource(mAudioSourcep); @@ -4171,11 +4203,16 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow if (mAudioSourcep) { + BOOL queue = flags & LL_SOUND_FLAG_QUEUE; mAudioSourcep->setGain(gain); - mAudioSourcep->setLoop((flags & LL_SOUND_FLAG_LOOP) ? TRUE : FALSE); - mAudioSourcep->setSyncMaster((flags & LL_SOUND_FLAG_SYNC_MASTER) ? TRUE : FALSE); - mAudioSourcep->setSyncSlave((flags & LL_SOUND_FLAG_SYNC_SLAVE) ? TRUE : FALSE); - mAudioSourcep->setQueueSounds((flags & LL_SOUND_FLAG_QUEUE) ? TRUE : FALSE); + mAudioSourcep->setLoop(flags & LL_SOUND_FLAG_LOOP); + mAudioSourcep->setSyncMaster(flags & LL_SOUND_FLAG_SYNC_MASTER); + mAudioSourcep->setSyncSlave(flags & LL_SOUND_FLAG_SYNC_SLAVE); + mAudioSourcep->setQueueSounds(queue); + if(!queue) // stop any current sound first to avoid "farts of doom" (SL-1541) -MG + { + mAudioSourcep->play(LLUUID::null); + } //llinfos << "Playing attached sound " << audio_uuid << llendl; mAudioSourcep->play(audio_uuid); } diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 01c835dbf0..96e8863ec8 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -27,6 +27,7 @@ LLViewerPartSource::LLViewerPartSource(const U32 type) : mLastUpdateTime = 0.f; mLastPartTime = 0.f; mIsDead = FALSE; + mIsSuspended = FALSE; static U32 id_seed = 0; mID = ++id_seed; } @@ -73,6 +74,9 @@ void LLViewerPartSourceScript::setDead() void LLViewerPartSourceScript::update(const F32 dt) { + if( mIsSuspended ) + return; + LLMemType mt(LLMemType::MTYPE_PARTICLES); F32 old_update_time = mLastUpdateTime; mLastUpdateTime += dt; diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 30ea00809a..807f73e2ab 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -41,9 +41,10 @@ public: virtual void update(const F32 dt); // Return FALSE if this source is dead... virtual void setDead(); - BOOL isDead() const { return mIsDead; } - - U32 getType() const { return mType; } + BOOL isDead() const { return mIsDead; } + void setSuspended( BOOL state ) { mIsSuspended = state; } + BOOL isSuspended() const { return mIsSuspended; } + U32 getType() const { return mType; } static void updatePart(LLViewerPart &part, const F32 dt); void setOwnerUUID(const LLUUID& owner_id) { mOwnerUUID = owner_id; } LLUUID getOwnerUUID() const { return mOwnerUUID; } @@ -57,6 +58,7 @@ public: protected: U32 mType; BOOL mIsDead; + BOOL mIsSuspended; F32 mLastUpdateTime; F32 mLastPartTime; LLUUID mOwnerUUID; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index cc0345b79a..3969230197 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -1405,7 +1405,8 @@ LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlF LLFontGL* font = LLView::selectFont(node); - LLString text = node->getValue(); + // LLString text = node->getValue(); + LLString text = node->getTextContents().substr(0, max_text_length - 1); if (text.size() > max_text_length) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 682490440c..75d7a97372 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2380,13 +2380,13 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) case KEY_RIGHT: case KEY_UP: // let CTRL UP through for chat line history - if( MASK_CONTROL & mask ) + if( MASK_CONTROL == mask ) { break; } case KEY_DOWN: // let CTRL DOWN through for chat line history - if( MASK_CONTROL & mask ) + if( MASK_CONTROL == mask ) { break; } @@ -3153,7 +3153,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL moveable_object_selected = FALSE; BOOL all_selected_objects_move = TRUE; BOOL all_selected_objects_modify = TRUE; - BOOL selecting_linked_set = gSavedSettings.getBOOL("SelectLinkedSet"); + BOOL selecting_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); for( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() ) { BOOL this_object_movable = FALSE; @@ -3512,6 +3512,18 @@ void LLViewerWindow::performPick() objectp = gObjectList.getSelectedObject(name); if (objectp) { + LLViewerObject* parent = (LLViewerObject*)(objectp->getParent()); + if (NULL == parent) { + // if you are the parent + parent = objectp; + } + std::vector<LLPointer<LLViewerObject>,std::allocator<LLPointer<LLViewerObject> > > children = parent->getChildren(); + for( std::vector<LLPointer<LLViewerObject>,std::allocator<LLPointer<LLViewerObject> > >::iterator i= children.begin(); i!= children.end(); ++i ) + { + //go through + LLViewerObject* foo = *i; + foo->getRotation(); + } if (objectp->mbCanSelect) { te_offset = (te_offset == 16) ? NO_FACE : te_offset; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0236abf127..540cd1f04b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5719,6 +5719,7 @@ void LLVOAvatar::requestLayerSetUpdate( LLVOAvatar::ELocTexIndex i ) break; + case LOCTEX_UPPER_JACKET: case LOCTEX_LOWER_JACKET: if( mUpperBodyLayerSet ) { @@ -5730,6 +5731,10 @@ void LLVOAvatar::requestLayerSetUpdate( LLVOAvatar::ELocTexIndex i ) mLowerBodyLayerSet->requestUpdate(); } break; + + case LOCTEX_NUM_ENTRIES: + llerrs << "Bogus texture value " << i << llendl; + break; } } @@ -7389,6 +7394,24 @@ void LLVOAvatar::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid ) mSkirtLayerSet->cancelUpload(); } break; + + case TEX_HEAD_BODYPAINT: + case TEX_UPPER_SHIRT: + case TEX_LOWER_PANTS: + case TEX_EYES_IRIS: + case TEX_HAIR: + case TEX_UPPER_BODYPAINT: + case TEX_LOWER_BODYPAINT: + case TEX_LOWER_SHOES: + case TEX_LOWER_SOCKS: + case TEX_UPPER_JACKET: + case TEX_LOWER_JACKET: + case TEX_UPPER_GLOVES: + case TEX_UPPER_UNDERSHIRT: + case TEX_LOWER_UNDERPANTS: + case TEX_SKIRT: + case TEX_NUM_ENTRIES: + break; } } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 3257e921bc..c98826d15b 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -236,8 +236,7 @@ public: (1 << LLVertexBuffer::TYPE_TEXCOORD) | (1 << LLVertexBuffer::TYPE_WEIGHT) | (1 << LLVertexBuffer::TYPE_CLOTHWEIGHT) - } - eVertexDataMask; + }; LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); /*virtual*/ void markDead(); diff --git a/indra/newview/llvoinventorylistener.cpp b/indra/newview/llvoinventorylistener.cpp index a0b623db71..13cf596280 100644 --- a/indra/newview/llvoinventorylistener.cpp +++ b/indra/newview/llvoinventorylistener.cpp @@ -13,7 +13,7 @@ void LLVOInventoryListener::removeVOInventoryListener() { - if (mListenerVObject != NULL) + if (mListenerVObject) { mListenerVObject->removeInventoryListener(this); mListenerVObject = NULL; @@ -32,7 +32,7 @@ void LLVOInventoryListener::registerVOInventoryListener(LLViewerObject* object, void LLVOInventoryListener::requestVOInventory() { - if (mListenerVObject != NULL) + if (mListenerVObject) { mListenerVObject->requestInventory(); } diff --git a/indra/newview/llvoinventorylistener.h b/indra/newview/llvoinventorylistener.h index 1cca42fc93..7f14b5d74a 100644 --- a/indra/newview/llvoinventorylistener.h +++ b/indra/newview/llvoinventorylistener.h @@ -36,7 +36,7 @@ protected: void requestVOInventory(); private: - LLViewerObject* mListenerVObject; + LLPointer<LLViewerObject> mListenerVObject; }; #endif diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index c0df55b670..9995a8e462 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -401,7 +401,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co continue; } - LLAlphaObject* obj = (LLAlphaObject*) drawablep->getVObj(); + LLAlphaObject* obj = (LLAlphaObject*) drawablep->getVObj().get(); obj->mDepth = 0.f; if (drawablep->isAnimating()) diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index df1631cbc7..11fcf64b1b 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -19,14 +19,13 @@ class LLViewerPartGroup; class LLVOPartGroup : public LLAlphaObject { public: - enum + enum { VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | (1 << LLVertexBuffer::TYPE_NORMAL) | (1 << LLVertexBuffer::TYPE_TEXCOORD) | (1 << LLVertexBuffer::TYPE_COLOR) - } - eVertexDataMask; + }; LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h index af6653e556..1264cc5b8e 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -19,15 +19,14 @@ class LLVector2; class LLVOSurfacePatch : public LLStaticViewerObject { public: - enum + enum { VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | (1 << LLVertexBuffer::TYPE_NORMAL) | (1 << LLVertexBuffer::TYPE_TEXCOORD) | (1 << LLVertexBuffer::TYPE_TEXCOORD2) | (1 << LLVertexBuffer::TYPE_COLOR) - } - eVertexDataMask; + }; LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index e10abbfb27..509d23d011 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -23,13 +23,12 @@ protected: ~LLVOTree(); public: - enum + enum { VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | (1 << LLVertexBuffer::TYPE_NORMAL) | (1 << LLVertexBuffer::TYPE_TEXCOORD) - } - eVertexDataMask; + }; LLVOTree(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ec64cc23b3..a126237e00 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -46,6 +46,7 @@ const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; +const S32 SCULPT_REZ = 128; BOOL gAnimateTextures = TRUE; extern BOOL gHideSelectedObjects; @@ -252,9 +253,9 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, void LLVOVolume::animateTextures() { F32 off_s = 0.f, off_t = 0.f, scale_s = 1.f, scale_t = 1.f, rot = 0.f; - S32 result; + S32 result = mTextureAnimp->animateTextures(off_s, off_t, scale_s, scale_t, rot); - if (result = mTextureAnimp->animateTextures(off_s, off_t, scale_s, scale_t, rot)) + if (result) { if (!mTexAnimMode) { @@ -464,10 +465,11 @@ void LLVOVolume::updateTextures() mSculptTexture = gImageList.getImage(id); if (mSculptTexture.notNull()) { - mSculptTexture->addTextureStats(mPixelArea); + mSculptTexture->addTextureStats(SCULPT_REZ * SCULPT_REZ); + mSculptTexture->setBoostLevel(LLViewerImage::BOOST_SCULPTED); } - S32 desired_discard = MAX_LOD - mLOD; + S32 desired_discard = 0; // lower discard levels have MUCH less resolution - (old=MAX_LOD - mLOD) S32 current_discard = getVolume()->getSculptLevel(); if (desired_discard != current_discard) @@ -681,7 +683,7 @@ void LLVOVolume::sculpt() if (mSculptTexture.notNull()) { S32 discard_level; - S32 desired_discard = MAX_LOD - mLOD; // desired + S32 desired_discard = 0; // lower discard levels have MUCH less resolution discard_level = desired_discard; @@ -2190,7 +2192,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { LLDrawable* drawablep = *drawable_iter; - if (drawablep->isDead()) + if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) { continue; } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 6ee6d255c4..7ce2f95de9 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -63,8 +63,7 @@ public: (1 << LLVertexBuffer::TYPE_TEXCOORD) | (1 << LLVertexBuffer::TYPE_TEXCOORD2) | (1 << LLVertexBuffer::TYPE_COLOR) - } - eVertexDataMask; + }; public: LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); diff --git a/indra/newview/llvowater.h b/indra/newview/llvowater.h index fd140fda56..e3df822037 100644 --- a/indra/newview/llvowater.h +++ b/indra/newview/llvowater.h @@ -32,8 +32,7 @@ public: VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | (1 << LLVertexBuffer::TYPE_NORMAL) | (1 << LLVertexBuffer::TYPE_TEXCOORD) - } - eVertexDataMask; + }; LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index f6116eb718..1d2e9af3b6 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -481,6 +481,8 @@ F32 LLWorld::resolveStepHeightGlobal(const LLVOAvatar* avatarp, const LLVector3d land_intersection.mdV[VZ] = regionp->getLand().resolveHeightGlobal(point_a); normalized_land_distance = (F32)(point_a.mdV[VZ] - land_intersection.mdV[VZ]) / segment_length; + intersection = land_intersection; + intersection_normal = resolveLandNormalGlobal(land_intersection); if (avatarp && !avatarp->mFootPlane.isExactlyClear()) { @@ -491,17 +493,13 @@ F32 LLWorld::resolveStepHeightGlobal(const LLVOAvatar* avatarp, const LLVector3d norm_dist_from_plane = llclamp(norm_dist_from_plane / segment_length, 0.f, 1.f); if (norm_dist_from_plane < normalized_land_distance) { + // collided with object before land normalized_land_distance = norm_dist_from_plane; intersection = point_a; intersection.mdV[VZ] -= norm_dist_from_plane * segment_length; intersection_normal = foot_plane_normal; } } - else - { - intersection = land_intersection; - intersection_normal = resolveLandNormalGlobal(land_intersection); - } return normalized_land_distance; } diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index cf57ae3cd0..294df75f2a 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -208,22 +208,22 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) // tell curl about the settings curl_easy_setopt(mCurl, CURLOPT_PROXY, mProxyAddress.c_str()); - curl_easy_setopt(mCurl, CURLOPT_PROXYPORT, (long)port); - curl_easy_setopt(mCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); + curl_easy_setopt(mCurl, CURLOPT_PROXYPORT, (long) port); + curl_easy_setopt(mCurl, CURLOPT_PROXYTYPE, (long) CURLPROXY_HTTP); }; -// curl_easy_setopt(mCurl, CURLOPT_VERBOSE, 1); // usefull for debugging - curl_easy_setopt(mCurl, CURLOPT_NOSIGNAL, 1); +// curl_easy_setopt(mCurl, CURLOPT_VERBOSE, 1L); // usefull for debugging + curl_easy_setopt(mCurl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt(mCurl, CURLOPT_WRITEFUNCTION, &curlDownloadCallback); curl_easy_setopt(mCurl, CURLOPT_WRITEDATA, this); curl_easy_setopt(mCurl, CURLOPT_ERRORBUFFER, &mCurlErrorBuffer); curl_easy_setopt(mCurl, CURLOPT_CAINFO, gDirUtilp->getCAFile().c_str()); - curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYPEER, gVerifySSLCert); - curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYHOST, gVerifySSLCert? 2 : 0); + curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYPEER, (long) gVerifySSLCert); + curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYHOST, gVerifySSLCert? 2L : 0L); /* Setting the DNS cache timeout to -1 disables it completely. This might help with bug #503 */ - curl_easy_setopt(mCurl, CURLOPT_DNS_CACHE_TIMEOUT, -1); + curl_easy_setopt(mCurl, CURLOPT_DNS_CACHE_TIMEOUT, -1L); mHeaders = curl_slist_append(mHeaders, "Content-Type: text/xml"); curl_easy_setopt(mCurl, CURLOPT_URL, mURI.c_str()); @@ -237,7 +237,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) if (mRequestText) { curl_easy_setopt(mCurl, CURLOPT_POSTFIELDS, mRequestText); - curl_easy_setopt(mCurl, CURLOPT_POSTFIELDSIZE, mRequestTextSize); + curl_easy_setopt(mCurl, CURLOPT_POSTFIELDSIZE, (long) mRequestTextSize); } else { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c3841a4790..d4d5cfc624 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1386,7 +1386,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) if (gHideSelectedObjects) { - if (drawablep->getVObj() && + if (drawablep->getVObj().notNull() && drawablep->getVObj()->isSelected()) { return; @@ -1415,7 +1415,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) } else if (drawablep->isAvatar() && drawablep->isVisible()) { - LLVOAvatar* vobj = (LLVOAvatar*) drawablep->getVObj(); + LLVOAvatar* vobj = (LLVOAvatar*) drawablep->getVObj().get(); vobj->updateVisibility(FALSE); } @@ -3478,7 +3478,7 @@ BOOL LLPipeline::getRenderSoundBeacons(void*) LLViewerObject* LLPipeline::pickObject(const LLVector3 &start, const LLVector3 &end, LLVector3 &collision) { LLDrawable* drawable = mObjectPartition[PARTITION_VOLUME]->pickDrawable(start, end, collision); - return drawable ? drawable->getVObj() : NULL; + return drawable ? drawable->getVObj().get() : NULL; } LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index c714ad627d..eba306a248 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -410,7 +410,6 @@ class Linux_i686Manifest(LinuxManifest): self.path("libssl.so.0.9.7") self.path("libexpat.so.1") self.path("libstdc++.so.6") - self.path("libelfio.so") self.path("libuuid.so", "libuuid.so.1") self.path("libSDL-1.2.so.0") self.path("libtcmalloc.so.0") @@ -422,7 +421,8 @@ class Linux_i686Manifest(LinuxManifest): class Linux_x86_64Manifest(LinuxManifest): def construct(self): super(Linux_x86_64Manifest, self).construct() - self.path("secondlife-x86_64-bin-stripped","bin/secondlife-bin") + self.path("secondlife-x86_64-bin-stripped","bin/do-not-directly-run-secondlife-bin") + self.path("../linux_crash_logger/linux-crash-logger-x86_64-bin-stripped","linux-crash-logger.bin") # TODO: I get the sense that this isn't fully fleshed out if self.prefix("../../libraries/x86_64-linux/lib_release_client", "lib"): self.path("libkdu_v42R.so") |