summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-29 08:20:06 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-29 08:20:06 -0700
commit2037c3ec667b2b1473a88a3e5f588d9cc4ff1332 (patch)
tree9b697ef338a059474c658f5f18640018d29b2811
parent1b152d5114a048c7e79e0d9baff65a7867ccada9 (diff)
parentbaa1c7f6d7293ddb5caf56912a574cff45d5e002 (diff)
Merge
-rw-r--r--indra/newview/llenvironment.cpp30
-rw-r--r--indra/newview/llenvironment.h7
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp8
-rw-r--r--indra/newview/llfloaterenvironmentadjust.cpp5
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp17
-rw-r--r--indra/newview/llfloaterfixedenvironment.h5
-rw-r--r--indra/newview/llpaneleditsky.cpp21
-rw-r--r--indra/newview/llpaneleditwater.cpp2
-rw-r--r--indra/newview/llsettingsvo.cpp8
-rw-r--r--indra/newview/lltexturecache.cpp19
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml2
11 files changed, 83 insertions, 41 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 57e6ab7159..3373c8c3a4 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -811,7 +811,10 @@ LLEnvironment::LLEnvironment():
mSelectedWater(),
mSelectedDay(),
mSelectedEnvironment(LLEnvironment::ENV_LOCAL),
- mCurrentTrack(1)
+ mCurrentTrack(1),
+ mEditorCounter(0),
+ mShowSunBeacon(false),
+ mShowMoonBeacon(false)
{
}
@@ -2165,7 +2168,7 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extractLeg
//=========================================================================
LLSettingsWater::ptr_t LLEnvironment::createWaterFromLegacyPreset(const std::string filename, LLSD &messages)
{
- std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(filename), true));
+ std::string name(gDirUtilp->getBaseFileName(filename, true));
std::string path(gDirUtilp->getDirName(filename));
LLSettingsWater::ptr_t water = LLSettingsVOWater::buildFromLegacyPresetFile(name, path, messages);
@@ -2180,7 +2183,7 @@ LLSettingsWater::ptr_t LLEnvironment::createWaterFromLegacyPreset(const std::str
LLSettingsSky::ptr_t LLEnvironment::createSkyFromLegacyPreset(const std::string filename, LLSD &messages)
{
- std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(filename), true));
+ std::string name(gDirUtilp->getBaseFileName(filename, true));
std::string path(gDirUtilp->getDirName(filename));
LLSettingsSky::ptr_t sky = LLSettingsVOSky::buildFromLegacyPresetFile(name, path, messages);
@@ -2194,7 +2197,7 @@ LLSettingsSky::ptr_t LLEnvironment::createSkyFromLegacyPreset(const std::string
LLSettingsDay::ptr_t LLEnvironment::createDayCycleFromLegacyPreset(const std::string filename, LLSD &messages)
{
- std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(filename), true));
+ std::string name(gDirUtilp->getBaseFileName(filename, true));
std::string path(gDirUtilp->getDirName(filename));
LLSettingsDay::ptr_t day = LLSettingsVODay::buildFromLegacyPresetFile(name, path, messages);
@@ -2692,6 +2695,25 @@ void LLEnvironment::DayTransition::animate()
});
}
+void LLEnvironment::saveBeaconsState()
+{
+ if (mEditorCounter == 0)
+ {
+ mShowSunBeacon = gSavedSettings.getBOOL("sunbeacon");
+ mShowMoonBeacon = gSavedSettings.getBOOL("moonbeacon");
+ }
+ ++mEditorCounter;
+}
+void LLEnvironment::revertBeaconsState()
+{
+ --mEditorCounter;
+ if (mEditorCounter == 0)
+ {
+ gSavedSettings.setBOOL("sunbeacon", mShowSunBeacon && gSavedSettings.getBOOL("sunbeacon"));
+ gSavedSettings.setBOOL("moonbeacon", mShowMoonBeacon && gSavedSettings.getBOOL("moonbeacon"));
+ }
+}
+
//=========================================================================
LLTrackBlenderLoopingManual::LLTrackBlenderLoopingManual(const LLSettingsBase::ptr_t &target, const LLSettingsDay::ptr_t &day, S32 trackno) :
LLSettingsBlender(target, LLSettingsBase::ptr_t(), LLSettingsBase::ptr_t()),
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 327e34d856..0e23693c86 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -169,6 +169,9 @@ public:
bool getIsSunUp() const;
bool getIsMoonUp() const;
+ void saveBeaconsState();
+ void revertBeaconsState();
+
// Returns either sun or moon direction (depending on which is up and stronger)
// Light direction in +x right, +z up, +y at internal coord sys
LLVector3 getLightDirection() const; // returns sun or moon depending on which is up
@@ -382,6 +385,10 @@ private:
void onRegionChange();
void onParcelChange();
+ bool mShowSunBeacon;
+ bool mShowMoonBeacon;
+ S32 mEditorCounter;
+
struct UpdateInfo
{
typedef std::shared_ptr<UpdateInfo> ptr_t;
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index bae901bd50..3870794c63 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -271,6 +271,10 @@ BOOL LLFloaterEditExtDayCycle::postBuild()
void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
{
+ if (!mEditDay)
+ {
+ LLEnvironment::instance().saveBeaconsState();
+ }
mEditDay.reset();
mEditContext = CONTEXT_UNKNOWN;
if (key.has(KEY_EDIT_CONTEXT))
@@ -410,10 +414,12 @@ void LLFloaterEditExtDayCycle::onClose(bool app_quitting)
// there's no point to change environment if we're quitting
// or if we already restored environment
stopPlay();
+ LLEnvironment::instance().revertBeaconsState();
if (!app_quitting)
{
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST);
LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
+ mEditDay.reset();
}
}
@@ -1613,8 +1619,8 @@ void LLFloaterEditExtDayCycle::setTabsData(LLTabContainer * tabcontainer, const
LLSettingsEditPanel *panel = static_cast<LLSettingsEditPanel *>(tabcontainer->getPanelByIndex(idx));
if (panel)
{
- panel->setSettings(settings);
panel->setCanChangeSettings(editable & mCanMod);
+ panel->setSettings(settings);
}
}
}
diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp
index 3d19d560d6..4eb5e03603 100644
--- a/indra/newview/llfloaterenvironmentadjust.cpp
+++ b/indra/newview/llfloaterenvironmentadjust.cpp
@@ -115,6 +115,10 @@ BOOL LLFloaterEnvironmentAdjust::postBuild()
void LLFloaterEnvironmentAdjust::onOpen(const LLSD& key)
{
+ if (!mLiveSky)
+ {
+ LLEnvironment::instance().saveBeaconsState();
+ }
captureCurrentEnvironment();
mEventConnection = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env, S32 version){ onEnvironmentUpdated(env, version); });
@@ -125,6 +129,7 @@ void LLFloaterEnvironmentAdjust::onOpen(const LLSD& key)
void LLFloaterEnvironmentAdjust::onClose(bool app_quitting)
{
+ LLEnvironment::instance().revertBeaconsState();
mEventConnection.disconnect();
mLiveSky.reset();
mLiveWater.reset();
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index a94b7c219f..b1fdc2d2a5 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -214,8 +214,8 @@ void LLFloaterFixedEnvironment::refresh()
LLSettingsEditPanel *panel = static_cast<LLSettingsEditPanel *>(mTab->getPanelByIndex(idx));
if (panel)
{
- panel->refresh();
panel->setCanChangeSettings(mCanMod);
+ panel->refresh();
}
}
}
@@ -814,13 +814,20 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key)
// Initialize the settings, take a snapshot of the current water.
mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone();
mSettings->setName("Snapshot sky (new)");
-
+ LLEnvironment::instance().saveBeaconsState();
// TODO: Should we grab water and keep it around for reference?
}
LLFloaterFixedEnvironment::onOpen(key);
}
+void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting)
+{
+ LLEnvironment::instance().revertBeaconsState();
+
+ LLFloaterFixedEnvironment::onClose(app_quitting);
+}
+
void LLFloaterFixedEnvironmentSky::doImportFromDisk()
{ // Load a a legacy Windlight XML from disk.
(new LLFilePickerReplyThread(boost::bind(&LLFloaterFixedEnvironmentSky::loadSkySettingFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile();
@@ -851,9 +858,3 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector<std:
}
//=========================================================================
-
-void LLSettingsEditPanel::setCanChangeSettings(bool enabled)
-{
- setEnabled(enabled);
- setAllChildrenEnabled(enabled);
-}
diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h
index 138f26cfd7..84feaa1a20 100644
--- a/indra/newview/llfloaterfixedenvironment.h
+++ b/indra/newview/llfloaterfixedenvironment.h
@@ -161,6 +161,7 @@ public:
BOOL postBuild() override;
virtual void onOpen(const LLSD& key) override;
+ virtual void onClose(bool app_quitting) override;
protected:
virtual void updateEditEnvironment() override;
@@ -183,7 +184,8 @@ public:
inline void setIsDirty() { mIsDirty = true; if (!mOnDirtyChanged.empty()) mOnDirtyChanged(this, mIsDirty); }
inline void clearIsDirty() { mIsDirty = false; if (!mOnDirtyChanged.empty()) mOnDirtyChanged(this, mIsDirty); }
- virtual void setCanChangeSettings(bool flag);
+ inline bool getCanChangeSettings() const { return mCanEdit; }
+ inline void setCanChangeSettings(bool flag) { mCanEdit = flag; }
inline connection_t setOnDirtyFlagChanged(on_dirty_charged_sg::slot_type cb) { return mOnDirtyChanged.connect(cb); }
@@ -197,6 +199,7 @@ protected:
private:
bool mIsDirty;
+ bool mCanEdit;
on_dirty_charged_sg mOnDirtyChanged;
};
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp
index fdd365cc92..aaa54ed2e9 100644
--- a/indra/newview/llpaneleditsky.cpp
+++ b/indra/newview/llpaneleditsky.cpp
@@ -71,11 +71,16 @@ namespace
const std::string FIELD_SKY_SUN_ROTATION("sun_rotation");
const std::string FIELD_SKY_SUN_IMAGE("sun_image");
const std::string FIELD_SKY_SUN_SCALE("sun_scale");
+ const std::string FIELD_SKY_SUN_BEACON("sunbeacon");
+ const std::string FIELD_SKY_MOON_BEACON("moonbeacon");
const std::string FIELD_SKY_MOON_ROTATION("moon_rotation");
const std::string FIELD_SKY_MOON_IMAGE("moon_image");
const std::string FIELD_SKY_MOON_SCALE("moon_scale");
const std::string FIELD_SKY_MOON_BRIGHTNESS("moon_brightness");
+ const std::string PANEL_SKY_SUN_LAYOUT("sun_layout");
+ const std::string PANEL_SKY_MOON_LAYOUT("moon_layout");
+
const std::string FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL("rayleigh_exponential");
const std::string FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE("rayleigh_exponential_scale");
const std::string FIELD_SKY_DENSITY_RAYLEIGH_LINEAR("rayleigh_linear");
@@ -168,7 +173,7 @@ void LLPanelSettingsSkyAtmosTab::setEnabled(BOOL enabled)
void LLPanelSettingsSkyAtmosTab::refresh()
{
- if (!mSkySettings)
+ if (!mSkySettings || !getCanChangeSettings())
{
setAllChildrenEnabled(FALSE);
setEnabled(FALSE);
@@ -342,7 +347,7 @@ void LLPanelSettingsSkyCloudTab::setEnabled(BOOL enabled)
void LLPanelSettingsSkyCloudTab::refresh()
{
- if (!mSkySettings)
+ if (!mSkySettings || !getCanChangeSettings())
{
setAllChildrenEnabled(FALSE);
setEnabled(FALSE);
@@ -480,15 +485,19 @@ void LLPanelSettingsSkySunMoonTab::setEnabled(BOOL enabled)
getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->setEnabled(enabled);
+ getChildView(PANEL_SKY_SUN_LAYOUT)->setAllChildrenEnabled(TRUE);
+ getChildView(PANEL_SKY_MOON_LAYOUT)->setAllChildrenEnabled(TRUE);
}
}
void LLPanelSettingsSkySunMoonTab::refresh()
{
- if (!mSkySettings)
+ if (!mSkySettings || !getCanChangeSettings())
{
- setAllChildrenEnabled(FALSE);
- setEnabled(FALSE);
+ getChildView(PANEL_SKY_SUN_LAYOUT)->setAllChildrenEnabled(FALSE);
+ getChildView(PANEL_SKY_MOON_LAYOUT)->setAllChildrenEnabled(FALSE);
+ getChildView(FIELD_SKY_SUN_BEACON)->setEnabled(TRUE);
+ getChildView(FIELD_SKY_MOON_BEACON)->setEnabled(TRUE);
return;
}
@@ -654,7 +663,7 @@ void LLPanelSettingsSkyDensityTab::setEnabled(BOOL enabled)
void LLPanelSettingsSkyDensityTab::refresh()
{
- if (!mSkySettings)
+ if (!mSkySettings || !getCanChangeSettings())
{
setAllChildrenEnabled(FALSE);
setEnabled(FALSE);
diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp
index 1f9c79c9eb..d8b97b714b 100644
--- a/indra/newview/llpaneleditwater.cpp
+++ b/indra/newview/llpaneleditwater.cpp
@@ -130,7 +130,7 @@ void LLPanelSettingsWaterMainTab::setEnabled(BOOL enabled)
//==========================================================================
void LLPanelSettingsWaterMainTab::refresh()
{
- if (!mWaterSettings)
+ if (!mWaterSettings || !getCanChangeSettings())
{
setAllChildrenEnabled(FALSE);
setEnabled(FALSE);
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 00acb78c45..f4cd0eef6e 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -502,7 +502,7 @@ LLSettingsSky::ptr_t LLSettingsVOSky::buildFromLegacyPresetFile(const std::strin
return ptr_t();
}
- return buildFromLegacyPreset(name, legacy_data, messages);
+ return buildFromLegacyPreset(LLURI::unescape(name), legacy_data, messages);
}
@@ -831,7 +831,7 @@ LLSettingsWater::ptr_t LLSettingsVOWater::buildFromLegacyPresetFile(const std::s
return ptr_t();
}
- return buildFromLegacyPreset(name, legacy_data, messages);
+ return buildFromLegacyPreset(LLURI::unescape(name), legacy_data, messages);
}
@@ -1101,8 +1101,8 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyPresetFile(const std::strin
LL_WARNS("SETTINGS") << "Could not load legacy Windlight \"" << name << "\" from " << path << LL_ENDL;
return ptr_t();
}
-
- return buildFromLegacyPreset(name, path, legacy_data, messages);
+ // Name for LLSettingsDay only, path to get related files from filesystem
+ return buildFromLegacyPreset(LLURI::unescape(name), path, legacy_data, messages);
}
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 2e54d3de39..c02105f82c 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -39,10 +39,6 @@
#include "llappviewer.h"
#include "llmemory.h"
-#if LL_WINDOWS
-#pragma optimize("", off)
-#endif
-
// Cache organization:
// cache/texture.entries
// Unordered array of Entry structs
@@ -1229,8 +1225,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create
{
readEntryFromHeaderImmediately(idx, entry) ;
}
- llassert(entry.mImageSize < 0 || entry.mImageSize > entry.mBodySize);
- /*if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why
+ if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why
{
LL_WARNS() << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << LL_ENDL ;
@@ -1239,7 +1234,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create
removeEntry(idx, entry, tex_filename) ;
mUpdatedEntryMap.erase(idx) ;
idx = -1 ;
- }*/
+ }
}
return idx;
}
@@ -1267,12 +1262,12 @@ void LLTextureCache::writeEntryToHeaderImmediately(S32& idx, Entry& entry, bool
{
aprfile = openHeaderEntriesFile(false, offset);
}
- llassert(entry.mImageSize > entry.mBodySize);
bytes_written = aprfile->write((void*)&entry, (S32)sizeof(Entry));
if(bytes_written != sizeof(Entry))
{
clearCorruptedCache() ; //clear the cache.
idx = -1 ;//mark the idx invalid.
+
return ;
}
@@ -1319,8 +1314,6 @@ void LLTextureCache::updateEntryTimeStamp(S32 idx, Entry& entry)
//update an existing entry, write to header file immediately.
bool LLTextureCache::updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 new_data_size)
{
- llassert(new_image_size >= new_data_size);
-
S32 new_body_size = llmax(0, new_data_size - TEXTURE_CACHE_ENTRY_SIZE) ;
if(new_image_size == entry.mImageSize && new_body_size == entry.mBodySize)
@@ -1409,10 +1402,6 @@ U32 LLTextureCache::openAndReadEntries(std::vector<Entry>& entries)
}
entries.push_back(entry);
// LL_INFOS() << "ENTRY: " << entry.mTime << " TEX: " << entry.mID << " IDX: " << idx << " Size: " << entry.mImageSize << LL_ENDL;
- if(entry.mImageSize < 0)
- {
- mFreeList.insert(idx);
- }
if(entry.mImageSize > entry.mBodySize)
{
mHeaderIDMap[entry.mID] = idx;
@@ -1837,8 +1826,6 @@ S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, Entry& entry)
// Writes imagesize to the header, updates timestamp
S32 LLTextureCache::setHeaderCacheEntry(const LLUUID& id, Entry& entry, S32 imagesize, S32 datasize)
{
- llassert(imagesize >= datasize);
-
mHeaderMutex.lock();
S32 idx = openAndReadEntry(id, entry, true); // read or create
mHeaderMutex.unlock();
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 bbba5ba729..0e3de821d1 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
@@ -21,6 +21,7 @@
auto_resize="true"
user_resize="false"
visible="true"
+ name="sun_layout"
height="400">
<text
follows="left|top"
@@ -209,6 +210,7 @@
auto_resize="true"
user_resize="false"
visible="true"
+ name="moon_layout"
height="220">
<text
follows="left|top"