diff options
author | erorcun <erayorcunus@gmail.com> | 2020-05-22 14:24:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 14:24:08 +0200 |
commit | 4fd1771f7179bb29ce11fc8910ec527b5f74d2b0 (patch) | |
tree | b05a0255a5742a13e90a3a8f735190e4dd7f5706 /src/core/Camera.cpp | |
parent | Merge pull request #573 from Nick007J/miami (diff) | |
parent | VC CMenuManager struct, ctor etc. (diff) | |
download | re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.tar re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.tar.gz re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.tar.bz2 re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.tar.lz re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.tar.xz re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.tar.zst re3-4fd1771f7179bb29ce11fc8910ec527b5f74d2b0.zip |
Diffstat (limited to 'src/core/Camera.cpp')
-rw-r--r-- | src/core/Camera.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index fa5e44bb..486c2c9e 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -3037,33 +3037,25 @@ CCamera::SetNearClipScript(float clip) void CCamera::ProcessFade(void) { - float fade = (CTimer::GetTimeInMilliseconds() - m_uiFadeTimeStarted)/1000.0f; - // Why even set CDraw::FadeValue if m_fFLOATingFade sets it anyway? if(m_bFading){ if(m_iFadingDirection == FADE_IN){ if(m_fTimeToFadeOut != 0.0f){ - m_fFLOATingFade = 255.0f - 255.0f*fade/m_fTimeToFadeOut; - if(m_fFLOATingFade <= 0.0f){ - m_bFading = false; - CDraw::FadeValue = 0; - m_fFLOATingFade = 0.0f; - } + m_fFLOATingFade -= CTimer::GetTimeStepInSeconds() * 255.0f / m_fTimeToFadeOut; }else{ + m_fFLOATingFade = 0.0f; + } + if (m_fFLOATingFade <= 0.0f) { m_bFading = false; - CDraw::FadeValue = 0; m_fFLOATingFade = 0.0f; } }else if(m_iFadingDirection == FADE_OUT){ if(m_fTimeToFadeOut != 0.0f){ - m_fFLOATingFade = 255.0f*fade/m_fTimeToFadeOut; - if(m_fFLOATingFade >= 255.0f){ - m_bFading = false; - CDraw::FadeValue = 255; - m_fFLOATingFade = 255.0f; - } + m_fFLOATingFade += CTimer::GetTimeStepInSeconds() * 255.0f / m_fTimeToFadeOut; }else{ + m_fFLOATingFade = 255.0f; + } + if (m_fFLOATingFade >= 255.0f) { m_bFading = false; - CDraw::FadeValue = 255; m_fFLOATingFade = 255.0f; } } |