summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-09-04 23:08:20 +0100
committerGraham Linden <graham@lindenlab.com>2018-09-04 23:08:20 +0100
commit2e55eae9cc6ebff303c8f322c71fec9c20e42bd8 (patch)
treeea4259bc673bbac6715cc0269a4cc6de3c8a9958 /indra/newview/llvosky.cpp
parentd1d248973d577d314bba16dc9f2977a7125b5f0d (diff)
Merge and fix MAINT-9087 and MAINT-9084
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r--indra/newview/llvosky.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 81632796e4..d3b1f1459f 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -59,6 +59,8 @@
#undef min
#undef max
+#pragma optimize("", off)
+
namespace
{
const S32 NUM_TILES_X = 8;
@@ -376,6 +378,9 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
mbCanSelect = FALSE;
mUpdateTimer.reset();
+ mForceUpdateThrottle.setTimerExpirySec(UPDATE_EXPRY);
+ mForceUpdateThrottle.reset();
+
for (S32 i = 0; i < 6; i++)
{
mSkyTex[i].init();
@@ -585,8 +590,7 @@ void LLVOSky::idleUpdate(LLAgent &agent, const F64 &time)
}
bool LLVOSky::updateSky()
-{
- LLTimer forceupdThrottle;
+{
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
LLColor4 total_ambient = psky->getTotalAmbient();
@@ -640,15 +644,29 @@ bool LLVOSky::updateSky()
bool light_direction_changed = (dot_lighting < LIGHT_DIRECTION_THRESHOLD);
bool color_changed = (delta_color.length() >= COLOR_CHANGE_THRESHOLD);
- mForceUpdate = mForceUpdate || light_direction_changed;
- mForceUpdate = mForceUpdate || color_changed;
- mForceUpdate = mForceUpdate || !mInitialized;
+ if (light_direction_changed)
+ {
+ mForceUpdate = true;
+ }
+
+ if (color_changed)
+ {
+ mForceUpdate = true;
+ }
+
+ if (!mInitialized)
+ {
+ mForceUpdate = true;
+ }
+ //mForceUpdate = mForceUpdate || light_direction_changed;
+ //mForceUpdate = mForceUpdate || color_changed;
+ //mForceUpdate = mForceUpdate || !mInitialized;
- if (mForceUpdate && forceupdThrottle.hasExpired())
+ if (mForceUpdate && mForceUpdateThrottle.hasExpired())
{
LL_RECORD_BLOCK_TIME(FTM_VOSKY_UPDATEFORCED);
- forceupdThrottle.setTimerExpirySec(UPDATE_EXPRY);
+ mForceUpdateThrottle.setTimerExpirySec(UPDATE_EXPRY);
LLSkyTex::stepCurrent();