diff options
author | McCabe Maxsted | 2009-03-04 12:50:59 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-03-04 12:50:59 -0700 |
commit | f3de7ecf37cd83c23d15ea12e112be9600e33ece (patch) | |
tree | adac53f3d9b87bd87fd081b1722781d071c8ebff /linden/indra | |
parent | Backported fix for VWR-6744 (No way to hide IMs in chat console) (diff) | |
parent | Applied my patch for VWR-8454 (PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS not hig... (diff) | |
download | meta-impy-f3de7ecf37cd83c23d15ea12e112be9600e33ece.zip meta-impy-f3de7ecf37cd83c23d15ea12e112be9600e33ece.tar.gz meta-impy-f3de7ecf37cd83c23d15ea12e112be9600e33ece.tar.bz2 meta-impy-f3de7ecf37cd83c23d15ea12e112be9600e33ece.tar.xz |
Merge branch 'cvpatches' into next
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/llcharacter/llbvhloader.cpp | 45 | ||||
-rw-r--r-- | linden/indra/llui/llfloater.cpp | 1 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/keywords.ini | 1 | ||||
-rw-r--r-- | linden/indra/newview/llcompilequeue.cpp | 16 | ||||
-rw-r--r-- | linden/indra/newview/lldrawable.cpp | 12 | ||||
-rw-r--r-- | linden/indra/newview/llfilepicker.cpp | 39 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 5 | ||||
-rw-r--r-- | linden/indra/newview/pipeline.cpp | 12 |
8 files changed, 112 insertions, 19 deletions
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() | |||
1133 | 1133 | ||
1134 | F32 rot_threshold = ROTATION_KEYFRAME_THRESHOLD / llmax((F32)joint->mChildTreeMaxDepth * 0.33f, 1.f); | 1134 | F32 rot_threshold = ROTATION_KEYFRAME_THRESHOLD / llmax((F32)joint->mChildTreeMaxDepth * 0.33f, 1.f); |
1135 | 1135 | ||
1136 | double diff_max = 0; | ||
1137 | KeyVector::iterator ki_max = ki; | ||
1136 | for (; ki != joint->mKeys.end(); ++ki) | 1138 | for (; ki != joint->mKeys.end(); ++ki) |
1137 | { | 1139 | { |
1138 | if (ki_prev == ki_last_good_pos) | 1140 | if (ki_prev == ki_last_good_pos) |
@@ -1193,30 +1195,55 @@ void LLBVHLoader::optimize() | |||
1193 | F32 x_delta; | 1195 | F32 x_delta; |
1194 | F32 y_delta; | 1196 | F32 y_delta; |
1195 | F32 rot_test; | 1197 | F32 rot_test; |
1196 | 1198 | ||
1199 | // Test if the rotation has changed significantly since the very first frame. If false | ||
1200 | // for all frames, then we'll just throw out this joint's rotation entirely. | ||
1197 | x_delta = dist_vec(LLVector3::x_axis * first_frame_rot, LLVector3::x_axis * test_rot); | 1201 | x_delta = dist_vec(LLVector3::x_axis * first_frame_rot, LLVector3::x_axis * test_rot); |
1198 | y_delta = dist_vec(LLVector3::y_axis * first_frame_rot, LLVector3::y_axis * test_rot); | 1202 | y_delta = dist_vec(LLVector3::y_axis * first_frame_rot, LLVector3::y_axis * test_rot); |
1199 | rot_test = x_delta + y_delta; | 1203 | rot_test = x_delta + y_delta; |
1200 | |||
1201 | if (rot_test > ROTATION_MOTION_THRESHOLD) | 1204 | if (rot_test > ROTATION_MOTION_THRESHOLD) |
1202 | { | 1205 | { |
1203 | rot_changed = TRUE; | 1206 | rot_changed = TRUE; |
1204 | } | 1207 | } |
1205 | |||
1206 | x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot); | 1208 | x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot); |
1207 | y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot); | 1209 | y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot); |
1208 | rot_test = x_delta + y_delta; | 1210 | rot_test = x_delta + y_delta; |
1209 | 1211 | ||
1210 | if (rot_test < rot_threshold) | 1212 | // Draw a line between the last good keyframe and current. Test the distance between the last frame (current-1, i.e. ki_prev) |
1211 | { | 1213 | // and the line. If it's greater than some threshold, then it represents a significant frame and we want to include it. |
1212 | ki_prev->mIgnoreRot = TRUE; | 1214 | if (rot_test >= rot_threshold || |
1213 | numRotFramesConsidered++; | 1215 | (ki+1 == joint->mKeys.end() && numRotFramesConsidered > 2)) |
1214 | } | ||
1215 | else | ||
1216 | { | 1216 | { |
1217 | // Add the current test keyframe (which is technically the previous key, i.e. ki_prev). | ||
1217 | numRotFramesConsidered = 2; | 1218 | numRotFramesConsidered = 2; |
1218 | ki_last_good_rot = ki_prev; | 1219 | ki_last_good_rot = ki_prev; |
1219 | joint->mNumRotKeys++; | 1220 | joint->mNumRotKeys++; |
1221 | |||
1222 | // Add another keyframe between the last good keyframe and current, at whatever point was the most "significant" (i.e. | ||
1223 | // had the largest deviation from the earlier tests). Note that a more robust approach would be test all intermediate | ||
1224 | // keyframes against the line between the last good keyframe and current, but we're settling for this other method | ||
1225 | // because it's significantly faster. | ||
1226 | if (diff_max > 0) | ||
1227 | { | ||
1228 | if (ki_max->mIgnoreRot == TRUE) | ||
1229 | { | ||
1230 | ki_max->mIgnoreRot = FALSE; | ||
1231 | joint->mNumRotKeys++; | ||
1232 | } | ||
1233 | diff_max = 0; | ||
1234 | } | ||
1235 | } | ||
1236 | else | ||
1237 | { | ||
1238 | // This keyframe isn't significant enough, throw it away. | ||
1239 | ki_prev->mIgnoreRot = TRUE; | ||
1240 | numRotFramesConsidered++; | ||
1241 | // Store away the keyframe that has the largest deviation from the interpolated line, for insertion later. | ||
1242 | if (rot_test > diff_max) | ||
1243 | { | ||
1244 | diff_max = rot_test; | ||
1245 | ki_max = ki; | ||
1246 | } | ||
1220 | } | 1247 | } |
1221 | } | 1248 | } |
1222 | 1249 | ||
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() | |||
1580 | S32 button_count = 0; | 1580 | S32 button_count = 0; |
1581 | for (S32 i = 0; i < BUTTON_COUNT; i++) | 1581 | for (S32 i = 0; i < BUTTON_COUNT; i++) |
1582 | { | 1582 | { |
1583 | if(!mButtons[i]) continue; | ||
1583 | mButtons[i]->setEnabled(mButtonsEnabled[i]); | 1584 | mButtons[i]->setEnabled(mButtonsEnabled[i]); |
1584 | 1585 | ||
1585 | if (mButtonsEnabled[i] | 1586 | if (mButtonsEnabled[i] |
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 | |||
455 | PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land | 455 | PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land |
456 | PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage | 456 | PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage |
457 | PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects | 457 | PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects |
458 | PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects | ||
458 | PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group | 459 | PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group |
459 | PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents | 460 | PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents |
460 | PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list | 461 | PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list |
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 @@ | |||
59 | #include "llfloaterchat.h" | 59 | #include "llfloaterchat.h" |
60 | #include "llviewerstats.h" | 60 | #include "llviewerstats.h" |
61 | #include "lluictrlfactory.h" | 61 | #include "lluictrlfactory.h" |
62 | #include "llselectmgr.h" | ||
62 | 63 | ||
63 | ///---------------------------------------------------------------------------- | 64 | ///---------------------------------------------------------------------------- |
64 | /// Local function declarations, constants, enums, and typedefs | 65 | /// Local function declarations, constants, enums, and typedefs |
@@ -194,7 +195,20 @@ BOOL LLFloaterScriptQueue::start() | |||
194 | { | 195 | { |
195 | //llinfos << "LLFloaterCompileQueue::start()" << llendl; | 196 | //llinfos << "LLFloaterCompileQueue::start()" << llendl; |
196 | std::string buffer; | 197 | std::string buffer; |
197 | buffer = llformat("Starting %s of %d items.", mStartString.c_str(), mObjectIDs.count()); // *TODO: Translate | 198 | |
199 | LLSelectMgr *mgr = LLSelectMgr::getInstance(); | ||
200 | LLObjectSelectionHandle selectHandle = mgr->getSelection(); | ||
201 | U32 n_objects = 0; | ||
202 | if (gSavedSettings.getBOOL("EditLinkedParts")) | ||
203 | { | ||
204 | n_objects = selectHandle->getObjectCount(); | ||
205 | } | ||
206 | else | ||
207 | { | ||
208 | n_objects = selectHandle->getRootObjectCount(); | ||
209 | } | ||
210 | |||
211 | buffer = llformat("Starting %s of %d items.", mStartString.c_str(), n_objects); // *TODO: Translate | ||
198 | 212 | ||
199 | LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); | 213 | LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); |
200 | list->addCommentText(buffer); | 214 | list->addCommentText(buffer); |
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) | |||
497 | F32 dist_squared = 0.f; | 497 | F32 dist_squared = 0.f; |
498 | F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); | 498 | F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); |
499 | 499 | ||
500 | if (damped && mDistanceWRTCamera > 0.0f) | 500 | if (damped && isVisible()) |
501 | { | 501 | { |
502 | F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); | 502 | F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); |
503 | LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); | 503 | LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); |
@@ -521,11 +521,19 @@ F32 LLDrawable::updateXform(BOOL undamped) | |||
521 | { | 521 | { |
522 | // snap to final position | 522 | // snap to final position |
523 | dist_squared = 0.0f; | 523 | dist_squared = 0.0f; |
524 | if (!isRoot()) | ||
525 | { //child prim snapping to some position, needs a rebuild | ||
526 | gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); | ||
527 | } | ||
524 | } | 528 | } |
525 | } | 529 | } |
526 | 530 | ||
527 | if ((mCurrentScale != target_scale) || | 531 | if ((mCurrentScale != target_scale) || |
528 | (!isRoot() && (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED) || !mVObjp->getAngularVelocity().isExactlyZero())) | 532 | (!isRoot() && |
533 | (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED) || | ||
534 | !mVObjp->getAngularVelocity().isExactlyZero() || | ||
535 | target_pos != mXform.getPosition() || | ||
536 | target_rot != mXform.getRotation())) | ||
529 | { //child prim moving or scale change requires immediate rebuild | 537 | { //child prim moving or scale change requires immediate rebuild |
530 | gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); | 538 | gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); |
531 | } | 539 | } |
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) | |||
899 | // static | 899 | // static |
900 | void LLFilePicker::add_to_selectedfiles(gpointer data, gpointer user_data) | 900 | void LLFilePicker::add_to_selectedfiles(gpointer data, gpointer user_data) |
901 | { | 901 | { |
902 | LLFilePicker* picker = (LLFilePicker*) user_data; | 902 | // We need to run g_filename_to_utf8 in the user's locale |
903 | std::string old_locale(setlocale(LC_ALL, NULL)); | ||
904 | setlocale(LC_ALL, ""); | ||
905 | |||
906 | LLFilePicker* picker = (LLFilePicker*) user_data; | ||
907 | GError *error = NULL; | ||
903 | gchar* filename_utf8 = g_filename_to_utf8((gchar*)data, | 908 | gchar* filename_utf8 = g_filename_to_utf8((gchar*)data, |
904 | -1, NULL, NULL, NULL); | 909 | -1, NULL, NULL, &error); |
905 | picker->mFiles.push_back(std::string(filename_utf8)); | 910 | if (error) |
906 | lldebugs << "ADDED FILE " << filename_utf8 << llendl; | 911 | { |
907 | g_free(filename_utf8); | 912 | // This condition should really be notified to the user, e.g., |
913 | // through a message box. Just logging it is inapropriate. | ||
914 | // FIXME. | ||
915 | |||
916 | // Ghhhh. g_filename_display_name is new to glib 2.6, and it | ||
917 | // is too new for SL! (Note that the latest glib as of this | ||
918 | // writing is 2.22. *sigh*) LL supplied *makeASCII family are | ||
919 | // also unsuitable since they allow control characters... | ||
920 | |||
921 | std::string display_name; | ||
922 | for (const gchar *str = (const gchar *)data; *str; str++) | ||
923 | { | ||
924 | display_name += (char)((*str >= 0x20 && *str <= 0x7E) ? *str : '?'); | ||
925 | } | ||
926 | llwarns << "g_filename_to_utf8 failed on \"" << display_name << "\": " << error->message << llendl; | ||
927 | } | ||
928 | |||
929 | if (filename_utf8) | ||
930 | { | ||
931 | picker->mFiles.push_back(std::string(filename_utf8)); | ||
932 | lldebugs << "ADDED FILE " << filename_utf8 << llendl; | ||
933 | g_free(filename_utf8); | ||
934 | } | ||
935 | |||
936 | setlocale(LC_ALL, old_locale.c_str()); | ||
908 | } | 937 | } |
909 | 938 | ||
910 | // static | 939 | // static |
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 | |||
5963 | { | 5963 | { |
5964 | // Apply until an object fails | 5964 | // Apply until an object fails |
5965 | QueueObjects func(q); | 5965 | QueueObjects func(q); |
5966 | const bool firstonly = true; | 5966 | LLSelectMgr *mgr = LLSelectMgr::getInstance(); |
5967 | bool fail = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func, firstonly); | 5967 | LLObjectSelectionHandle selectHandle = mgr->getSelection(); |
5968 | bool fail = selectHandle->applyToObjects(&func); | ||
5968 | if(fail) | 5969 | if(fail) |
5969 | { | 5970 | { |
5970 | if ( !func.scripted ) | 5971 | if ( !func.scripted ) |
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<LLViewerObject*>& objects, BOOL render | |||
2665 | LLGLState::checkClientArrays(); | 2665 | LLGLState::checkClientArrays(); |
2666 | U32 last_type = 0; | 2666 | U32 last_type = 0; |
2667 | 2667 | ||
2668 | // If we don't do this, we crash something on changing graphics settings | ||
2669 | // from Medium -> Low, because we unload all the shaders and the | ||
2670 | // draw pools aren't aware. I don't know if this has to be a separate | ||
2671 | // loop before actual rendering. JC | ||
2672 | for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) | ||
2673 | { | ||
2674 | LLDrawPool *poolp = *iter; | ||
2675 | if (poolp->isFacePool() && hasRenderType(poolp->getType())) | ||
2676 | { | ||
2677 | poolp->prerender(); | ||
2678 | } | ||
2679 | } | ||
2668 | for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) | 2680 | for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) |
2669 | { | 2681 | { |
2670 | LLDrawPool *poolp = *iter; | 2682 | LLDrawPool *poolp = *iter; |