summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llsettingsbase.cpp11
-rw-r--r--indra/llinventory/llsettingsbase.h12
-rw-r--r--indra/llinventory/llsettingssky.cpp24
-rw-r--r--indra/llinventory/llsettingssky.h35
-rw-r--r--indra/llinventory/llsettingswater.cpp8
-rw-r--r--indra/llinventory/llsettingswater.h9
-rw-r--r--indra/newview/llvosky.cpp44
7 files changed, 129 insertions, 14 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index abe1a1a04a..f2dfeaf154 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -58,14 +58,16 @@ const F64Seconds LLSettingsBlender::DEFAULT_THRESHOLD(0.01);
LLSettingsBase::LLSettingsBase():
mSettings(LLSD::emptyMap()),
mDirty(true),
- mAssetID()
+ mAssetID(),
+ mBlendedFactor(0.0)
{
}
LLSettingsBase::LLSettingsBase(const LLSD setting) :
mSettings(setting),
mDirty(true),
- mAssetID()
+ mAssetID(),
+ mBlendedFactor(0.0)
{
}
@@ -224,9 +226,12 @@ LLSD LLSettingsBase::interpolateSDMap(const LLSD &settings, const LLSD &other, F
break;
+ case LLSD::TypeUUID:
+ newSettings[key_name] = value.asUUID();
+ break;
+
// case LLSD::TypeBoolean:
// case LLSD::TypeString:
-// case LLSD::TypeUUID:
// case LLSD::TypeURI:
// case LLSD::TypeBinary:
// case LLSD::TypeDate:
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 62a88cde73..2220cca336 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -96,6 +96,7 @@ public:
inline void replaceSettings(LLSD settings)
{
mSettings = settings;
+ mBlendedFactor = 0.0;
setDirtyFlag(true);
}
@@ -146,6 +147,11 @@ public:
setValue(name, value.getValue());
}
+ inline F64 getBlendFactor() const
+ {
+ return mBlendedFactor;
+ }
+
// Note this method is marked const but may modify the settings object.
// (note the internal const cast). This is so that it may be called without
// special consideration from getters.
@@ -237,11 +243,17 @@ protected:
LLSD cloneSettings() const;
+ inline void setBlendFactor(F64 blendfactor)
+ {
+ mBlendedFactor = blendfactor;
+ }
+
private:
bool mDirty;
LLSD combineSDMaps(const LLSD &first, const LLSD &other) const;
+ F64 mBlendedFactor;
};
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 7da3a336cc..45c1ca1d7f 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -106,6 +106,10 @@ const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR("exp_s
const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM("linear_term");
const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM("constant_term");
+const LLUUID LLSettingsSky::DEFAULT_SUN_ID("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver
+const LLUUID LLSettingsSky::DEFAULT_MOON_ID("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
+const LLUUID LLSettingsSky::DEFAULT_CLOUD_ID("1dc1368f-e8fe-f02d-a08d-9d9f11c1af6b");
+
namespace
{
@@ -310,12 +314,18 @@ bool validateMieLayers(LLSD &value)
//=========================================================================
LLSettingsSky::LLSettingsSky(const LLSD &data) :
- LLSettingsBase(data)
+ LLSettingsBase(data),
+ mNextSunTextureId(),
+ mNextMoonTextureId(),
+ mNextCloudTextureId()
{
}
LLSettingsSky::LLSettingsSky():
- LLSettingsBase()
+ LLSettingsBase(),
+ mNextSunTextureId(),
+ mNextMoonTextureId(),
+ mNextCloudTextureId()
{
}
@@ -325,6 +335,10 @@ void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf);
replaceSettings(blenddata);
+ setBlendFactor(blendf);
+ mNextSunTextureId = other->getSunTextureId();
+ mNextMoonTextureId = other->getMoonTextureId();
+ mNextCloudTextureId = other->getCloudNoiseTextureId();
}
@@ -557,9 +571,9 @@ LLSD LLSettingsSky::defaults()
dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue();
dfltsetting[SETTING_BLOOM_TEXTUREID] = IMG_BLOOM1;
- dfltsetting[SETTING_CLOUD_TEXTUREID] = LLUUID::null;
- dfltsetting[SETTING_MOON_TEXTUREID] = IMG_MOON; // gMoonTextureID; // These two are returned by the login... wow!
- dfltsetting[SETTING_SUN_TEXTUREID] = IMG_SUN; // gSunTextureID;
+ dfltsetting[SETTING_CLOUD_TEXTUREID] = DEFAULT_CLOUD_ID;
+ dfltsetting[SETTING_MOON_TEXTUREID] = DEFAULT_MOON_ID; // gMoonTextureID; // These two are returned by the login... wow!
+ dfltsetting[SETTING_SUN_TEXTUREID] = DEFAULT_SUN_ID; // gSunTextureID;
dfltsetting[SETTING_TYPE] = "sky";
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index 1451162744..59a9dc9a43 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -79,6 +79,10 @@ public:
static const std::string SETTING_DENSITY_PROFILE_CONSTANT_TERM;
static const std::string SETTING_MIE_ANISOTROPY_FACTOR;
+ static const LLUUID DEFAULT_SUN_ID;
+ static const LLUUID DEFAULT_MOON_ID;
+ static const LLUUID DEFAULT_CLOUD_ID;
+
typedef std::shared_ptr<LLSettingsSky> ptr_t;
typedef std::pair<F32, F32> azimalt_t;
@@ -449,10 +453,31 @@ public:
return mTotalAmbient;
}
- virtual validation_list_t getValidationList() const override;
- static validation_list_t validationList();
+ //=====================================================================
+ virtual void loadTextures() { };
+
+ //=====================================================================
+ virtual validation_list_t getValidationList() const override;
+ static validation_list_t validationList();
+
+ static LLSD translateLegacySettings(LLSD legacy);
+
+ //=====================================================================
+ // transient properties used in animations.
+ LLUUID getNextSunTextureId() const
+ {
+ return mNextSunTextureId;
+ }
+
+ LLUUID getNextMoonTextureId() const
+ {
+ return mNextMoonTextureId;
+ }
- static LLSD translateLegacySettings(LLSD legacy);
+ LLUUID getNextCloudNoiseTextureId() const
+ {
+ return mNextCloudTextureId;
+ }
protected:
static const std::string SETTING_LEGACY_EAST_ANGLE;
@@ -492,6 +517,10 @@ private:
LLColor4 mTotalAmbient;
+ LLUUID mNextSunTextureId;
+ LLUUID mNextMoonTextureId;
+ LLUUID mNextCloudTextureId;
+
typedef std::map<std::string, S32> mapNameToUniformId_t;
static mapNameToUniformId_t sNameToUniformMapping;
diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp
index a72cbc4136..c6798945a3 100644
--- a/indra/llinventory/llsettingswater.cpp
+++ b/indra/llinventory/llsettingswater.cpp
@@ -72,12 +72,14 @@ const LLUUID LLSettingsWater::DEFAULT_WATER_NORMAL_ID(DEFAULT_WATER_NORMAL);
//=========================================================================
LLSettingsWater::LLSettingsWater(const LLSD &data) :
- LLSettingsBase(data)
+ LLSettingsBase(data),
+ mNextNormalMapID()
{
}
LLSettingsWater::LLSettingsWater() :
- LLSettingsBase()
+ LLSettingsBase(),
+ mNextNormalMapID()
{
}
@@ -167,6 +169,8 @@ void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf);
replaceSettings(blenddata);
+ setBlendFactor(blendf);
+ mNextNormalMapID = other->getNormalMapID();
}
LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const
diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h
index 92190fa7b1..64de4486ca 100644
--- a/indra/llinventory/llsettingswater.h
+++ b/indra/llinventory/llsettingswater.h
@@ -199,6 +199,13 @@ public:
return mWaterFogKS;
}
+ //-------------------------------------------
+ LLUUID getNextNormalMapID() const
+ {
+ return mNextNormalMapID;
+ }
+
+
virtual validation_list_t getValidationList() const override;
static validation_list_t validationList();
@@ -224,7 +231,7 @@ protected:
F32 mWaterFogKS;
private:
-
+ LLUUID mNextNormalMapID;
};
#endif
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 61500aebfe..9ba6aeb37f 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -2105,6 +2105,50 @@ void LLVOSky::setSunDirection(const LLVector3 &sun_dir, const LLVector3 &moon_di
}
}
+// void LLVOSky::checkAndLoadSkyTextures(LLDrawPoolWLSky *pskypool)
+// {
+// LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
+//
+// if (mMoonCurrentId != psky->getMoonTextureId())
+// {
+// mMoonCurrentId = psky->getMoonTextureId();
+// if (mMoonCurrentId.isNull())
+// {
+// mMoonTexturep = NULL;
+// mMoon.setDraw(FALSE);
+// }
+// else
+// {
+// mMoonTexturep = LLViewerTextureManager::getFetchedTexture(mMoonCurrentId, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
+// if (mMoonTexturep)
+// {
+// mMoonTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
+// }
+// mMoon.setDraw(TRUE);
+// }
+// mFace[FACE_MOON] = mDrawable->addFace(pskypool, mMoonTexturep);
+// }
+//
+// if (mSunCurrentId != psky->getSunTextureId())
+// {
+// mSunCurrentId = psky->getSunTextureId();
+// if (mSunCurrentId.isNull())
+// {
+// mSunTexturep = NULL;
+// mSun.setDraw(FALSE);
+// }
+// else
+// {
+// mSunTexturep = LLViewerTextureManager::getFetchedTexture(mSunCurrentId, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
+// if (mSunTexturep)
+// {
+// mSunTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
+// }
+// mSun.setDraw(TRUE);
+// }
+// mFace[FACE_SUN] = mDrawable->addFace(pskypool, mSunTexturep);
+// }
+// }
LLColor4U LLVOSky::getFadeColor() const
{