diff options
| author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-08-12 19:12:44 -0400 |
|---|---|---|
| committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-08-12 19:12:44 -0400 |
| commit | e3a92a3f8e7d6df3772adcecb037149e6fcf0f3e (patch) | |
| tree | 537bdcfb9019a39b45a27f8d04f8ca3c1c5d87e6 /indra/newview/llviewermedia.cpp | |
| parent | 159a08c98dcba2bdf25caf13b236e27c54eda050 (diff) | |
| parent | b6648c2b4b69eceb5264b850d92702ae1c5e6911 (diff) | |
Merge branch 'develop' into geenz/linux-to-develop
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
| -rw-r--r-- | indra/newview/llviewermedia.cpp | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0590abc42e..5d01e08875 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -560,55 +560,34 @@ LLViewerMedia::impl_list &LLViewerMedia::getPriorityList() // This is the predicate function used to sort sViewerMediaImplList by priority. bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) { - if(i1->isForcedUnloaded() && !i2->isForcedUnloaded()) + // isForcedUnloaded can be pricey, avoid a repeat, + // note that this one is specifically i2, when everything else is i1 + // Consider making isForcedUnloaded cache the value temporarily? + bool i2_forced_unloaded = i2->isForcedUnloaded(); + if (i1->isForcedUnloaded() != i2_forced_unloaded) { // Muted or failed items always go to the end of the list, period. - return false; - } - else if(i2->isForcedUnloaded() && !i1->isForcedUnloaded()) - { - // Muted or failed items always go to the end of the list, period. - return true; - } - else if(i1->hasFocus()) - { - // The item with user focus always comes to the front of the list, period. - return true; + return i2_forced_unloaded; } - else if(i2->hasFocus()) + else if(i1->hasFocus() != i2->hasFocus()) { // The item with user focus always comes to the front of the list, period. - return false; - } - else if(i1->isParcelMedia()) - { - // The parcel media impl sorts above all other inworld media, unless one has focus. - return true; + return i1->hasFocus(); } - else if(i2->isParcelMedia()) + else if(i1->isParcelMedia() != i2->isParcelMedia()) { // The parcel media impl sorts above all other inworld media, unless one has focus. - return false; - } - else if(i1->getUsedInUI() && !i2->getUsedInUI()) - { - // i1 is a UI element, i2 is not. This makes i1 "less than" i2, so it sorts earlier in our list. - return true; + return i1->isParcelMedia(); } - else if(i2->getUsedInUI() && !i1->getUsedInUI()) + else if (i1->getUsedInUI() != i2->getUsedInUI()) { - // i2 is a UI element, i1 is not. This makes i2 "less than" i1, so it sorts earlier in our list. - return false; - } - else if(i1->isPlayable() && !i2->isPlayable()) - { - // Playable items sort above ones that wouldn't play even if they got high enough priority - return true; + // UI elements sort above inworld media. + return i1->getUsedInUI(); } - else if(!i1->isPlayable() && i2->isPlayable()) + else if (i1->isPlayable() != i2->isPlayable()) { // Playable items sort above ones that wouldn't play even if they got high enough priority - return false; + return i1->isPlayable(); } else if(i1->getInterest() == i2->getInterest()) { |
