summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llinventory/llsettingsbase.cpp38
-rw-r--r--indra/llinventory/llsettingsbase.h48
-rw-r--r--indra/llinventory/llsettingssky.cpp7
-rw-r--r--indra/llrender/llglslshader.cpp10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsF.glsl23
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl4
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp4
-rw-r--r--indra/newview/llenvironment.cpp7
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp9
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp9
-rw-r--r--indra/newview/llflyoutcombobtn.cpp36
-rw-r--r--indra/newview/llflyoutcombobtn.h8
-rw-r--r--indra/newview/llsettingsvo.cpp89
-rw-r--r--indra/newview/llviewershadermgr.cpp2
-rw-r--r--indra/newview/llvosky.cpp32
-rw-r--r--indra/newview/llvosky.h2
-rw-r--r--indra/newview/llvowlsky.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_save_settings.xml54
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml2
20 files changed, 288 insertions, 109 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index 938f614fc9..5283a8dc8a 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -54,6 +54,10 @@ const std::string LLSettingsBase::SETTING_NAME("name");
const std::string LLSettingsBase::SETTING_HASH("hash");
const std::string LLSettingsBase::SETTING_TYPE("type");
const std::string LLSettingsBase::SETTING_ASSETID("asset_id");
+const std::string LLSettingsBase::SETTING_FLAGS("flags");
+
+const U32 LLSettingsBase::FLAG_NOCOPY(0x01 << 0);
+const U32 LLSettingsBase::FLAG_NOMOD(0x01 << 1);
//=========================================================================
LLSettingsBase::LLSettingsBase():
@@ -239,13 +243,23 @@ LLSD LLSettingsBase::interpolateSDMap(const LLSD &settings, const LLSD &other, F
// case LLSD::TypeBinary:
// case LLSD::TypeDate:
default:
- /* TODO: If the UUID points to an image ID, blend the images. */
// atomic or unknown data types. Lerping between them does not make sense so switch at the break.
newSettings[key_name] = (mix > BREAK_POINT) ? other_value : value;
break;
}
}
+ // Special handling cases
+ // Flags
+ if (settings.has(SETTING_FLAGS))
+ {
+ U32 flags = (U32)settings[SETTING_FLAGS].asInteger();
+ if (other.has(SETTING_FLAGS))
+ flags |= (U32)other[SETTING_FLAGS].asInteger();
+
+ newSettings[SETTING_FLAGS] = LLSD::Integer(flags);
+ }
+
// Now add anything that is in other but not in the settings
for (LLSD::map_const_iterator it = other.beginMap(); it != other.endMap(); ++it)
{
@@ -262,6 +276,19 @@ LLSD LLSettingsBase::interpolateSDMap(const LLSD &settings, const LLSD &other, F
return newSettings;
}
+LLSettingsBase::stringset_t LLSettingsBase::getSkipInterpolateKeys() const
+{
+ static stringset_t skipSet;
+
+ if (skipSet.empty())
+ {
+ skipSet.insert(SETTING_FLAGS);
+ skipSet.insert(SETTING_HASH);
+ }
+
+ return skipSet;
+}
+
LLSD LLSettingsBase::getSettings() const
{
return mSettings;
@@ -311,6 +338,7 @@ LLSD LLSettingsBase::settingValidation(LLSD &settings, validation_list_t &valida
static Validator validateHash(SETTING_HASH, false, LLSD::TypeInteger);
static Validator validateType(SETTING_TYPE, false, LLSD::TypeString);
static Validator validateAssetId(SETTING_ASSETID, false, LLSD::TypeUUID);
+ static Validator validateFlags(SETTING_FLAGS, false, LLSD::TypeInteger);
stringset_t validated;
stringset_t strip;
bool isValid(true);
@@ -353,6 +381,13 @@ LLSD LLSettingsBase::settingValidation(LLSD &settings, validation_list_t &valida
}
validated.insert(validateType.getName());
+ if (!validateFlags.verify(settings))
+ {
+ errors.append(LLSD::String("Unable to validate 'flags'."));
+ isValid = false;
+ }
+ validated.insert(validateFlags.getName());
+
// Fields for specific settings.
for (validation_list_t::iterator itv = validations.begin(); itv != validations.end(); ++itv)
{
@@ -415,7 +450,6 @@ bool LLSettingsBase::Validator::verify(LLSD &data)
{
if (!mDefault.isUndefined())
{
- LL_INFOS("SETTINGS") << "Inserting missing default for '" << mName << "'." << LL_ENDL;
data[mName] = mDefault;
return true;
}
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 7884240ae3..a90cec6323 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -70,6 +70,10 @@ public:
static const std::string SETTING_HASH;
static const std::string SETTING_TYPE;
static const std::string SETTING_ASSETID;
+ static const std::string SETTING_FLAGS;
+
+ static const U32 FLAG_NOCOPY;
+ static const U32 FLAG_NOMOD;
typedef std::map<std::string, S32> parammapping_t;
@@ -113,6 +117,48 @@ public:
return LLUUID();
}
+ inline U32 getFlags() const
+ {
+ if (mSettings.has(SETTING_FLAGS))
+ return static_cast<U32>(mSettings[SETTING_FLAGS].asInteger());
+ return 0;
+ }
+
+ inline void setFlags(U32 value)
+ {
+ setLLSD(SETTING_FLAGS, LLSD::Integer(value));
+ }
+
+ inline bool getFlag(U32 flag) const
+ {
+ if (mSettings.has(SETTING_FLAGS))
+ return ((U32)mSettings[SETTING_FLAGS].asInteger() & flag) == flag;
+ return false;
+ }
+
+ inline void setFlag(U32 flag)
+ {
+ U32 flags((mSettings.has(SETTING_FLAGS)) ? (U32)mSettings[SETTING_FLAGS].asInteger() : 0);
+
+ flags |= flag;
+
+ if (flags)
+ mSettings[SETTING_FLAGS] = LLSD::Integer(flags);
+ else
+ mSettings.erase(SETTING_FLAGS);
+ }
+
+ inline void clearFlag(U32 flag)
+ {
+ U32 flags((mSettings.has(SETTING_FLAGS)) ? (U32)mSettings[SETTING_FLAGS].asInteger() : 0);
+
+ flags &= ~flag;
+
+ if (flags)
+ mSettings[SETTING_FLAGS] = LLSD::Integer(flags);
+ else
+ mSettings.erase(SETTING_FLAGS);
+ }
virtual void replaceSettings(LLSD settings)
{
@@ -270,7 +316,7 @@ protected:
/// when lerping between settings, some may require special handling.
/// Get a list of these key to be skipped by the default settings lerp.
/// (handling should be performed in the override of lerpSettings.
- virtual stringset_t getSkipInterpolateKeys() const { return stringset_t(); }
+ virtual stringset_t getSkipInterpolateKeys() const;
// A list of settings that represent quaternions and should be slerped
// rather than lerped.
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index cd6dfad71d..3b2e7de27d 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -32,8 +32,6 @@
#include "llfasttimer.h"
#include "v3colorutil.h"
-#pragma optimize("", off)
-
//=========================================================================
static const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees
static const F32 NIGHTTIME_ELEVATION_SIN = (F32)sinf(NIGHTTIME_ELEVATION * DEG_TO_RAD);
@@ -437,6 +435,7 @@ LLSettingsSky::stringset_t LLSettingsSky::getSkipInterpolateKeys() const
if (skipSet.empty())
{
+ skipSet = LLSettingsBase::getSkipInterpolateKeys();
skipSet.insert(SETTING_RAYLEIGH_CONFIG);
skipSet.insert(SETTING_MIE_CONFIG);
skipSet.insert(SETTING_ABSORPTION_CONFIG);
@@ -656,7 +655,7 @@ LLSD LLSettingsSky::defaults(const LLSettingsBase::TrackPosition& position)
dfltsetting[SETTING_MAX_Y] = LLSD::Real(1605);
dfltsetting[SETTING_MOON_ROTATION] = moonquat.getValue();
- dfltsetting[SETTING_STAR_BRIGHTNESS] = LLSD::Real(0.0000);
+ dfltsetting[SETTING_STAR_BRIGHTNESS] = LLSD::Real(256.0000);
dfltsetting[SETTING_SUNLIGHT_COLOR] = LLColor4(0.7342, 0.7815, 0.8999, 0.0).getValue();
dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue();
@@ -785,7 +784,7 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
}
if (legacy.has(SETTING_STAR_BRIGHTNESS))
{
- newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(legacy[SETTING_STAR_BRIGHTNESS].asReal());
+ newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(legacy[SETTING_STAR_BRIGHTNESS].asReal()) * 256.0f;
}
if (legacy.has(SETTING_SUNLIGHT_COLOR))
{
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 639033f143..c03d33080f 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -569,7 +569,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri
mAttribute[i] = index;
#endif
mAttributeMask |= 1 << i;
- LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
+ LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
}
}
if (attributes != NULL)
@@ -581,7 +581,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri
if (index != -1)
{
mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index;
- LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
+ LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
}
}
}
@@ -666,7 +666,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> *
mUniformNameMap[location] = name;
mUniformMap[hashedName] = location;
- LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL;
+ LL_DEBUGS("ShaderUniform") << "Uniform " << name << " is at location " << location << LL_ENDL;
//find the index of this uniform
for (S32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedUniforms.size(); i++)
@@ -714,7 +714,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
type == GL_SAMPLER_2D_MULTISAMPLE)
{ //this here is a texture
glUniform1iARB(location, mActiveTextureChannels);
- LL_DEBUGS("ShaderLoading") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
+ LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
return mActiveTextureChannels++;
}
return -1;
@@ -858,7 +858,7 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
unbind();
- LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
+ LL_DEBUGS("ShaderUniform") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
return res;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index d7f655709c..4ae3f7b76f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -26,19 +26,26 @@
/*[EXTRA_CODE_HERE]*/
#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
+out vec4 frag_data[3];
#else
-#define frag_color gl_FragColor
+#define frag_data gl_FragData
#endif
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
+VARYING vec2 screenpos;
uniform sampler2D diffuseMap;
uniform sampler2D altDiffuseMap;
uniform float blend_factor;
uniform float custom_alpha;
uniform vec4 sunlight_color;
+uniform float time;
+
+float twinkle(){
+ float d = fract(screenpos.x + screenpos.y);
+ return abs(d);
+}
void main()
{
@@ -46,6 +53,14 @@ void main()
vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy);
vec4 col = mix(col_b, col_a, blend_factor);
col.rgb *= vertex_color.rgb;
- col.a *= custom_alpha;
- frag_color = col;
+
+ float factor = smoothstep(0.0f, 0.9f, custom_alpha);
+
+ col.a = (col.a * factor) * 32.0f;
+ col.a *= twinkle();
+
+ frag_data[0] = col;
+ frag_data[1] = vec4(0.0f);
+ frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0);
}
+
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index 8bc5b06379..e14d02a4a9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -25,6 +25,7 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
+uniform float time;
ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
@@ -32,11 +33,14 @@ ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
+VARYING vec2 screenpos;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ float t = mod(time, 1.25f);
+ screenpos = position.xy * vec2(t, t);
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vertex_color = diffuse_color;
}
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 04f358ba79..8a2941e20a 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -44,8 +44,6 @@
#include "llenvironment.h"
#include "llatmosphere.h"
-#pragma optimize("", off)
-
static LLStaticHashedString sCamPosLocal("camPosLocal");
static LLStaticHashedString sCustomAlpha("custom_alpha");
@@ -54,6 +52,8 @@ static LLGLSLShader* sky_shader = NULL;
static LLGLSLShader* sun_shader = NULL;
static LLGLSLShader* moon_shader = NULL;
+static float sStarTime;
+
LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
LLDrawPool(POOL_WL_SKY)
{
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index ed25120241..3a1aec6319 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -444,11 +444,15 @@ F32 LLEnvironment::getWaterHeight() const
bool LLEnvironment::getIsSunUp() const
{
+ if (!mCurrentEnvironment || !mCurrentEnvironment->getSky())
+ return false;
return mCurrentEnvironment->getSky()->getIsSunUp();
}
bool LLEnvironment::getIsMoonUp() const
{
+ if (!mCurrentEnvironment || !mCurrentEnvironment->getSky())
+ return false;
return mCurrentEnvironment->getSky()->getIsMoonUp();
}
@@ -1628,14 +1632,13 @@ void LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky)
mSky->mReplaced |= different_sky;
mSky->update();
mBlenderSky.reset();
-/*
+
if (gAtmosphere)
{
AtmosphericModelSettings settings;
LLEnvironment::getAtmosphericModelSettings(settings, psky);
gAtmosphere->configureAtmosphericModel(settings);
}
-*/
}
void LLEnvironment::DayInstance::setWater(const LLSettingsWater::ptr_t &pwater)
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 9c3a48c412..ed60dd4303 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -173,7 +173,7 @@ BOOL LLFloaterEditExtDayCycle::postBuild()
mImportButton = getChild<LLButton>(BTN_IMPORT, true);
mLoadFrame = getChild<LLButton>(BTN_LOADFRAME, true);
- mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BTN_SAVE, BTN_FLYOUT, XML_FLYOUTMENU_FILE);
+ mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BTN_SAVE, BTN_FLYOUT, XML_FLYOUTMENU_FILE, false);
mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); });
getChild<LLButton>(BTN_CANCEL, true)->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onClickCloseBtn(); });
@@ -343,8 +343,11 @@ void LLFloaterEditExtDayCycle::onClose(bool app_quitting)
void LLFloaterEditExtDayCycle::onFocusReceived()
{
- updateEditEnvironment();
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
+ if (isInVisibleChain())
+ {
+ updateEditEnvironment();
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
+ }
}
void LLFloaterEditExtDayCycle::onFocusLost()
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 7ff1663942..d38098c0a6 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -108,7 +108,7 @@ BOOL LLFloaterFixedEnvironment::postBuild()
getChild<LLButton>(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onClickCloseBtn(); });
getChild<LLButton>(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); });
- mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE);
+ mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE, false);
mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); });
mFlyoutControl->setMenuItemVisible(ACTION_COMMIT, false);
@@ -147,8 +147,11 @@ void LLFloaterFixedEnvironment::onClose(bool app_quitting)
void LLFloaterFixedEnvironment::onFocusReceived()
{
- updateEditEnvironment();
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
+ if (isInVisibleChain())
+ {
+ updateEditEnvironment();
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
+ }
}
void LLFloaterFixedEnvironment::onFocusLost()
diff --git a/indra/newview/llflyoutcombobtn.cpp b/indra/newview/llflyoutcombobtn.cpp
index d1a8b46c92..b008ee13be 100644
--- a/indra/newview/llflyoutcombobtn.cpp
+++ b/indra/newview/llflyoutcombobtn.cpp
@@ -29,14 +29,21 @@
#include "llflyoutcombobtn.h"
#include "llviewermenu.h"
-LLFlyoutComboBtnCtrl::LLFlyoutComboBtnCtrl(LLPanel* parent, const std::string &action_button, const std::string &flyout_button, const std::string &menu_file) :
- mParent(parent),
+LLFlyoutComboBtnCtrl::LLFlyoutComboBtnCtrl(LLPanel* parent,
+ const std::string &action_button,
+ const std::string &flyout_button,
+ const std::string &menu_file,
+ bool apply_immediately) :
+ mParent(parent),
mActionButton(action_button),
- mFlyoutButton(flyout_button)
+ mFlyoutButton(flyout_button),
+ mApplyImmediately(apply_immediately)
{
- // register action mapping before creating menu
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
+ // register action mapping before creating menu
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
save_registar.add("FlyoutCombo.Button.Action", [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutItemSelected(ctrl, data); });
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enabled_rgistar;
+ enabled_rgistar.add("FlyoutCombo.Button.Check", [this](LLUICtrl *ctrl, const LLSD &data) { return onFlyoutItemCheck(ctrl, data); });
mParent->childSetAction(flyout_button, [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutButton(ctrl, data); });
mParent->childSetAction(action_button, [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutAction(ctrl, data); });
@@ -119,7 +126,24 @@ void LLFlyoutComboBtnCtrl::onFlyoutItemSelected(LLUICtrl *ctrl, const LLSD &data
LLMenuItemGL *pmenuitem = static_cast<LLMenuItemGL*>(ctrl);
setSelectedItem(pmenuitem);
- onFlyoutAction(pmenuitem, data);
+ if (mApplyImmediately)
+ {
+ onFlyoutAction(pmenuitem, data);
+ }
+}
+
+bool LLFlyoutComboBtnCtrl::onFlyoutItemCheck(LLUICtrl *ctrl, const LLSD &data)
+{
+ if (mApplyImmediately)
+ {
+ return false;
+ }
+ else
+ {
+ LLMenuItemGL *pmenuitem = static_cast<LLMenuItemGL*>(ctrl);
+
+ return pmenuitem->getName() == mSelectedName;
+ }
}
void LLFlyoutComboBtnCtrl::onFlyoutAction(LLUICtrl *ctrl, const LLSD &data)
diff --git a/indra/newview/llflyoutcombobtn.h b/indra/newview/llflyoutcombobtn.h
index 741ad03a37..b0dd4abadf 100644
--- a/indra/newview/llflyoutcombobtn.h
+++ b/indra/newview/llflyoutcombobtn.h
@@ -37,7 +37,11 @@ class LLFlyoutComboBtnCtrl
{
LOG_CLASS(LLFlyoutComboBtnCtrl);
public:
- LLFlyoutComboBtnCtrl(LLPanel* parent, const std::string &action_button, const std::string &flyout_button, const std::string &menu_file);
+ LLFlyoutComboBtnCtrl(LLPanel* parent,
+ const std::string &action_button,
+ const std::string &flyout_button,
+ const std::string &menu_file,
+ bool apply_immediately = true);
void setMenuItemEnabled(const std::string &item, bool enabled);
void setShownBtnEnabled(bool enabled);
@@ -52,6 +56,7 @@ public:
protected:
void onFlyoutButton(LLUICtrl *, const LLSD &);
void onFlyoutItemSelected(LLUICtrl *, const LLSD &);
+ bool onFlyoutItemCheck(LLUICtrl *, const LLSD &);
void onFlyoutAction(LLUICtrl *, const LLSD &);
void setSelectedItem(LLMenuItemGL *pitem);
@@ -63,6 +68,7 @@ private:
std::string mFlyoutButton;
std::string mSelectedName;
+ bool mApplyImmediately;
LLUICtrl::commit_signal_t mActionSignal;
};
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 12f487398f..6426e95f6c 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -67,7 +67,7 @@
namespace
{
LLSD ensure_array_4(LLSD in, F32 fill);
- LLSD read_legacy_preset_data(const std::string& path);
+ LLSD read_legacy_preset_data(const std::string &name, const std::string& path);
//-------------------------------------------------------------------------
class LLSettingsInventoryCB : public LLInventoryCallback
@@ -440,30 +440,13 @@ LLSettingsSky::ptr_t LLSettingsVOSky::buildFromLegacyPreset(const std::string &n
return skyp;
}
-namespace
-{
- // This is a disturbing hack
- std::string legacy_name_to_filename(const std::string &name)
- {
- std::string fixedname(LLURI::escape(name));
-
- boost::algorithm::replace_all(fixedname, "-", "%2D");
- return fixedname;
- }
-}
-
LLSettingsSky::ptr_t LLSettingsVOSky::buildFromLegacyPresetFile(const std::string &name, const std::string &path)
{
- std::string full_path(path);
- std::string full_name(legacy_name_to_filename(name));
- full_name += ".xml";
-
- gDirUtilp->append(full_path, full_name);
- LLSD legacy_data = read_legacy_preset_data(full_path);
+ LLSD legacy_data = read_legacy_preset_data(name, path);
if (!legacy_data)
{
- LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << full_path << LL_ENDL;
+ LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << path << LL_ENDL;
return ptr_t();
}
@@ -707,16 +690,11 @@ LLSettingsWater::ptr_t LLSettingsVOWater::buildFromLegacyPreset(const std::strin
LLSettingsWater::ptr_t LLSettingsVOWater::buildFromLegacyPresetFile(const std::string &name, const std::string &path)
{
- std::string full_path(path);
- std::string full_name(legacy_name_to_filename(name));
- full_name += ".xml";
-
- gDirUtilp->append(full_path, full_name);
- LLSD legacy_data = read_legacy_preset_data(full_path);
+ LLSD legacy_data = read_legacy_preset_data(name, path);
if (!legacy_data)
{
- LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << full_path << LL_ENDL;
+ LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << path << LL_ENDL;
return ptr_t();
}
@@ -961,16 +939,11 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyPreset(const std::string &n
LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyPresetFile(const std::string &name, const std::string &path)
{
- std::string full_path(path);
- std::string full_name(legacy_name_to_filename(name));
- full_name += ".xml";
-
- gDirUtilp->append(full_path, full_name);
- LLSD legacy_data = read_legacy_preset_data(full_path);
+ LLSD legacy_data = read_legacy_preset_data(name, path);
if (!legacy_data)
{
- LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << full_path << LL_ENDL;
+ LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << path << LL_ENDL;
return ptr_t();
}
@@ -1261,15 +1234,55 @@ namespace
return out;
}
+ // This is a disturbing hack
+ std::string legacy_name_to_filename(const std::string &name, bool convertdash = false)
+ {
+ std::string fixedname(LLURI::escape(name));
+
+ if (convertdash)
+ boost::algorithm::replace_all(fixedname, "-", "%2D");
+
+ return fixedname;
+ }
+
//---------------------------------------------------------------------
- LLSD read_legacy_preset_data(const std::string& path)
+ LLSD read_legacy_preset_data(const std::string &name, const std::string& path)
{
llifstream xml_file;
-// std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true));
- xml_file.open(path.c_str());
+ std::string full_path(path);
+ std::string full_name(name);
+ full_name += ".xml";
+ gDirUtilp->append(full_path, full_name);
+
+ xml_file.open(full_path.c_str());
if (!xml_file)
- return LLSD();
+ {
+ std::string bad_path(full_path);
+ full_path = path;
+ full_name = legacy_name_to_filename(name);
+ full_name += ".xml";
+ gDirUtilp->append(full_path, full_name);
+
+ LL_INFOS("LEGACYSETTING") << "Could not open \"" << bad_path << "\" trying escaped \"" << full_path << "\"" << LL_ENDL;
+
+ xml_file.open(full_path.c_str());
+ if (!xml_file)
+ {
+ LL_WARNS("LEGACYSETTING") << "Unable to open legacy windlight \"" << name << "\" from " << path << LL_ENDL;
+
+ full_path = path;
+ full_name = legacy_name_to_filename(name, true);
+ full_name += ".xml";
+ gDirUtilp->append(full_path, full_name);
+ xml_file.open(full_path.c_str());
+ if (!xml_file)
+ {
+ LL_WARNS("LEGACYSETTING") << "Unable to open legacy windlight \"" << name << "\" from " << path << LL_ENDL;
+ return LLSD();
+ }
+ }
+ }
LLSD params_data;
LLPointer<LLSDParser> parser = new LLSDXMLParser();
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index cd378c0a56..05c722a114 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -46,6 +46,8 @@
#include "llenvironment.h"
#include "llatmosphere.h"
+#pragma optimize("", off)
+
#ifdef LL_RELEASE_FOR_DOWNLOAD
#define UNIFORM_ERRS LL_WARNS_ONCE("Shader")
#else
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();
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index 4943c48f7c..be69757fc7 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -338,7 +338,7 @@ protected:
S32 mDrawRefl;
LLFrameTimer mUpdateTimer;
-
+ LLTimer mForceUpdateThrottle;
bool mHeavenlyBodyUpdated ;
LLAtmospherics m_legacyAtmospherics;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index db9452cce9..741d0e3992 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -637,7 +637,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
LLVector3 left = at%LLVector3(0,0,1);
LLVector3 up = at%left;
- F32 sc = 0.5f+ll_frand()*1.25f;
+ F32 sc = 0.8f + ll_frand()*2.5f;
left *= sc;
up *= sc;
diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
index 61299a43bd..c8843db28b 100644
--- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
+++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
@@ -520,15 +520,6 @@ Select a key frame from the timeline above to edit settings.
left_delta="0"
top_pad="5"
name="moon_panel" />
- <panel
- border="true"
- class="panel_settings_density"
- filename="panel_settings_sky_density.xml"
- label="Density"
- layout="topleft"
- left_delta="0"
- top_pad="5"
- name="panel_settings_sky_density" />
</tab_container>
</layout_panel>
</layout_stack>
@@ -547,7 +538,7 @@ Select a key frame from the timeline above to edit settings.
left="5"
top_pad="0"
name="save_btn"
- width="150" />
+ width="156" />
<button
follows="top|left"
diff --git a/indra/newview/skins/default/xui/en/menu_save_settings.xml b/indra/newview/skins/default/xui/en/menu_save_settings.xml
index e3ed9a1741..84dacaa8b8 100644
--- a/indra/newview/skins/default/xui/en/menu_save_settings.xml
+++ b/indra/newview/skins/default/xui/en/menu_save_settings.xml
@@ -5,46 +5,64 @@
mouse_opaque="false"
name="save_settings_menu"
width="120">
- <menu_item_call
+ <menu_item_check
name="save_settings"
label="Save">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="FlyoutCombo.Button.Check"
+ userdata="save" />
+ <menu_item_check.on_click
function="FlyoutCombo.Button.Action"
userdata="save"/>
- </menu_item_call>
- <menu_item_call
+ </menu_item_check>
+ <menu_item_check
name="save_as_new_settings"
label="Save As">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="FlyoutCombo.Button.Check"
+ userdata="saveas" />
+ <menu_item_check.on_click
function="FlyoutCombo.Button.Action"
userdata="saveas" />
- </menu_item_call>
- <menu_item_call
+ </menu_item_check>
+ <menu_item_check
name="commit_changes"
label="Commit">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="FlyoutCombo.Button.Check"
+ userdata="commit" />
+ <menu_item_check.on_click
function="FlyoutCombo.Button.Action"
userdata="commit" />
- </menu_item_call>
- <menu_item_call
+ </menu_item_check>
+ <menu_item_check
name="apply_local"
label="Apply Only To Myself">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="FlyoutCombo.Button.Check"
+ userdata="local" />
+ <menu_item_check.on_click
function="FlyoutCombo.Button.Action"
userdata="local" />
- </menu_item_call>
- <menu_item_call
+ </menu_item_check>
+ <menu_item_check
name="apply_parcel"
label="Apply To Parcel">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="FlyoutCombo.Button.Check"
+ userdata="parcel" />
+ <menu_item_check.on_click
function="FlyoutCombo.Button.Action"
userdata="parcel" />
- </menu_item_call>
- <menu_item_call
+ </menu_item_check>
+ <menu_item_check
name="apply_region"
label="Apply To Region">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="FlyoutCombo.Button.Check"
+ userdata="region" />
+ <menu_item_check.on_click
function="FlyoutCombo.Button.Action"
userdata="region" />
- </menu_item_call>
+ </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
index 4b72bbbe0e..0ec3528718 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
@@ -171,7 +171,7 @@
layout="topleft"
left_delta="5"
min_val="0"
- max_val="2"
+ max_val="512"
name="star_brightness"
top_delta="15"
width="250"