summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-08-08 15:41:28 -0700
committerRider Linden <rider@lindenlab.com>2018-08-08 15:41:28 -0700
commit881ee670d92f13ac518a74e1bff81bf69e07ccfa (patch)
tree23d96163b2aac869bd6ec64b32b8f1fc79d0c7dd /indra
parent51abc168c03f80d63c85d4bb48624f440b585390 (diff)
Fix for mac build
MAINT-8870, MAINT-8871: When legacy windlight fails load the default day cycle asset and use that.
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp4
-rw-r--r--indra/newview/llenvironment.cpp23
-rw-r--r--indra/newview/llenvironment.h3
-rw-r--r--indra/newview/llwlhandlers.cpp7
4 files changed, 25 insertions, 12 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 320e090bfd..84ef145913 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -304,8 +304,8 @@ bool LLSettingsDay::initialize(bool validate_frames)
iter = mDayTracks[i].begin();
}
- if ((iter->first >= (new_frame - DEFAULT_MULTISLIDER_INCREMENT) && (new_frame + DEFAULT_FRAME_SLOP_FACTOR) >= iter->first)
- || iter->first < new_frame && (new_frame + DEFAULT_FRAME_SLOP_FACTOR) >= (iter->first + 1))
+ if (((iter->first >= (new_frame - DEFAULT_MULTISLIDER_INCREMENT)) && ((new_frame + DEFAULT_FRAME_SLOP_FACTOR) >= iter->first))
+ || ((iter->first < new_frame) && ((new_frame + DEFAULT_FRAME_SLOP_FACTOR) >= (iter->first + 1))))
{
// we are encroaching at new point as well
found = iter->first;
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 8f6a94962f..b2bd20d809 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -423,13 +423,17 @@ void LLEnvironment::onLegacyRegionSettings(LLSD data)
LLUUID regionId = data[0]["regionID"].asUUID();
LLSettingsDay::ptr_t regionday;
- if (data[1].isUndefined())
- regionday = LLSettingsVODay::buildDefaultDayCycle();
- else
+ if (!data[1].isUndefined())
regionday = LLSettingsVODay::buildFromLegacyMessage(regionId, data[1], data[2], data[3]);
clearEnvironment(ENV_PARCEL);
- setEnvironment(ENV_REGION, regionday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET);
+ if (!regionday)
+ {
+ LL_WARNS("ENVIRONMENT") << "Unable to create day from legacy. Using default day cycle." << LL_ENDL;
+ setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET);
+ }
+ else
+ setEnvironment(ENV_REGION, regionday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET);
updateEnvironment();
}
@@ -570,12 +574,17 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe
void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId)
{
- LLSettingsVOBase::getSettingsAsset(assetId,
- [this, env](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onSetEnvAssetLoaded(env, asset_id, settings, status); });
+ setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET);
+}
+
+void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset)
+{
+ LLSettingsVOBase::getSettingsAsset(assetId,
+ [this, env, daylength, dayoffset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, status); });
}
-void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status)
+void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 status)
{
if (!settings || status)
{
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 80d186c9e6..eba1b737c8 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -172,6 +172,7 @@ public:
void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t())); }
void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed)); }
void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw)); }
+ void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset);
void setEnvironment(EnvSelection_t env, const LLUUID &assetId);
void clearEnvironment(EnvSelection_t env);
@@ -368,7 +369,7 @@ private:
void onAgentPositionHasChanged(const LLVector3 &localpos);
- void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status);
+ void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 status);
void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset);
};
diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp
index 6aa379e0de..f0453b4d6d 100644
--- a/indra/newview/llwlhandlers.cpp
+++ b/indra/newview/llwlhandlers.cpp
@@ -80,6 +80,9 @@ bool LLEnvironmentRequest::doRequest()
{
LL_INFOS("WindlightCaps") << "Skipping windlight setting request - we don't have this capability" << LL_ENDL;
// region is apparently not capable of this; don't respond at all
+ // (there shouldn't be any regions where this is the case... but
+ LL_INFOS("ENVIRONMENT") << "No legacy windlight caps... just set the region to be the default day." << LL_ENDL;
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId());
return false;
}
@@ -117,8 +120,8 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url)
if (!status)
{
LL_WARNS("WindlightCaps") << "Got an error, not using region windlight... " << LL_ENDL;
- LLEnvironment::instance().onLegacyRegionSettings(LLSD());
-
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId());
+
return;
}
result = result["content"];