MAINT-6649 PRIM_TEXT/llSetText upper draw distance limit

meow-7.2.2
Mnikolenko Productengine 2016-08-19 11:58:32 +03:00
parent e8b23bbfff
commit 8db7540908
2 changed files with 26 additions and 2 deletions

View File

@ -7940,6 +7940,17 @@
<key>Value</key>
<integer>100000</integer>
</map>
<key>PrimTextMaxDrawDistance</key>
<map>
<key>Comment</key>
<string>Maximum draw distance beyond which PRIM_TEXT won't be rendered</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>64.0</real>
</map>
<key>ProbeHardwareOnStartup</key>
<map>
<key>Comment</key>

View File

@ -53,7 +53,7 @@ const F32 VERTICAL_PADDING = 12.f;
const F32 BUFFER_SIZE = 2.f;
const F32 HUD_TEXT_MAX_WIDTH = 190.f;
const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f;
const F32 MAX_DRAW_DISTANCE = 64.f;
const F32 MAX_DRAW_DISTANCE = 300.f;
std::set<LLPointer<LLHUDText> > LLHUDText::sTextObjects;
std::vector<LLPointer<LLHUDText> > LLHUDText::sVisibleTextObjects;
@ -394,7 +394,20 @@ void LLHUDText::updateVisibility()
LLVector3 pos_agent_center = gAgent.getPosAgentFromGlobal(mPositionGlobal) - dir_from_camera;
F32 last_distance_center = (pos_agent_center - LLViewerCamera::getInstance()->getOrigin()).magVec();
if(last_distance_center > MAX_DRAW_DISTANCE)
F32 max_draw_distance = gSavedSettings.getF32("PrimTextMaxDrawDistance");
if(max_draw_distance < 0)
{
max_draw_distance = 0;
gSavedSettings.setF32("PrimTextMaxDrawDistance", max_draw_distance);
}
else if(max_draw_distance > MAX_DRAW_DISTANCE)
{
max_draw_distance = MAX_DRAW_DISTANCE;
gSavedSettings.setF32("PrimTextMaxDrawDistance", MAX_DRAW_DISTANCE);
}
if(last_distance_center > max_draw_distance)
{
mVisible = FALSE;
return;