From 8036835628d66b3561668eb4872debed3075ca5d Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:13:19 -0700 Subject: Fixed crash involving file picker and locales (patch by Alissa Sabre) --- ChangeLog.txt | 4 ++++ linden/indra/newview/llfilepicker.cpp | 39 ++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 34cc409..e187605 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -14,6 +14,10 @@ Ditto. + * linden/indra/newview/llfilepicker.cpp: + Applied patch for VWR-5575 (crash in the file picker dealing + with accented characters and bad locale) by Alissa Sabre. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= diff --git a/linden/indra/newview/llfilepicker.cpp b/linden/indra/newview/llfilepicker.cpp index bbcfba6..1edfbe6 100644 --- a/linden/indra/newview/llfilepicker.cpp +++ b/linden/indra/newview/llfilepicker.cpp @@ -899,12 +899,41 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) // static void LLFilePicker::add_to_selectedfiles(gpointer data, gpointer user_data) { - LLFilePicker* picker = (LLFilePicker*) user_data; + // We need to run g_filename_to_utf8 in the user's locale + std::string old_locale(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, ""); + + LLFilePicker* picker = (LLFilePicker*) user_data; + GError *error = NULL; gchar* filename_utf8 = g_filename_to_utf8((gchar*)data, - -1, NULL, NULL, NULL); - picker->mFiles.push_back(std::string(filename_utf8)); - lldebugs << "ADDED FILE " << filename_utf8 << llendl; - g_free(filename_utf8); + -1, NULL, NULL, &error); + if (error) + { + // This condition should really be notified to the user, e.g., + // through a message box. Just logging it is inapropriate. + // FIXME. + + // Ghhhh. g_filename_display_name is new to glib 2.6, and it + // is too new for SL! (Note that the latest glib as of this + // writing is 2.22. *sigh*) LL supplied *makeASCII family are + // also unsuitable since they allow control characters... + + std::string display_name; + for (const gchar *str = (const gchar *)data; *str; str++) + { + display_name += (char)((*str >= 0x20 && *str <= 0x7E) ? *str : '?'); + } + llwarns << "g_filename_to_utf8 failed on \"" << display_name << "\": " << error->message << llendl; + } + + if (filename_utf8) + { + picker->mFiles.push_back(std::string(filename_utf8)); + lldebugs << "ADDED FILE " << filename_utf8 << llendl; + g_free(filename_utf8); + } + + setlocale(LC_ALL, old_locale.c_str()); } // static -- cgit v1.1 From bc0cc449e0ab73effeb6cd113048943f53213367 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:17:42 -0700 Subject: Backported possible crash fix while changing graphics settings from 1.22 --- ChangeLog.txt | 3 +++ linden/indra/newview/pipeline.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index e187605..d6d0f90 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -18,6 +18,9 @@ Applied patch for VWR-5575 (crash in the file picker dealing with accented characters and bad locale) by Alissa Sabre. + * linden/indra/newview/pipeline.cpp: + Backported possible crash fix while changing graphics settings from 1.22. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 3523635..e7db166 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -2665,6 +2665,18 @@ void LLPipeline::renderForSelect(std::set& objects, BOOL render LLGLState::checkClientArrays(); U32 last_type = 0; + // If we don't do this, we crash something on changing graphics settings + // from Medium -> Low, because we unload all the shaders and the + // draw pools aren't aware. I don't know if this has to be a separate + // loop before actual rendering. JC + for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) + { + LLDrawPool *poolp = *iter; + if (poolp->isFacePool() && hasRenderType(poolp->getType())) + { + poolp->prerender(); + } + } for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) { LLDrawPool *poolp = *iter; -- cgit v1.1 From c11c9ac087cfb9a5f7c63e37a7119121c7f39ad1 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:23:25 -0700 Subject: Backported possible crash fix in llfloater.cpp from 1.22 --- ChangeLog.txt | 3 +++ linden/indra/llui/llfloater.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index d6d0f90..5fdd770 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -21,6 +21,9 @@ * linden/indra/newview/pipeline.cpp: Backported possible crash fix while changing graphics settings from 1.22. + * linden/indra/llui/llfloater.cpp: + Backported possible crash fix in llfloater.cpp from 1.22. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 9f8cd65..2f4e873 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -1580,6 +1580,7 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { + if(!mButtons[i]) continue; mButtons[i]->setEnabled(mButtonsEnabled[i]); if (mButtonsEnabled[i] -- cgit v1.1 From f501ad0679ae8096818684285397d6b59388a41b Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:28:19 -0700 Subject: Backported fix for VWR-3871 (prim position appears to be off) from 1.22 --- ChangeLog.txt | 3 +++ linden/indra/newview/lldrawable.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5fdd770..1f33ca1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -24,6 +24,9 @@ * linden/indra/llui/llfloater.cpp: Backported possible crash fix in llfloater.cpp from 1.22. + * linden/indra/newview/lldrawable.cpp: + Backported fix for VWR-3871 (prim position appears to be off) from 1.22. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp index 5e4aafc..e058681 100644 --- a/linden/indra/newview/lldrawable.cpp +++ b/linden/indra/newview/lldrawable.cpp @@ -497,7 +497,7 @@ F32 LLDrawable::updateXform(BOOL undamped) F32 dist_squared = 0.f; F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); - if (damped && mDistanceWRTCamera > 0.0f) + if (damped && isVisible()) { F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); @@ -521,11 +521,19 @@ F32 LLDrawable::updateXform(BOOL undamped) { // snap to final position dist_squared = 0.0f; + if (!isRoot()) + { //child prim snapping to some position, needs a rebuild + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } } } if ((mCurrentScale != target_scale) || - (!isRoot() && (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED) || !mVObjp->getAngularVelocity().isExactlyZero())) + (!isRoot() && + (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED) || + !mVObjp->getAngularVelocity().isExactlyZero() || + target_pos != mXform.getPosition() || + target_rot != mXform.getRotation())) { //child prim moving or scale change requires immediate rebuild gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } -- cgit v1.1 From ddc9815e2f7a2bd077cdae149a4e95a45de2f9f6 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:33:54 -0700 Subject: Backported fix for SVC-2771 (script resetting can fail) from 1.22 --- ChangeLog.txt | 6 ++++++ linden/indra/newview/llcompilequeue.cpp | 16 +++++++++++++++- linden/indra/newview/llviewermenu.cpp | 5 +++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1f33ca1..0a2561a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -28,6 +28,12 @@ Backported fix for VWR-3871 (prim position appears to be off) from 1.22. + * linden/indra/newview/llcompilequeue.cpp: + Backported fix for SVC-2771 (script resetting can fail) from 1.22. + * linden/indra/newview/llviewermenu.cpp: + Ditto. + + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/linden/indra/newview/llcompilequeue.cpp b/linden/indra/newview/llcompilequeue.cpp index fc2742f..b4f1a22 100644 --- a/linden/indra/newview/llcompilequeue.cpp +++ b/linden/indra/newview/llcompilequeue.cpp @@ -59,6 +59,7 @@ #include "llfloaterchat.h" #include "llviewerstats.h" #include "lluictrlfactory.h" +#include "llselectmgr.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -194,7 +195,20 @@ BOOL LLFloaterScriptQueue::start() { //llinfos << "LLFloaterCompileQueue::start()" << llendl; std::string buffer; - buffer = llformat("Starting %s of %d items.", mStartString.c_str(), mObjectIDs.count()); // *TODO: Translate + + LLSelectMgr *mgr = LLSelectMgr::getInstance(); + LLObjectSelectionHandle selectHandle = mgr->getSelection(); + U32 n_objects = 0; + if (gSavedSettings.getBOOL("EditLinkedParts")) + { + n_objects = selectHandle->getObjectCount(); + } + else + { + n_objects = selectHandle->getRootObjectCount(); + } + + buffer = llformat("Starting %s of %d items.", mStartString.c_str(), n_objects); // *TODO: Translate LLScrollListCtrl* list = getChild("queue output"); list->addCommentText(buffer); diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 31fdcc3..486e4f1 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -5963,8 +5963,9 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons { // Apply until an object fails QueueObjects func(q); - const bool firstonly = true; - bool fail = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func, firstonly); + LLSelectMgr *mgr = LLSelectMgr::getInstance(); + LLObjectSelectionHandle selectHandle = mgr->getSelection(); + bool fail = selectHandle->applyToObjects(&func); if(fail) { if ( !func.scripted ) -- cgit v1.1 From 4344700e85c2ad9c4683a5a0ef38a641068f6525 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:40:54 -0700 Subject: Backported fix for VWR-996 (wrong visualisation of animations) from 1.22 --- ChangeLog.txt | 5 ++-- linden/indra/llcharacter/llbvhloader.cpp | 45 +++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0a2561a..b3689d6 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -13,7 +13,6 @@ * linden/indra/newview/skins/silver/xui/en-us/panel_media_controls.xml: Ditto. - * linden/indra/newview/llfilepicker.cpp: Applied patch for VWR-5575 (crash in the file picker dealing with accented characters and bad locale) by Alissa Sabre. @@ -27,12 +26,14 @@ * linden/indra/newview/lldrawable.cpp: Backported fix for VWR-3871 (prim position appears to be off) from 1.22. - * linden/indra/newview/llcompilequeue.cpp: Backported fix for SVC-2771 (script resetting can fail) from 1.22. * linden/indra/newview/llviewermenu.cpp: Ditto. + * linden/indra/llcharacter/llbvhloader.cpp: + Backported fix for VWR-996 (wrong visualisation of animations) from 1.22. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= diff --git a/linden/indra/llcharacter/llbvhloader.cpp b/linden/indra/llcharacter/llbvhloader.cpp index cd1f492..938f47d 100644 --- a/linden/indra/llcharacter/llbvhloader.cpp +++ b/linden/indra/llcharacter/llbvhloader.cpp @@ -1133,6 +1133,8 @@ void LLBVHLoader::optimize() F32 rot_threshold = ROTATION_KEYFRAME_THRESHOLD / llmax((F32)joint->mChildTreeMaxDepth * 0.33f, 1.f); + double diff_max = 0; + KeyVector::iterator ki_max = ki; for (; ki != joint->mKeys.end(); ++ki) { if (ki_prev == ki_last_good_pos) @@ -1193,30 +1195,55 @@ void LLBVHLoader::optimize() F32 x_delta; F32 y_delta; F32 rot_test; - + + // Test if the rotation has changed significantly since the very first frame. If false + // for all frames, then we'll just throw out this joint's rotation entirely. x_delta = dist_vec(LLVector3::x_axis * first_frame_rot, LLVector3::x_axis * test_rot); y_delta = dist_vec(LLVector3::y_axis * first_frame_rot, LLVector3::y_axis * test_rot); rot_test = x_delta + y_delta; - if (rot_test > ROTATION_MOTION_THRESHOLD) { rot_changed = TRUE; } - x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot); y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot); rot_test = x_delta + y_delta; - if (rot_test < rot_threshold) - { - ki_prev->mIgnoreRot = TRUE; - numRotFramesConsidered++; - } - else + // Draw a line between the last good keyframe and current. Test the distance between the last frame (current-1, i.e. ki_prev) + // and the line. If it's greater than some threshold, then it represents a significant frame and we want to include it. + if (rot_test >= rot_threshold || + (ki+1 == joint->mKeys.end() && numRotFramesConsidered > 2)) { + // Add the current test keyframe (which is technically the previous key, i.e. ki_prev). numRotFramesConsidered = 2; ki_last_good_rot = ki_prev; joint->mNumRotKeys++; + + // Add another keyframe between the last good keyframe and current, at whatever point was the most "significant" (i.e. + // had the largest deviation from the earlier tests). Note that a more robust approach would be test all intermediate + // keyframes against the line between the last good keyframe and current, but we're settling for this other method + // because it's significantly faster. + if (diff_max > 0) + { + if (ki_max->mIgnoreRot == TRUE) + { + ki_max->mIgnoreRot = FALSE; + joint->mNumRotKeys++; + } + diff_max = 0; + } + } + else + { + // This keyframe isn't significant enough, throw it away. + ki_prev->mIgnoreRot = TRUE; + numRotFramesConsidered++; + // Store away the keyframe that has the largest deviation from the interpolated line, for insertion later. + if (rot_test > diff_max) + { + diff_max = rot_test; + ki_max = ki; + } } } -- cgit v1.1 From 844be6dd0bf2a73f8e414c40435fe05116010de4 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 1 Mar 2009 04:47:01 -0700 Subject: Applied my patch for VWR-8454 (PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS not highlighted in script editor) --- ChangeLog.txt | 4 ++++ linden/indra/newview/app_settings/keywords.ini | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index b3689d6..d347628 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -34,6 +34,10 @@ * linden/indra/llcharacter/llbvhloader.cpp: Backported fix for VWR-996 (wrong visualisation of animations) from 1.22. + * linden/indra/newview/app_settings/keywords.ini: + Applied my patch for VWR-8454 (PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + not highlighted in script editor). + =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- 1.1.0 RC2 -= diff --git a/linden/indra/newview/app_settings/keywords.ini b/linden/indra/newview/app_settings/keywords.ini index 2a911ba..56acf4c 100644 --- a/linden/indra/newview/app_settings/keywords.ini +++ b/linden/indra/newview/app_settings/keywords.ini @@ -455,6 +455,7 @@ PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allo PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects +PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list -- cgit v1.1