diff options
author | Merov Linden <merov@lindenlab.com> | 2013-03-08 19:04:01 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-03-08 19:04:01 -0800 |
commit | d29bec7f4d390b932705ac9342f01f0b2412dd97 (patch) | |
tree | db389520c3f86c77401d78a94fbdc6dbebd127c8 /indra | |
parent | 5957f1da916173d0e6463ebd3d74ff06a6df0c59 (diff) |
CHUI-793 : WIP : Limit the number of participants we load on groups when we load from the local group data
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llspeakers.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 05df7261e1..301b489c34 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -409,12 +409,10 @@ void LLSpeakerMgr::update(BOOL resort_ok) // update status of all current speakers BOOL voice_channel_active = (!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()); - for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end();) + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); speaker_it++) { LLUUID speaker_id = speaker_it->first; LLSpeaker* speakerp = speaker_it->second; - - speaker_map_t::iterator cur_speaker_it = speaker_it++; if (voice_channel_active && LLVoiceClient::getInstance()->getVoiceEnabled(speaker_id)) { @@ -551,18 +549,25 @@ void LLSpeakerMgr::updateSpeakerList() { // Add group members when we get the complete list (note: can take a while before we get that list) LLGroupMgrGroupData::member_list_t::iterator member_it = gdatap->mMembers.begin(); + S32 updated = 0; while (member_it != gdatap->mMembers.end()) { LLGroupMemberData* member = member_it->second; - // Add only the members who are online - if (member->getOnlineStatus() == "Online") + LLUUID id = member_it->first; + // Add only members who are online and not already in the list + if ((member->getOnlineStatus() == "Online") && (mSpeakers.find(id) == mSpeakers.end())) { - LLPointer<LLSpeaker> speakerp = setSpeaker(member_it->first, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + LLPointer<LLSpeaker> speakerp = setSpeaker(id, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); speakerp->mIsModerator = ((member->getAgentPowers() & GP_SESSION_MODERATOR) == GP_SESSION_MODERATOR); + updated++; } ++member_it; + // Limit the number of "manually updated" participants to a reasonable number to avoid severe fps drop + // *TODO : solve the perf issue of having several hundreds of widgets in the conversation list + if (updated >= 100) + break; } - mSpeakerListUpdated = true; + mSpeakerListUpdated = true; } } else if (mSpeakers.size() == 0) |