Commit d101f0a7 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Cache some settings

parent 15795223
...@@ -1760,7 +1760,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) ...@@ -1760,7 +1760,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1));
stop_tick = llmin(max_ticks1, num_ticks_per_side1); stop_tick = llmin(max_ticks1, num_ticks_per_side1);
F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); static const LLCachedControl<F32> grid_resolution_setting(gSavedSettings, "GridResolution");
F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax((F32)grid_resolution_setting, 0.001f);
S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1);
S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2);
...@@ -1787,7 +1788,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) ...@@ -1787,7 +1788,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
F32 tick_value; F32 tick_value;
if (grid_mode == GRID_MODE_WORLD) if (grid_mode == GRID_MODE_WORLD)
{ {
tick_value = (grid_multiple1 + i) / (sGridMaxSubdivisionLevel / grid_resolution); tick_value = (grid_multiple1 + i) / (sGridMaxSubdivisionLevel / (F32)grid_resolution);
} }
else else
{ {
...@@ -1834,7 +1835,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) ...@@ -1834,7 +1835,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
F32 tick_value; F32 tick_value;
if (grid_mode == GRID_MODE_WORLD) if (grid_mode == GRID_MODE_WORLD)
{ {
tick_value = (grid_multiple2 + i) / (sGridMaxSubdivisionLevel / grid_resolution); tick_value = (grid_multiple2 + i) / (sGridMaxSubdivisionLevel / (F32)grid_resolution);
} }
else else
{ {
......
...@@ -930,7 +930,8 @@ static bool needs_tooltip(LLSelectNode* nodep) ...@@ -930,7 +930,8 @@ static bool needs_tooltip(LLSelectNode* nodep)
BOOL LLToolPie::handleTooltipLand(std::string line, std::string tooltip_msg) BOOL LLToolPie::handleTooltipLand(std::string line, std::string tooltip_msg)
{ {
// Do not show hover for land unless prefs are set to allow it. // Do not show hover for land unless prefs are set to allow it.
if (!gSavedSettings.getBOOL("ShowLandHoverTip")) return TRUE; static LLCachedControl<bool> show_land_hovetips(gSavedSettings, "ShowLandHoverTip");
if (!show_land_hovetips) return TRUE;
LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal ); LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal );
......
...@@ -1782,7 +1782,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) ...@@ -1782,7 +1782,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
static LLUIColor physical_object_color(LLUIColorTable::instance().getColor("NetMapPhysicalObject")); static LLUIColor physical_object_color(LLUIColorTable::instance().getColor("NetMapPhysicalObject"));
static LLUIColor temp_object_color(LLUIColorTable::instance().getColor("NetMapTempObject")); static LLUIColor temp_object_color(LLUIColorTable::instance().getColor("NetMapTempObject"));
static LLCachedControl<F32> max_radius(gSavedSettings, "MiniMapPrimMaxRadius"); static const LLCachedControl<F32> max_radius(gSavedSettings, "MiniMapPrimMaxRadius");
const vobj_list_t::const_iterator end_it = mMapObjects.cend(); const vobj_list_t::const_iterator end_it = mMapObjects.cend();
for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != end_it; ++iter) for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != end_it; ++iter)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment