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/particles.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/particles.cpp')
| -rw-r--r-- | src/game/client/components/particles.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/game/client/components/particles.cpp b/src/game/client/components/particles.cpp index 99c2c721..c12231ca 100644 --- a/src/game/client/components/particles.cpp +++ b/src/game/client/components/particles.cpp @@ -1,5 +1,6 @@ #include <base/math.h> #include <engine/graphics.h> +#include <engine/demo.h> #include <game/generated/client_data.h> #include <game/client/render.h> @@ -120,7 +121,16 @@ void CParticles::OnRender() { static int64 LastTime = 0; int64 t = time_get(); - Update((float)((t-LastTime)/(double)time_freq())); + + if(Client()->State() == IClient::STATE_DEMOPLAYBACK) + { + const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo(); + if(!pInfo->m_Paused) + Update((float)((t-LastTime)/(double)time_freq())*pInfo->m_Speed); + } + else + Update((float)((t-LastTime)/(double)time_freq())); + LastTime = t; } |