diff options
| author | SushiTee <weichel.sascha@gmail.com> | 2010-10-19 13:37:36 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-10-19 18:52:16 +0200 |
| commit | 314cda05c7cda9afb05b4b9176dc94dcc16ac760 (patch) | |
| tree | 40c593ca144d76ed7ea57ec8c27f1d74c9a54e39 /src/game/client/components/effects.cpp | |
| parent | d7a8b94f772d7811b9b96be0b4f3dd8bff775ac3 (diff) | |
| download | zcatch-314cda05c7cda9afb05b4b9176dc94dcc16ac760.tar.gz zcatch-314cda05c7cda9afb05b4b9176dc94dcc16ac760.zip | |
changed demo animations according to demo speed and added some demo speeds. (fixes #206)
Diffstat (limited to 'src/game/client/components/effects.cpp')
| -rw-r--r-- | src/game/client/components/effects.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/game/client/components/effects.cpp b/src/game/client/components/effects.cpp index 91cea107..b95d66e0 100644 --- a/src/game/client/components/effects.cpp +++ b/src/game/client/components/effects.cpp @@ -1,3 +1,5 @@ +#include <engine/demo.h> + #include <game/generated/client_data.h> #include <game/client/components/particles.h> @@ -238,6 +240,32 @@ void CEffects::OnRender() static int64 LastUpdate100hz = 0; static int64 LastUpdate50hz = 0; + if(Client()->State() == IClient::STATE_DEMOPLAYBACK) + { + const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo(); + + if(time_get()-LastUpdate100hz > time_freq()/(100*pInfo->m_Speed)) + { + m_Add100hz = true; + LastUpdate100hz = time_get(); + } + else + m_Add100hz = false; + + if(time_get()-LastUpdate50hz > time_freq()/(100*pInfo->m_Speed)) + { + m_Add50hz = true; + LastUpdate50hz = time_get(); + } + else + m_Add50hz = false; + + if(m_Add50hz) + m_pClient->m_pFlow->Update(); + + return; + } + if(time_get()-LastUpdate100hz > time_freq()/100) { m_Add100hz = true; |