diff options
author | Graham Linden <graham@lindenlab.com> | 2018-06-01 23:32:30 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-06-01 23:32:30 +0100 |
commit | 8cfdc07e790a557e881fadaa1b6258e5b16751f4 (patch) | |
tree | a792d0e6f03886f4a3d8f064811fdcbbf2ce1a61 /indra/newview | |
parent | 8dd85013865cc5b426234cd71b605d7208bcfe01 (diff) |
Code cleanup and move to using typedefs of S64Seconds/F64Seconds for ease in sync w/ sim side which has not llunits types.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llenvironment.cpp | 60 | ||||
-rw-r--r-- | indra/newview/llenvironment.h | 48 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterland.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 4 |
6 files changed, 61 insertions, 61 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 2650f69a2f..b7aff6bca9 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -125,8 +125,8 @@ namespace class LLTrackBlenderLoopingTime : public LLSettingsBlenderTimeDelta { public: - LLTrackBlenderLoopingTime(const LLSettingsBase::ptr_t &target, const LLSettingsDay::ptr_t &day, S32 trackno, F64Seconds cyclelength, F64Seconds cycleoffset) : - LLSettingsBlenderTimeDelta(target, LLSettingsBase::ptr_t(), LLSettingsBase::ptr_t(), F64Seconds(1.0)), + LLTrackBlenderLoopingTime(const LLSettingsBase::ptr_t &target, const LLSettingsDay::ptr_t &day, S32 trackno, LLSettingsBase::Seconds cyclelength, LLSettingsBase::Seconds cycleoffset) : + LLSettingsBlenderTimeDelta(target, LLSettingsBase::ptr_t(), LLSettingsBase::ptr_t(), LLSettingsBase::Seconds(1.0)), mDay(day), mTrackNo(0), mCycleLength(cyclelength), @@ -156,7 +156,7 @@ namespace mTrackTransitionStart = mTarget->buildDerivedClone(); mTrackNo = use_trackno; - F64Seconds now = getAdjustedNow() + LLEnvironment::TRANSITION_ALTITUDE; + LLSettingsBase::Seconds now = getAdjustedNow() + LLEnvironment::TRANSITION_ALTITUDE; LLSettingsDay::TrackBound_t bounds = getBoundingEntries(now); LLSettingsBase::ptr_t pendsetting = (*bounds.first).second->buildDerivedClone(); @@ -189,7 +189,7 @@ namespace return 1; } - LLSettingsDay::TrackBound_t getBoundingEntries(F64Seconds time) + LLSettingsDay::TrackBound_t getBoundingEntries(LLSettingsBase::Seconds time) { LLSettingsDay::CycleTrack_t &wtrack = mDay->getCycleTrack(mTrackNo); F64 position = convertTimeToPosition(time); @@ -198,19 +198,19 @@ namespace return bounds; } - F64Seconds getAdjustedNow() const + LLSettingsBase::Seconds getAdjustedNow() const { - F64Seconds now(LLDate::now().secondsSinceEpoch()); + LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch()); return (now + mCycleOffset); } - F64Seconds getSpanTime(const LLSettingsDay::TrackBound_t &bounds) const + LLSettingsBase::Seconds getSpanTime(const LLSettingsDay::TrackBound_t &bounds) const { return mCycleLength * get_wrapping_distance((*bounds.first).first, (*bounds.second).first); } - F64 convertTimeToPosition(F64Seconds time) + F64 convertTimeToPosition(LLSettingsBase::Seconds time) { F64 position = static_cast<F64>(fmod(time.value(), mCycleLength.value())) / static_cast<F64>(mCycleLength.value()); return llclamp(position, 0.0, 1.0); @@ -219,14 +219,14 @@ namespace private: LLSettingsDay::ptr_t mDay; S32 mTrackNo; - F64Seconds mCycleLength; - F64Seconds mCycleOffset; + LLSettingsBase::Seconds mCycleLength; + LLSettingsBase::Seconds mCycleOffset; LLSettingsBase::ptr_t mTrackTransitionStart; void onFinishedSpan() { LLSettingsDay::TrackBound_t next = getBoundingEntries(getAdjustedNow()); - F64Seconds nextspan = getSpanTime(next); + LLSettingsBase::Seconds nextspan = getSpanTime(next); reset((*next.first).second, (*next.second).second, nextspan.value()); } }; @@ -442,7 +442,7 @@ bool LLEnvironment::getIsMoonUp() const } //------------------------------------------------------------------------- -void LLEnvironment::setSelectedEnvironment(LLEnvironment::EnvSelection_t env, F64Seconds transition, bool forced) +void LLEnvironment::setSelectedEnvironment(LLEnvironment::EnvSelection_t env, LLSettingsBase::Seconds transition, bool forced) { mSelectedEnvironment = env; updateEnvironment(transition, forced); @@ -472,7 +472,7 @@ LLEnvironment::DayInstance::ptr_t LLEnvironment::getEnvironmentInstance(LLEnviro } -void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsDay::ptr_t &pday, S64Seconds daylength, S64Seconds dayoffset) +void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset) { if ((env < ENV_EDIT) || (env >= ENV_DEFAULT)) { @@ -525,8 +525,8 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe if (settings->getSettingType() == "daycycle") { - S64Seconds daylength(LLSettingsDay::DEFAULT_DAYLENGTH); - S64Seconds dayoffset(LLSettingsDay::DEFAULT_DAYOFFSET); + LLSettingsDay::Seconds daylength(LLSettingsDay::DEFAULT_DAYLENGTH); + LLSettingsDay::Seconds dayoffset(LLSettingsDay::DEFAULT_DAYOFFSET); if (environment) { daylength = environment->getDayLength(); @@ -583,12 +583,12 @@ LLSettingsDay::ptr_t LLEnvironment::getEnvironmentDay(LLEnvironment::EnvSelectio return LLSettingsDay::ptr_t(); } -S64Seconds LLEnvironment::getEnvironmentDayLength(EnvSelection_t env) +LLSettingsDay::Seconds LLEnvironment::getEnvironmentDayLength(EnvSelection_t env) { if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; - return S64Seconds(0); + return LLSettingsDay::Seconds(0); } DayInstance::ptr_t environment = getEnvironmentInstance(env); @@ -596,22 +596,22 @@ S64Seconds LLEnvironment::getEnvironmentDayLength(EnvSelection_t env) if (environment) return environment->getDayLength(); - return S64Seconds(0); + return LLSettingsDay::Seconds(0); } -S64Seconds LLEnvironment::getEnvironmentDayOffset(EnvSelection_t env) +LLSettingsDay::Seconds LLEnvironment::getEnvironmentDayOffset(EnvSelection_t env) { if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; - return S64Seconds(0); + return LLSettingsDay::Seconds(0); } DayInstance::ptr_t environment = getEnvironmentInstance(env); if (environment) return environment->getDayOffset(); - return S64Seconds(0); + return LLSettingsDay::Seconds(0); } @@ -670,7 +670,7 @@ LLEnvironment::DayInstance::ptr_t LLEnvironment::getSelectedEnvironmentInstance( } -void LLEnvironment::updateEnvironment(F64Seconds transition, bool forced) +void LLEnvironment::updateEnvironment(LLSettingsBase::Seconds transition, bool forced) { DayInstance::ptr_t pinstance = getSelectedEnvironmentInstance(); @@ -1365,9 +1365,9 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL if (environment.has("region_id")) pinfo->mRegionId = environment["region_id"].asUUID(); if (environment.has("day_length")) - pinfo->mDayLength = S64Seconds(environment["day_length"].asInteger()); + pinfo->mDayLength = LLSettingsDay::Seconds(environment["day_length"].asInteger()); if (environment.has("day_offset")) - pinfo->mDayOffset = S64Seconds(environment["day_offset"].asInteger()); + pinfo->mDayOffset = LLSettingsDay::Seconds(environment["day_offset"].asInteger()); if (environment.has("day_hash")) pinfo->mDayHash = environment["day_hash"].asInteger(); if (environment.has("day_cycle")) @@ -1643,7 +1643,7 @@ LLEnvironment::DayInstance::DayInstance() : mSkyTrack(1) { } -void LLEnvironment::DayInstance::update(F64Seconds delta) +void LLEnvironment::DayInstance::update(LLSettingsBase::Seconds delta) { if (!mInitialized) initialize(); @@ -1659,7 +1659,7 @@ void LLEnvironment::DayInstance::update(F64Seconds delta) // mWater->update(); } -void LLEnvironment::DayInstance::setDay(const LLSettingsDay::ptr_t &pday, S64Seconds daylength, S64Seconds dayoffset) +void LLEnvironment::DayInstance::setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset) { if (mType == TYPE_FIXED) LL_WARNS("ENVIRONMENT") << "Fixed day instance changed to Cycled" << LL_ENDL; @@ -1750,7 +1750,7 @@ void LLEnvironment::DayInstance::setBlenders(const LLSettingsBlender::ptr_t &sky mBlenderWater = waterblend; } -F64 LLEnvironment::DayInstance::secondsToKeyframe(S64Seconds seconds) +F64 LLEnvironment::DayInstance::secondsToKeyframe(LLSettingsDay::Seconds seconds) { F64 frame = static_cast<F64>(seconds.value() % mDayLength.value()) / static_cast<F64>(mDayLength.value()); @@ -1759,7 +1759,7 @@ F64 LLEnvironment::DayInstance::secondsToKeyframe(S64Seconds seconds) void LLEnvironment::DayInstance::animate() { - F64Seconds now(LLDate::now().secondsSinceEpoch()); + LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch()); now += mDayOffset; @@ -1807,7 +1807,7 @@ void LLEnvironment::DayInstance::animate() //------------------------------------------------------------------------- LLEnvironment::DayTransition::DayTransition(const LLSettingsSky::ptr_t &skystart, - const LLSettingsWater::ptr_t &waterstart, LLEnvironment::DayInstance::ptr_t &end, S64Seconds time) : + const LLSettingsWater::ptr_t &waterstart, LLEnvironment::DayInstance::ptr_t &end, LLSettingsDay::Seconds time) : DayInstance(), mStartSky(skystart), mStartWater(waterstart), @@ -1817,7 +1817,7 @@ LLEnvironment::DayTransition::DayTransition(const LLSettingsSky::ptr_t &skystart } -void LLEnvironment::DayTransition::update(F64Seconds delta) +void LLEnvironment::DayTransition::update(LLSettingsBase::Seconds delta) { mNextInstance->update(delta); DayInstance::update(delta); diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 0fbc49bc7d..52f22ac8f1 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -62,15 +62,15 @@ public: typedef std::shared_ptr<EnvironmentInfo> ptr_t; - S32 mParcelId; - LLUUID mRegionId; - S64Seconds mDayLength; - S64Seconds mDayOffset; - size_t mDayHash; - LLSD mDaycycleData; - std::array<F32, 4> mAltitudes; - bool mIsDefault; - bool mIsRegion; + S32 mParcelId; + LLUUID mRegionId; + LLSettingsDay::Seconds mDayLength; + LLSettingsDay::Seconds mDayOffset; + size_t mDayHash; + LLSD mDaycycleData; + std::array<F32, 4> mAltitudes; + bool mIsDefault; + bool mIsRegion; static ptr_t extract(LLSD); @@ -152,11 +152,11 @@ public: void updateGLVariablesForSettings(LLGLSLShader *shader, const LLSettingsBase::ptr_t &psetting); void updateShaderUniforms(LLGLSLShader *shader); - void setSelectedEnvironment(EnvSelection_t env, F64Seconds transition = TRANSITION_DEFAULT, bool forced = false); + void setSelectedEnvironment(EnvSelection_t env, LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, bool forced = false); EnvSelection_t getSelectedEnvironment() const { return mSelectedEnvironment; } bool hasEnvironment(EnvSelection_t env); - void setEnvironment(EnvSelection_t env, const LLSettingsDay::ptr_t &pday, S64Seconds daylength, S64Seconds dayoffset); + void setEnvironment(EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); void setEnvironment(EnvSelection_t env, fixedEnvironment_t fixed); void setEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &fixed); void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t())); } @@ -164,13 +164,13 @@ public: void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw)); } void clearEnvironment(EnvSelection_t env); LLSettingsDay::ptr_t getEnvironmentDay(EnvSelection_t env); - S64Seconds getEnvironmentDayLength(EnvSelection_t env); - S64Seconds getEnvironmentDayOffset(EnvSelection_t env); + LLSettingsDay::Seconds getEnvironmentDayLength(EnvSelection_t env); + LLSettingsDay::Seconds getEnvironmentDayOffset(EnvSelection_t env); fixedEnvironment_t getEnvironmentFixed(EnvSelection_t env); LLSettingsSky::ptr_t getEnvironmentFixedSky(EnvSelection_t env) { return getEnvironmentFixed(env).first; }; LLSettingsWater::ptr_t getEnvironmentFixedWater(EnvSelection_t env) { return getEnvironmentFixed(env).second; }; - void updateEnvironment(F64Seconds transition = TRANSITION_DEFAULT, bool forced = false); + void updateEnvironment(LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, bool forced = false); void addSky(const LLSettingsSky::ptr_t &sky); void addWater(const LLSettingsWater::ptr_t &sky); @@ -253,9 +253,9 @@ private: DayInstance(); virtual ~DayInstance() { }; - virtual void update(F64Seconds); + virtual void update(LLSettingsBase::Seconds); - void setDay(const LLSettingsDay::ptr_t &pday, S64Seconds daylength, S64Seconds dayoffset); + void setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); void setSky(const LLSettingsSky::ptr_t &psky); void setWater(const LLSettingsWater::ptr_t &pwater); @@ -269,8 +269,8 @@ private: LLSettingsDay::ptr_t getDayCycle() const { return mDayCycle; } LLSettingsSky::ptr_t getSky() const { return mSky; } LLSettingsWater::ptr_t getWater() const { return mWater; } - S64Seconds getDayLength() const { return mDayLength; } - S64Seconds getDayOffset() const { return mDayOffset; } + LLSettingsDay::Seconds getDayLength() const { return mDayLength; } + LLSettingsDay::Seconds getDayOffset() const { return mDayOffset; } S32 getSkyTrack() const { return mSkyTrack; } virtual void animate(); @@ -286,14 +286,14 @@ private: InstanceType_t mType; bool mInitialized; - S64Seconds mDayLength; - S64Seconds mDayOffset; + LLSettingsDay::Seconds mDayLength; + LLSettingsDay::Seconds mDayOffset; S32 mLastTrackAltitude; LLSettingsBlender::ptr_t mBlenderSky; LLSettingsBlender::ptr_t mBlenderWater; - F64 secondsToKeyframe(S64Seconds seconds); + F64 secondsToKeyframe(LLSettingsDay::Seconds seconds); }; typedef std::array<DayInstance::ptr_t, ENV_END> InstanceArray_t; @@ -301,17 +301,17 @@ private: class DayTransition : public DayInstance { public: - DayTransition(const LLSettingsSky::ptr_t &skystart, const LLSettingsWater::ptr_t &waterstart, DayInstance::ptr_t &end, S64Seconds time); + DayTransition(const LLSettingsSky::ptr_t &skystart, const LLSettingsWater::ptr_t &waterstart, DayInstance::ptr_t &end, LLSettingsDay::Seconds time); virtual ~DayTransition() { }; - virtual void update(F64Seconds); + virtual void update(LLSettingsBase::Seconds); virtual void animate(); protected: LLSettingsSky::ptr_t mStartSky; LLSettingsWater::ptr_t mStartWater; DayInstance::ptr_t mNextInstance; - S64Seconds mTransitionTime; + LLSettingsDay::Seconds mTransitionTime; }; static const F32 SUN_DELTA_YAW; diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 706dd99fc9..543f6e5671 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -192,7 +192,7 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key) { S32Hours hrs; S32Minutes minutes; - S64Seconds total; + LLSettingsDay::Seconds total; LLUIString formatted_label = getString("time_label"); for (int i = 0; i < max_elm; i++) { @@ -700,7 +700,7 @@ void LLFloaterEditExtDayCycle::updateTimeAndLabel() { LLUIString formatted_label = getString("time_label"); - S64Seconds total = (mDayLength * time); + LLSettingsDay::Seconds total = (mDayLength * time); S32Hours hrs = total; S32Minutes minutes = total - hrs; diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index bee5e17b95..fc0b4f5106 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -138,7 +138,7 @@ private: static void onIdlePlay(void *); LLSettingsDay::ptr_t mEditDay; // edited copy - S64Seconds mDayLength; + LLSettingsDay::Seconds mDayLength; U32 mCurrentTrack; std::string mLastFrameSlider; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 39dada1984..ac47253444 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3325,7 +3325,7 @@ void LLPanelLandEnvironment::doApply() } else { - S64Seconds daylength; + LLSettingsDay::Seconds daylength; F32Hours dayoffset_h; daylength = F32Hours(mDayLengthSlider->getValueF32()); @@ -3336,7 +3336,7 @@ void LLPanelLandEnvironment::doApply() dayoffset_h = F32Hours(24.0f) + dayoffset_h; } - S64Seconds dayoffset_s = dayoffset_h; + LLSettingsDay::Seconds dayoffset_s = dayoffset_h; LLEnvironment::instance().updateParcel(parcel_id, mEditingDayCycle, daylength.value(), dayoffset_s.value()); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 272ac8a1bb..6719e6ed3b 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3426,7 +3426,7 @@ void LLPanelRegionEnvironment::doApply() } else { - S64Seconds daylength; + LLSettingsDay::Seconds daylength; F32Hours dayoffset_h; daylength = F32Hours(mDayLengthSlider->getValueF32()); @@ -3437,7 +3437,7 @@ void LLPanelRegionEnvironment::doApply() dayoffset_h = F32Hours(24.0f) + dayoffset_h; } - S64Seconds dayoffset_s = dayoffset_h; + LLSettingsDay::Seconds dayoffset_s = dayoffset_h; LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value()); } |