diff options
author | Graham Linden <graham@lindenlab.com> | 2018-08-14 18:39:40 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-08-14 18:39:40 +0100 |
commit | ec0fe8078c1f64c1579f382a686282ddbb82f470 (patch) | |
tree | 553b801948627fa65a91278a766a53ab4f7c348d /indra | |
parent | 090ee2682b06dd083e7bd5fb1ba6fa574fefadaa (diff) | |
parent | 2a7600fbd2a29cb6ac34767ed82eeef1fa4a1fbe (diff) |
Merge
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llinventory/llsettingssky.cpp | 80 | ||||
-rw-r--r-- | indra/llinventory/llsettingssky.h | 4 | ||||
-rw-r--r-- | indra/llui/llvirtualtrackball.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llvirtualtrackball.h | 6 | ||||
-rw-r--r-- | indra/newview/llenvironment.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.h | 2 | ||||
-rw-r--r-- | indra/newview/llpaneleditsky.cpp | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml | 12 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml | 116 |
10 files changed, 135 insertions, 121 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index a7f9aa7842..bc02867ce6 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -554,53 +554,36 @@ LLSettingsSky::validation_list_t LLSettingsSky::validationList() return validation; } -LLSD LLSettingsSky::createDensityProfileLayer( - F32 width, - F32 exponential_term, - F32 exponential_scale_factor, - F32 linear_term, - F32 constant_term, - F32 aniso_factor) -{ - LLSD dflt_layer; - dflt_layer[SETTING_DENSITY_PROFILE_WIDTH] = 0.0f; // 0 -> the entire atmosphere - dflt_layer[SETTING_DENSITY_PROFILE_EXP_TERM] = 1.0f; - dflt_layer[SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR] = -1.0f / 8000.0f; - dflt_layer[SETTING_DENSITY_PROFILE_LINEAR_TERM] = 0.0f; - dflt_layer[SETTING_DENSITY_PROFILE_CONSTANT_TERM] = 0.0f; - - if (aniso_factor != 0.0f) - { - dflt_layer[SETTING_MIE_ANISOTROPY_FACTOR] = aniso_factor; - } - - return dflt_layer; -} - -LLSD LLSettingsSky::createSingleLayerDensityProfile( - F32 width, - F32 exponential_term, - F32 exponential_scale_factor, - F32 linear_term, - F32 constant_term, - F32 aniso_factor) -{ - LLSD dflt; - LLSD dflt_layer = createDensityProfileLayer(width, exponential_term, exponential_scale_factor, linear_term, constant_term, aniso_factor); - dflt.append(dflt_layer); - return dflt; -} - LLSD LLSettingsSky::rayleighConfigDefault() { - return createSingleLayerDensityProfile(0.0f, 1.0f, -1.0f / 8000.0f, 0.0f, 0.0f); + LLSD dflt_rayleigh; + LLSD dflt_rayleigh_layer; + dflt_rayleigh_layer[SETTING_DENSITY_PROFILE_WIDTH] = 0.0f; // 0 -> the entire atmosphere + dflt_rayleigh_layer[SETTING_DENSITY_PROFILE_EXP_TERM] = 1.0f; + dflt_rayleigh_layer[SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR] = -1.0f / 8000.0f; + dflt_rayleigh_layer[SETTING_DENSITY_PROFILE_LINEAR_TERM] = 0.0f; + dflt_rayleigh_layer[SETTING_DENSITY_PROFILE_CONSTANT_TERM] = 0.0f; + dflt_rayleigh.append(dflt_rayleigh_layer); + return dflt_rayleigh; } LLSD LLSettingsSky::absorptionConfigDefault() { // absorption (ozone) has two linear ramping zones - LLSD dflt_absorption_layer_a = createDensityProfileLayer(25000.0f, 0.0f, 0.0f, -1.0f / 25000.0f, -2.0f / 3.0f); - LLSD dflt_absorption_layer_b = createDensityProfileLayer(0.0f, 0.0f, 0.0f, -1.0f / 15000.0f, 8.0f / 3.0f); + LLSD dflt_absorption_layer_a; + dflt_absorption_layer_a[SETTING_DENSITY_PROFILE_WIDTH] = 25000.0f; // 0 -> the entire atmosphere + dflt_absorption_layer_a[SETTING_DENSITY_PROFILE_EXP_TERM] = 0.0f; + dflt_absorption_layer_a[SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR] = 0.0f; + dflt_absorption_layer_a[SETTING_DENSITY_PROFILE_LINEAR_TERM] = -1.0f / 25000.0f; + dflt_absorption_layer_a[SETTING_DENSITY_PROFILE_CONSTANT_TERM] = -2.0f / 3.0f; + + LLSD dflt_absorption_layer_b; + dflt_absorption_layer_b[SETTING_DENSITY_PROFILE_WIDTH] = 0.0f; // 0 -> remainder of the atmosphere + dflt_absorption_layer_b[SETTING_DENSITY_PROFILE_EXP_TERM] = 0.0f; + dflt_absorption_layer_b[SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR] = 0.0f; + dflt_absorption_layer_b[SETTING_DENSITY_PROFILE_LINEAR_TERM] = -1.0f / 15000.0f; + dflt_absorption_layer_b[SETTING_DENSITY_PROFILE_CONSTANT_TERM] = 8.0f / 3.0f; + LLSD dflt_absorption; dflt_absorption.append(dflt_absorption_layer_a); dflt_absorption.append(dflt_absorption_layer_b); @@ -609,7 +592,15 @@ LLSD LLSettingsSky::absorptionConfigDefault() LLSD LLSettingsSky::mieConfigDefault() { - LLSD dflt_mie = createSingleLayerDensityProfile(0.0f, 1.0f, -1.0f / 1200.0f, 0.0f, 0.0f, 0.8f); + LLSD dflt_mie; + LLSD dflt_mie_layer; + dflt_mie_layer[SETTING_DENSITY_PROFILE_WIDTH] = 0.0f; // 0 -> the entire atmosphere + dflt_mie_layer[SETTING_DENSITY_PROFILE_EXP_TERM] = 1.0f; + dflt_mie_layer[SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR] = -1.0f / 1200.0f; + dflt_mie_layer[SETTING_DENSITY_PROFILE_LINEAR_TERM] = 0.0f; + dflt_mie_layer[SETTING_DENSITY_PROFILE_CONSTANT_TERM] = 0.0f; + dflt_mie_layer[SETTING_MIE_ANISOTROPY_FACTOR] = 0.8f; + dflt_mie.append(dflt_mie_layer); return dflt_mie; } @@ -1104,10 +1095,15 @@ LLUUID LLSettingsSky::GetDefaultAssetId() LLUUID LLSettingsSky::GetDefaultSunTextureId() { - //return DEFAULT_SUN_ID; return LLUUID::null; } + +LLUUID LLSettingsSky::GetBlankSunTextureId() +{ + return DEFAULT_SUN_ID; +} + LLUUID LLSettingsSky::GetDefaultMoonTextureId() { return DEFAULT_MOON_ID; diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 36d1053cf6..a9e708487f 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -72,6 +72,7 @@ public: static const std::string SETTING_SKY_BOTTOM_RADIUS; static const std::string SETTING_SKY_TOP_RADIUS; static const std::string SETTING_SUN_ARC_RADIANS; + static const std::string SETTING_MIE_ANISOTROPY_FACTOR; static const std::string SETTING_RAYLEIGH_CONFIG; static const std::string SETTING_MIE_CONFIG; @@ -83,7 +84,7 @@ public: static const std::string SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR; static const std::string SETTING_DENSITY_PROFILE_LINEAR_TERM; static const std::string SETTING_DENSITY_PROFILE_CONSTANT_TERM; - static const std::string SETTING_MIE_ANISOTROPY_FACTOR; + static const std::string SETTING_LEGACY_HAZE; @@ -237,6 +238,7 @@ public: static LLUUID GetDefaultAssetId(); static LLUUID GetDefaultSunTextureId(); + static LLUUID GetBlankSunTextureId(); static LLUUID GetDefaultMoonTextureId(); static LLUUID GetDefaultCloudNoiseTextureId(); static LLUUID GetDefaultBloomTextureId(); diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index a24c5a420d..e73bba57bb 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -321,7 +321,7 @@ BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { - if (mask == MASK_CONTROL) + if (mDragMode == DRAG_SCROLL) { // trackball (move to roll) mode LLQuaternion delta; @@ -394,7 +394,7 @@ BOOL LLVirtualTrackball::handleMouseUp(S32 x, S32 y, MASK mask) gFocusMgr.setMouseCapture(NULL); make_ui_sound("UISndClickRelease"); } - return TRUE; + return LLView::handleMouseUp(x, y, mask); } BOOL LLVirtualTrackball::handleMouseDown(S32 x, S32 y, MASK mask) @@ -404,9 +404,10 @@ BOOL LLVirtualTrackball::handleMouseDown(S32 x, S32 y, MASK mask) mPrevX = x; mPrevY = y; gFocusMgr.setMouseCapture(this); + mDragMode = (mask == MASK_CONTROL) ? DRAG_SCROLL : DRAG_SET; make_ui_sound("UISndClick"); } - return TRUE; + return LLView::handleMouseDown(x, y, mask); } BOOL LLVirtualTrackball::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -416,7 +417,7 @@ BOOL LLVirtualTrackball::handleRightMouseDown(S32 x, S32 y, MASK mask) //make_ui_sound("UISndClick"); } - return TRUE; + return LLView::handleRightMouseDown(x, y, mask); } BOOL LLVirtualTrackball::handleKeyHere(KEY key, MASK mask) diff --git a/indra/llui/llvirtualtrackball.h b/indra/llui/llvirtualtrackball.h index c1b66550bb..48ddb7f4d9 100644 --- a/indra/llui/llvirtualtrackball.h +++ b/indra/llui/llvirtualtrackball.h @@ -44,6 +44,11 @@ public: SUN, MOON }; + enum DragMode + { + DRAG_SET, + DRAG_SCROLL + }; struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> @@ -140,6 +145,7 @@ private: LLQuaternion mValue; ThumbMode mThumbMode; + DragMode mDragMode; F32 mIncrementMouse; F32 mIncrementBtn; diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index b2bd20d809..de3cb4982d 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -595,6 +595,7 @@ void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLS } setEnvironment(env, settings); + updateEnvironment(); } void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env) diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 64773e4b59..165971b943 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -140,6 +140,9 @@ LLFloaterEditExtDayCycle::LLFloaterEditExtDayCycle(const LLSD &key) : mScratchSky = LLSettingsVOSky::buildDefaultSky(); mScratchWater = LLSettingsVOWater::buildDefaultWater(); + + mEditSky = mScratchSky; + mEditWater = mScratchWater; } LLFloaterEditExtDayCycle::~LLFloaterEditExtDayCycle() @@ -203,7 +206,7 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key) } else { - loadLiveEnvironment(LLEnvironment::ENV_DEFAULT); + loadLiveEnvironment(env); } mDayLength.value(0); @@ -558,7 +561,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data) mTimeSlider->setCurSliderValue(sliderpos); updateTabs(); - LLEnvironment::instance().updateEnvironment(); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); } void LLFloaterEditExtDayCycle::onFrameSliderDoubleClick(S32 x, S32 y, MASK mask) diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index 0607d35d4a..83506ba85f 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -172,6 +172,8 @@ private: LLSettingsSky::ptr_t mScratchSky; LLSettingsWater::ptr_t mScratchWater; LLSettingsBase::ptr_t mCurrentEdit; + LLSettingsSky::ptr_t mEditSky; + LLSettingsWater::ptr_t mEditWater; LLFrameTimer mPlayTimer; F32 mPlayStartFrame; // an env frame diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 16cdc7994d..f84fdbb897 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -62,7 +62,7 @@ namespace const std::string FIELD_SKY_CLOUD_DETAIL_Y("cloud_detail_y"); const std::string FIELD_SKY_CLOUD_DETAIL_D("cloud_detail_d"); - const std::string FIELD_SKY_SUN_MOON_COLOR("-m_moon_color"); + const std::string FIELD_SKY_SUN_MOON_COLOR("sun_moon_color"); const std::string FIELD_SKY_GLOW_FOCUS("glow_focus"); const std::string FIELD_SKY_GLOW_SIZE("glow_size"); const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); @@ -214,7 +214,9 @@ BOOL LLPanelSettingsSkyCloudTab::postBuild() getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScaleChanged(); }); getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_XY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); }); -// getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::DEFAULT_CLOUD_TEXTURE_ID); + getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::GetDefaultCloudNoiseTextureId()); + getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setAllowNoTexture(TRUE); + getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setAllowLocalTexture(FALSE); getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); @@ -336,10 +338,17 @@ BOOL LLPanelSettingsSkySunMoonTab::postBuild() getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); getChild<LLUICtrl>(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); getChild<LLUICtrl>(FIELD_SKY_SUN_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunImageChanged(); }); -// getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky:: ); + getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId()); + getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetBlankSunTextureId()); + getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setAllowNoTexture(TRUE); + getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setAllowLocalTexture(FALSE); getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); getChild<LLUICtrl>(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); }); -// getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky:: ); + getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetDefaultMoonTextureId()); + getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId()); + getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setAllowNoTexture(TRUE); + getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setAllowLocalTexture(FALSE); + refresh(); @@ -398,11 +407,13 @@ void LLPanelSettingsSkySunMoonTab::onGlowChanged() glow.mV[2] *= SLIDER_SCALE_GLOW_B; mSkySettings->setGlow(glow); + mSkySettings->update(); } void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() { mSkySettings->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); + mSkySettings->update(); } void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() 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 c2eec2a56e..1ccd953b3b 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 @@ -7,8 +7,8 @@ title="Edit Day Cycle" width="705" height="650" - min_width="450" - min_height="85" + min_width="705" + min_height="650" can_resize="true"> <!-- obsolete?, add as hint for 'save' button? --> @@ -455,14 +455,14 @@ <layout_panel name="frame_settings_water" auto_resize="true" user_resize="true" - height="500" + height="420" width="700" min_height="0" - visible="true"> + visible="false"> <tab_container follows="all" halign="left" - height="430" + height="420" layout="topleft" left="0" name="water_tabs" @@ -488,7 +488,7 @@ height="420" width="700" min_height="0" - visible="false"> + visible="true"> <tab_container follows="all" halign="left" 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 15d20e46b7..2b79a1056f 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 @@ -28,8 +28,51 @@ layout="topleft" left_delta="15" top_pad="15" + font="SansSerifBold" + width="120"> + Sun & Stars + </text> + <text + follows="left|top" + height="10" + layout="topleft" + left_delta="10" + top_delta="30" + width="100"> + Position: + </text> + <sun_moon_trackball + name="sun_rotation" + follows="left|top" + left_delta="0" + top_delta="20" + height="150" + width="150" + thumb_mode="sun" /> + <text + follows="left|top" + height="10" + layout="topleft" + left_delta="160" + top_delta="-20" + width="200"> + Image: + </text> + <texture_picker + height="123" + layout="topleft" + left_delta="5" + name="sun_image" + top_pad="10" + width="100"/> + <text + follows="left|top" + height="10" + layout="topleft" + left_delta="-5" + top_delta="110" width="80"> - Sun Color: + Color: </text> <color_swatch can_apply_immediately="true" @@ -37,7 +80,7 @@ height="37" label_height="0" layout="topleft" - left_delta="0" + left_delta="5" name="sun_moon_color" top_pad="5" width="60" /> @@ -45,8 +88,8 @@ follows="left|top" height="10" layout="topleft" - left_delta="0" - top_delta="57" + left_delta="-160" + top_delta="47" width="200"> Glow Focus: </text> @@ -61,15 +104,15 @@ min_val="0" max_val="0.5" name="glow_focus" - top_delta="20" - width="200" + top_delta="15" + width="250" can_edit_text="true"/> <text follows="left|top" height="10" layout="topleft" left_delta="-5" - top_delta="20" + top_delta="22" width="200"> Glow Size: </text> @@ -84,8 +127,8 @@ min_val="1" max_val="1.99" name="glow_size" - top_delta="20" - width="200" + top_delta="15" + width="250" can_edit_text="true"/> <text follows="left|top" @@ -107,8 +150,8 @@ min_val="0" max_val="2" name="star_brightness" - top_delta="20" - width="200" + top_delta="15" + width="250" can_edit_text="true"/> </layout_panel> <layout_panel @@ -140,57 +183,6 @@ top_pad="15" font="SansSerifBold" width="80"> - Sun - </text> - <text - follows="left|top" - height="10" - layout="topleft" - left_delta="10" - top_delta="30" - width="100"> - Position: - </text> - <sun_moon_trackball - name="sun_rotation" - follows="left|top" - left_delta="0" - top_delta="20" - height="150" - width="150" - thumb_mode="sun" /> - <text - follows="left|top" - height="10" - layout="topleft" - left_delta="160" - top_delta="-20" - width="200"> - Image: - </text> - <texture_picker - height="123" - layout="topleft" - left_delta="5" - name="sun_image" - top_pad="10" - width="100"/> - </layout_panel> - <layout_panel - border="true" - bevel_style="in" - auto_resize="true" - user_resize="true" - visible="true" - height="220"> - <text - follows="left|top" - height="10" - layout="topleft" - left_delta="15" - top_pad="15" - font="SansSerifBold" - width="80"> Moon </text> <text |