diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llwlparammanager.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/linden/indra/newview/llwlparammanager.cpp b/linden/indra/newview/llwlparammanager.cpp index 31471d7..8007cce 100644 --- a/linden/indra/newview/llwlparammanager.cpp +++ b/linden/indra/newview/llwlparammanager.cpp | |||
@@ -71,11 +71,13 @@ | |||
71 | #include "llviewerinventory.h" | 71 | #include "llviewerinventory.h" |
72 | #include "llviewerregion.h" | 72 | #include "llviewerregion.h" |
73 | #include "llassetuploadresponders.h" | 73 | #include "llassetuploadresponders.h" |
74 | #include "llframetimer.h" | ||
74 | 75 | ||
75 | #include "curl/curl.h" | 76 | #include "curl/curl.h" |
76 | 77 | ||
77 | LLWLParamManager * LLWLParamManager::sInstance = NULL; | 78 | LLWLParamManager * LLWLParamManager::sInstance = NULL; |
78 | std::vector<LLWLPresetsObserver*> LLWLParamManager::sObservers; | 79 | std::vector<LLWLPresetsObserver*> LLWLParamManager::sObservers; |
80 | LLFrameTimer wlSmoothTransitionTimer; | ||
79 | 81 | ||
80 | LLWLParamManager::LLWLParamManager() : | 82 | LLWLParamManager::LLWLParamManager() : |
81 | 83 | ||
@@ -562,6 +564,46 @@ void LLWLParamManager::update(LLViewerCamera * cam) | |||
562 | } | 564 | } |
563 | } | 565 | } |
564 | } | 566 | } |
567 | |||
568 | //Mix windlight settings if needed | ||
569 | if(sNeedsMix == TRUE) | ||
570 | { | ||
571 | if(sMixSet == NULL) | ||
572 | { | ||
573 | sNeedsMix = FALSE; | ||
574 | return; | ||
575 | } | ||
576 | if (wlSmoothTransitionTimer.getElapsedTimeF32() >= | ||
577 | (sMixTime / 100)) //100 steps inbetween | ||
578 | { | ||
579 | wlSmoothTransitionTimer.reset(); | ||
580 | mCurParams.mix(mCurParams, *sMixSet, sMixCount / 100);//.01 to 1.0 | ||
581 | } | ||
582 | sMixCount++; | ||
583 | if((sMixCount / 100) == 1) | ||
584 | { | ||
585 | //All done | ||
586 | sNeedsMix = FALSE; | ||
587 | std::string wlSkyPresetName = "(Region settings)"; | ||
588 | mCurParams.mName = wlSkyPresetName; | ||
589 | removeParamSet( wlSkyPresetName, true ); | ||
590 | addParamSet( wlSkyPresetName, mCurParams ); | ||
591 | savePreset( wlSkyPresetName ); | ||
592 | mAnimator.mIsRunning = false; | ||
593 | mAnimator.mUseLindenTime = false; | ||
594 | loadPreset( wlSkyPresetName, true ); | ||
595 | sMixSet = NULL; | ||
596 | } | ||
597 | } | ||
598 | } | ||
599 | |||
600 | void LLWLParamManager::SetMixTime(LLWLParamSet *mixSet, F32 mixTime) | ||
601 | { | ||
602 | wlSmoothTransitionTimer.reset(); | ||
603 | sNeedsMix = TRUE; | ||
604 | sMixSet = mixSet; | ||
605 | sMixTime = mixTime; | ||
606 | sMixCount = 1; | ||
565 | } | 607 | } |
566 | 608 | ||
567 | // static | 609 | // static |