WindLightRefresh added for compliance with Aurora's windlight event system.

This commit is contained in:
Lirusaito
2013-01-01 18:09:45 -05:00
parent 194902798b
commit b85d282dfb
3 changed files with 47 additions and 3 deletions

View File

@@ -378,6 +378,14 @@
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>
<key>WindLightRefresh</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>ParcelVoiceInfo</key> <key>ParcelVoiceInfo</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
@@ -386,7 +394,6 @@
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>
<key>ParcelNavigateMedia</key> <key>ParcelNavigateMedia</key>
<map> <map>
<key>flavor</key> <key>flavor</key>

View File

@@ -47,6 +47,8 @@
#include "rlvhandler.h" #include "rlvhandler.h"
// [/RLVa:KB] // [/RLVa:KB]
#include "hippogridmanager.h"
std::string LLEnvPrefs::getWaterPresetName() const std::string LLEnvPrefs::getWaterPresetName() const
{ {
if (mWaterPresetName.empty()) if (mWaterPresetName.empty())
@@ -509,7 +511,8 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content)
mRegionSettingsChangeSignal(); mRegionSettingsChangeSignal();
// reset // reset
mInterpNextChangeMessage = false; if (!gHippoGridManager->getConnectedGrid()->isAurora()) // On Aurora, the region says when to refresh
mInterpNextChangeMessage = false;
} }
void LLEnvManagerNew::onRegionSettingsApplyResponse(bool ok) void LLEnvManagerNew::onRegionSettingsApplyResponse(bool ok)
@@ -698,3 +701,36 @@ void LLEnvManagerNew::onRegionChange(bool interpolate)
// Let interested parties know agent region has been changed. // Let interested parties know agent region has been changed.
mRegionChangeSignal(); mRegionChangeSignal();
} }
// Aurora-sim windlight refresh
class WindLightRefresh : public LLHTTPNode
{
/*virtual*/ void post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const
{
if (!input || !context || !input.isMap() || !input.has("body"))
{
llinfos << "malformed WindLightRefresh!" << llendl;
return;
}
//std::string dump = input["body"].asString();
//llwarns << dump << llendl;
LLSD body = input["body"];
LLEnvManagerNew *env = &LLEnvManagerNew::instance();
LLViewerRegion* regionp = gAgent.getRegion();
LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null;
env->mNewRegionPrefs.clear();
env->mCurRegionUUID = region_uuid;
env->mInterpNextChangeMessage = !body.has("Interpolate") || body["Interpolate"].asInteger() == 1;
llinfos << "Windlight Refresh, interpolate:" << env->mInterpNextChangeMessage << llendl;
env->requestRegionSettings();
env->mRegionChangeSignal();
}
};
LLHTTPRegistration<WindLightRefresh> gHTTPRegistrationWindLightRefresh("/message/WindLightRefresh");

View File

@@ -35,11 +35,11 @@
#include "llmemory.h" #include "llmemory.h"
#include "llsd.h" #include "llsd.h"
#include <boost/signals2.hpp>
class LLWLParamManager; class LLWLParamManager;
class LLWaterParamManager; class LLWaterParamManager;
class LLWLAnimator; class LLWLAnimator;
class WindLightRefresh;
// generic key // generic key
struct LLEnvKey struct LLEnvKey
@@ -257,6 +257,7 @@ public:
bool useRegionWater(); bool useRegionWater();
private: private:
friend class WindLightRefresh;
bool useDefaultSky(); bool useDefaultSky();
bool useDefaultWater(); bool useDefaultWater();