Commit fe4ccf33 authored by NiranV's avatar NiranV

Added: Reimplemented separate Cloud Scroll locks.

parent 33e03c6e
......@@ -818,7 +818,10 @@ LLEnvironment::LLEnvironment():
mCurrentTrack(1),
mEditorCounter(0),
mShowSunBeacon(false),
mShowMoonBeacon(false)
mShowMoonBeacon(false),
//BD - Windlight
mCloudScrollXLocked(false),
mCloudScrollYLocked(false)
{
}
......@@ -1532,7 +1535,10 @@ void LLEnvironment::updateCloudScroll()
if (mCurrentEnvironment->getSky() && !mCloudScrollPaused)
{
LLVector2 cloud_delta = static_cast<F32>(delta_t)* (mCurrentEnvironment->getSky()->getCloudScrollRate()) / 100.0;
mCloudScrollDelta += cloud_delta;
if (!mCloudScrollXLocked)
mCloudScrollDelta.mV[0] += cloud_delta.mV[0];
if (!mCloudScrollYLocked)
mCloudScrollDelta.mV[1] += cloud_delta.mV[1];
}
}
......
......@@ -164,6 +164,13 @@ class LLEnvironment : public LLSingleton<LLEnvironment>
void resumeCloudScroll() { mCloudScrollPaused = false; }
bool isCloudScrollPaused() const { return mCloudScrollPaused; }
//BD - Windlight
void pauseCloudScrollX(bool lock) { mCloudScrollXLocked = lock; }
void pauseCloudScrollY(bool lock) { mCloudScrollYLocked = lock; }
bool mCloudScrollXLocked;
bool mCloudScrollYLocked;
F32 getCamHeight() const;
F32 getWaterHeight() const;
bool getIsSunUp() const;
......
......@@ -106,6 +106,8 @@ namespace
const std::string FIELD_SKY_CLOUD_DETAIL_X("cloud_detail_x");
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_CLOUD_LOCK_X("cloud_lock_x");
const std::string FIELD_SKY_CLOUD_LOCK_Y("cloud_lock_y");
//BD - Density
const std::string FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL("rayleigh_exponential");
......@@ -233,6 +235,10 @@ BOOL LLFloaterEnvironmentAdjust::postBuild()
mCloudScrollX->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); });
mCloudScrollY = getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_Y);
mCloudScrollY->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); });
mCloudScrollLockX = getChild<LLUICtrl>(FIELD_SKY_CLOUD_LOCK_X);
mCloudScrollLockX->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &) { onCloudScrollXLocked(ctrl->getValue()); });
mCloudScrollLockY = getChild<LLUICtrl>(FIELD_SKY_CLOUD_LOCK_Y);
mCloudScrollLockY->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &) { onCloudScrollYLocked(ctrl->getValue()); });
mCloudImage = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP);
mCloudImage->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); });
mCloudImage->setDefaultImageAssetID(LLSettingsSky::GetDefaultCloudNoiseTextureId());
......@@ -356,6 +362,11 @@ void LLFloaterEnvironmentAdjust::refresh()
LLVector2 cloudScroll(mLiveSky->getCloudScrollRate());
mCloudScrollX->setValue(cloudScroll[0]);
mCloudScrollY->setValue(cloudScroll[1]);
LLEnvironment &environment(LLEnvironment::instance());
mCloudScrollX->setEnabled(!environment.mCloudScrollXLocked);
mCloudScrollY->setEnabled(!environment.mCloudScrollYLocked);
mCloudScrollLockX->setValue(environment.mCloudScrollXLocked);
mCloudScrollLockY->setValue(environment.mCloudScrollYLocked);
mCloudImage->setValue(mLiveSky->getCloudNoiseTextureId());
......@@ -735,6 +746,18 @@ void LLFloaterEnvironmentAdjust::onCloudDetailChanged()
mLiveSky->setCloudPosDensity2(detail);
}
void LLFloaterEnvironmentAdjust::onCloudScrollXLocked(bool lock)
{
LLEnvironment::instance().pauseCloudScrollX(lock);
refresh();
}
void LLFloaterEnvironmentAdjust::onCloudScrollYLocked(bool lock)
{
LLEnvironment::instance().pauseCloudScrollY(lock);
refresh();
}
void LLFloaterEnvironmentAdjust::onButtonApply(LLUICtrl *ctrl, const LLSD &data)
{
std::string ctrl_action = ctrl->getName();
......
......@@ -107,6 +107,8 @@ class LLFloaterEnvironmentAdjust : public LLFloater
void onCloudMapChanged();
void onCloudDensityChanged();
void onCloudDetailChanged();
void onCloudScrollXLocked(bool lock);
void onCloudScrollYLocked(bool lock);
//BD - Windlight Stuff
......@@ -168,6 +170,8 @@ class LLFloaterEnvironmentAdjust : public LLFloater
LLUICtrl* mCloudDetailX;
LLUICtrl* mCloudDetailY;
LLUICtrl* mCloudDetailD;
LLUICtrl* mCloudScrollLockX;
LLUICtrl* mCloudScrollLockY;
LLComboBox* mNameCombo;
LLFlyoutComboBtnCtrl * mFlyoutControl;
......
......@@ -86,6 +86,8 @@ namespace
const std::string FIELD_SKY_CLOUD_DETAIL_X("cloud_detail_x");
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_CLOUD_LOCK_X("cloud_lock_x");
const std::string FIELD_SKY_CLOUD_LOCK_Y("cloud_lock_y");
//BD - Density
const std::string FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL("rayleigh_exponential");
......@@ -321,6 +323,10 @@ BOOL LLPanelSettingsSkyCloudTab::postBuild()
mCloudScrollX->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); });
mCloudScrollY = getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_Y);
mCloudScrollY->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); });
mCloudScrollLockX = getChild<LLUICtrl>(FIELD_SKY_CLOUD_LOCK_X);
mCloudScrollLockX->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &) { onCloudScrollXLocked(ctrl->getValue()); });
mCloudScrollLockY = getChild<LLUICtrl>(FIELD_SKY_CLOUD_LOCK_Y);
mCloudScrollLockY->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &) { onCloudScrollYLocked(ctrl->getValue()); });
mCloudImage = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP);
mCloudImage->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); });
mCloudImage->setDefaultImageAssetID(LLSettingsSky::GetDefaultCloudNoiseTextureId());
......@@ -363,6 +369,11 @@ void LLPanelSettingsSkyCloudTab::refresh()
LLVector2 cloudScroll(mSkySettings->getCloudScrollRate());
mCloudScrollX->setValue(cloudScroll[0]);
mCloudScrollY->setValue(cloudScroll[1]);
LLEnvironment &environment(LLEnvironment::instance());
mCloudScrollX->setEnabled(!environment.mCloudScrollXLocked);
mCloudScrollY->setEnabled(!environment.mCloudScrollYLocked);
mCloudScrollLockX->setValue(environment.mCloudScrollXLocked);
mCloudScrollLockY->setValue(environment.mCloudScrollYLocked);
mCloudImage->setValue(mSkySettings->getCloudNoiseTextureId());
......@@ -440,6 +451,20 @@ void LLPanelSettingsSkyCloudTab::onCloudDetailChanged()
setIsDirty();
}
void LLPanelSettingsSkyCloudTab::onCloudScrollXLocked(bool lock)
{
LLEnvironment::instance().pauseCloudScrollX(lock);
refresh();
setIsDirty();
}
void LLPanelSettingsSkyCloudTab::onCloudScrollYLocked(bool lock)
{
LLEnvironment::instance().pauseCloudScrollY(lock);
refresh();
setIsDirty();
}
//==========================================================================
LLPanelSettingsSkySunMoonTab::LLPanelSettingsSkySunMoonTab() :
LLPanelSettingsSky()
......@@ -625,6 +650,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonBrightnessChanged()
mSkySettings->update();
setIsDirty();
}
LLPanelSettingsSkyDensityTab::LLPanelSettingsSkyDensityTab()
{
......
......@@ -116,6 +116,8 @@ class LLPanelSettingsSkyCloudTab : public LLPanelSettingsSky
void onCloudMapChanged();
void onCloudDensityChanged();
void onCloudDetailChanged();
void onCloudScrollXLocked(bool lock);
void onCloudScrollYLocked(bool lock);
//BD - Clouds
LLColorSwatchCtrl* mCloudColor;
......@@ -131,6 +133,8 @@ class LLPanelSettingsSkyCloudTab : public LLPanelSettingsSky
LLUICtrl* mCloudDetailX;
LLUICtrl* mCloudDetailY;
LLUICtrl* mCloudDetailD;
LLUICtrl* mCloudScrollLockX;
LLUICtrl* mCloudScrollLockY;
};
class LLPanelSettingsSkySunMoonTab : public LLPanelSettingsSky
......
......@@ -1006,7 +1006,7 @@ width="700">
layout="topleft"
top_delta="-21"
left_pad="-67"
name="WLCloudLockY"
name="cloud_lock_y"
width="200" />
......
......@@ -312,7 +312,7 @@ width="698">
layout="topleft"
top_delta="-21"
left_pad="-67"
name="WLCloudLockY"
name="cloud_lock_y"
width="200" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment