Refactor some old code for minor performance improvements because why not? :)
parent
806b4b1f9d
commit
f7cdf00583
|
|
@ -586,8 +586,9 @@ void LLFloaterWorldMap::reshape( S32 width, S32 height, bool called_from_parent
|
||||||
void LLFloaterWorldMap::draw()
|
void LLFloaterWorldMap::draw()
|
||||||
{
|
{
|
||||||
// <FS:Ansariel> Performance improvement
|
// <FS:Ansariel> Performance improvement
|
||||||
static LLView* show_destination_btn = getChildView("Show Destination");
|
static LLView* show_destination_btn = getChildView("Show Destination");
|
||||||
static LLUICtrl* zoom_slider = getChild<LLUICtrl>("zoom slider");
|
static LLUICtrl* zoom_slider = getChild<LLUICtrl>("zoom slider");
|
||||||
|
static LLButton* track_region_btn = getChild<LLButton>("track_region");
|
||||||
// </FS:Ansariel> Performance improvement
|
// </FS:Ansariel> Performance improvement
|
||||||
|
|
||||||
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
|
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
|
||||||
|
|
@ -663,7 +664,7 @@ void LLFloaterWorldMap::draw()
|
||||||
mGoHomeButton->setEnabled((!rlv_handler_t::isEnabled()) || !(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)));
|
mGoHomeButton->setEnabled((!rlv_handler_t::isEnabled()) || !(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)));
|
||||||
// </FS:Ansariel> Performance improvement
|
// </FS:Ansariel> Performance improvement
|
||||||
// <FS:Ansariel> Alchemy region tracker
|
// <FS:Ansariel> Alchemy region tracker
|
||||||
getChild<LLButton>("track_region")->setEnabled((bool) tracking_status || LLWorldMap::getInstance()->isTracking());
|
track_region_btn->setEnabled((bool) tracking_status || LLWorldMap::getInstance()->isTracking());
|
||||||
|
|
||||||
setMouseOpaque(true);
|
setMouseOpaque(true);
|
||||||
getDragHandle()->setMouseOpaque(true);
|
getDragHandle()->setMouseOpaque(true);
|
||||||
|
|
@ -1224,13 +1225,13 @@ void LLFloaterWorldMap::buildAvatarIDList()
|
||||||
//}
|
//}
|
||||||
|
|
||||||
std::multimap<std::string, LLUUID> buddymap;
|
std::multimap<std::string, LLUUID> buddymap;
|
||||||
for(; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
{
|
{
|
||||||
buddymap.insert(std::make_pair((*it).second, (*it).first));
|
buddymap.emplace(it->second, it->first);
|
||||||
}
|
}
|
||||||
for (std::multimap<std::string, LLUUID>::iterator bit = buddymap.begin(); bit != buddymap.end(); ++bit)
|
for (const auto& [name, id] : buddymap)
|
||||||
{
|
{
|
||||||
mFriendCombo->addSimpleElement((*bit).first, ADD_BOTTOM, (*bit).second);
|
mFriendCombo->addSimpleElement(name, ADD_BOTTOM, id);
|
||||||
}
|
}
|
||||||
// </FS:Ansariel>
|
// </FS:Ansariel>
|
||||||
|
|
||||||
|
|
@ -1285,11 +1286,11 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
|
||||||
// <FS:Ansariel> Filter duplicate landmarks on world map
|
// <FS:Ansariel> Filter duplicate landmarks on world map
|
||||||
if (filterLandmarks)
|
if (filterLandmarks)
|
||||||
{
|
{
|
||||||
if (used_landmarks.find(item->getAssetUUID()) != used_landmarks.end())
|
if (used_landmarks.contains(item->getAssetUUID()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
used_landmarks.insert(item->getAssetUUID());
|
used_landmarks.emplace(item->getAssetUUID());
|
||||||
}
|
}
|
||||||
// </FS:Ansariel>
|
// </FS:Ansariel>
|
||||||
|
|
||||||
|
|
@ -1936,7 +1937,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
|
||||||
|
|
||||||
if (num_results > 0)
|
if (num_results > 0)
|
||||||
{
|
{
|
||||||
// Ansariel: Let's sort the list to make it more user-friendly
|
// <FS:Ansariel> Let's sort the list to make it more user-friendly
|
||||||
mSearchResults->sortByColumn("sim_name", true);
|
mSearchResults->sortByColumn("sim_name", true);
|
||||||
|
|
||||||
// if match found, highlight it and go
|
// if match found, highlight it and go
|
||||||
|
|
|
||||||
|
|
@ -318,12 +318,12 @@ void LLNetMap::draw()
|
||||||
}
|
}
|
||||||
// </FS:Ansariel>: Synchronize netmap scale throughout instances
|
// </FS:Ansariel>: Synchronize netmap scale throughout instances
|
||||||
|
|
||||||
// <FS:Ansariel> Aurora Sim
|
// <FS:Ansariel> Aurora Sim
|
||||||
if (!LLWorld::getInstance()->getAllowMinimap())
|
if (!LLWorld::getInstance()->getAllowMinimap())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// <FS:Ansariel> Aurora Sim
|
// <FS:Ansariel> Aurora Sim
|
||||||
|
|
||||||
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
|
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
|
||||||
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
|
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
|
||||||
|
|
@ -699,7 +699,9 @@ void LLNetMap::draw()
|
||||||
// Draw avatars
|
// Draw avatars
|
||||||
for (U32 i = 0; i < avatar_ids.size(); i++)
|
for (U32 i = 0; i < avatar_ids.size(); i++)
|
||||||
{
|
{
|
||||||
LLUUID uuid = avatar_ids[i];
|
// <FS:Ansariel> Performance improvement
|
||||||
|
//LLUUID uuid = avatar_ids[i];
|
||||||
|
const LLUUID& uuid = avatar_ids.at(i);
|
||||||
// Skip self, we'll draw it later
|
// Skip self, we'll draw it later
|
||||||
if (uuid == gAgent.getID()) continue;
|
if (uuid == gAgent.getID()) continue;
|
||||||
|
|
||||||
|
|
@ -872,8 +874,8 @@ void LLNetMap::draw()
|
||||||
F32 ctr_x = (F32)center_sw_left;
|
F32 ctr_x = (F32)center_sw_left;
|
||||||
F32 ctr_y = (F32)center_sw_bottom;
|
F32 ctr_y = (F32)center_sw_bottom;
|
||||||
|
|
||||||
const F32 steps_per_circle = 40.0f;
|
constexpr F32 steps_per_circle = 40.0f;
|
||||||
const F32 steps_per_radian = steps_per_circle / F_TWO_PI;
|
constexpr F32 steps_per_radian = steps_per_circle / F_TWO_PI;
|
||||||
const F32 arc_start = -(horiz_fov / 2.0f) + F_PI_BY_TWO;
|
const F32 arc_start = -(horiz_fov / 2.0f) + F_PI_BY_TWO;
|
||||||
const F32 arc_end = (horiz_fov / 2.0f) + F_PI_BY_TWO;
|
const F32 arc_end = (horiz_fov / 2.0f) + F_PI_BY_TWO;
|
||||||
const S32 steps = llmax(1, (S32)((horiz_fov * steps_per_radian) + 0.5f));
|
const S32 steps = llmax(1, (S32)((horiz_fov * steps_per_radian) + 0.5f));
|
||||||
|
|
@ -1958,8 +1960,7 @@ void LLNetMap::handleClearMarks()
|
||||||
// static
|
// static
|
||||||
bool LLNetMap::getAvatarMarkColor(const LLUUID& avatar_id, LLColor4& color)
|
bool LLNetMap::getAvatarMarkColor(const LLUUID& avatar_id, LLColor4& color)
|
||||||
{
|
{
|
||||||
avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id);
|
if (auto found = sAvatarMarksMap.find(avatar_id); found != sAvatarMarksMap.end())
|
||||||
if (found != sAvatarMarksMap.end())
|
|
||||||
{
|
{
|
||||||
color = found->second;
|
color = found->second;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -2025,8 +2026,7 @@ LLColor4 LLNetMap::getAvatarColor(const LLUUID& avatar_id)
|
||||||
cs_instance.hasFriendColorThatShouldShow(avatar_id, ContactSetType::MINIMAP, color);
|
cs_instance.hasFriendColorThatShouldShow(avatar_id, ContactSetType::MINIMAP, color);
|
||||||
|
|
||||||
// Mark Avatars with special colors
|
// Mark Avatars with special colors
|
||||||
avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id);
|
if (auto found = sAvatarMarksMap.find(avatar_id); found != sAvatarMarksMap.end())
|
||||||
if (found != sAvatarMarksMap.end())
|
|
||||||
{
|
{
|
||||||
color = found->second;
|
color = found->second;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue