summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-11-12 20:11:00 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-11-12 20:11:00 +0200
commitbda785e8b1bef35ecd9d45a7092b0ab66c17d1f4 (patch)
tree541282049bc9ea468724e44012dc74dd0649d136 /indra/newview
parent1143edc42e04981cc9754227ea2a3999da6b770f (diff)
SL-10033 [EEP] Use fast environment transition for teleports
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llenvironment.cpp14
-rw-r--r--indra/newview/llenvironment.h2
-rw-r--r--indra/newview/llviewerparcelmgr.cpp8
-rw-r--r--indra/newview/llviewerparcelmgr.h1
4 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 6bc7b8bf25..530dc79fe9 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -973,7 +973,7 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader)
}
}
-void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo)
+void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition)
{
if (envinfo->mParcelId == INVALID_PARCEL_ID)
{
@@ -1027,8 +1027,8 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI
setEnvironment(ENV_PARCEL, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset);
}
}
-
- updateEnvironment();
+
+ updateEnvironment(transition);
}
//=========================================================================
@@ -1078,9 +1078,10 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb)
{
if (!cb)
{
- cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo)
+ LLSettingsBase::Seconds transition = LLViewerParcelMgr::getInstance()->getTeleportInProgress() ? TRANSITION_FAST : TRANSITION_DEFAULT;
+ cb = [this, transition](S32 pid, EnvironmentInfo::ptr_t envinfo)
{
- recordEnvironment(pid, envinfo);
+ recordEnvironment(pid, envinfo, transition);
};
}
@@ -1093,7 +1094,8 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb)
if (!cb)
{
- cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); };
+ LLSettingsBase::Seconds transition = LLViewerParcelMgr::getInstance()->getTeleportInProgress() ? TRANSITION_FAST : TRANSITION_DEFAULT;
+ cb = [this, transition](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo, transition); };
}
std::string coroname =
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 9e943cce00..a72a08c68e 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -360,7 +360,7 @@ private:
void coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInfo::ptr_t updates, environment_apply_fn apply);
void coroResetEnvironment(S32 parcel_id, S32 track_no, environment_apply_fn apply);
- void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment);
+ void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment, LLSettingsBase::Seconds transition);
void onAgentPositionHasChanged(const LLVector3 &localpos);
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 0d077161a6..cca02544ee 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1659,7 +1659,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
if (instance->mTeleportInProgress)
{
- instance->mTeleportInProgress = FALSE;
if(instance->mTeleportInProgressPosition.isNull())
{
//initial update
@@ -1674,6 +1673,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
LL_WARNS("LAPRAS") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL;
// Notify anything that wants to know when the agent changes parcels
gAgent.changeParcels();
+ instance->mTeleportInProgress = FALSE;
}
else if (agent_parcel_update)
{
@@ -2576,3 +2576,9 @@ void LLViewerParcelMgr::onTeleportFailed()
{
mTeleportFailedSignal();
}
+
+bool LLViewerParcelMgr::getTeleportInProgress()
+{
+ return mTeleportInProgress // case where parcel data arrives after teleport
+ || gAgent.getTeleportState() > LLAgent::TELEPORT_NONE; // For LOCAL, no mTeleportInProgress
+}
diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h
index 336a3ea228..ec8dde7d40 100644
--- a/indra/newview/llviewerparcelmgr.h
+++ b/indra/newview/llviewerparcelmgr.h
@@ -287,6 +287,7 @@ public:
boost::signals2::connection setTeleportFailedCallback(teleport_failed_callback_t cb);
void onTeleportFinished(bool local, const LLVector3d& new_pos);
void onTeleportFailed();
+ bool getTeleportInProgress();
static BOOL isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power);
static BOOL isParcelModifiableByAgent(const LLParcel* parcelp, U64 group_proxy_power);