From 314cda05c7cda9afb05b4b9176dc94dcc16ac760 Mon Sep 17 00:00:00 2001 From: SushiTee Date: Tue, 19 Oct 2010 13:37:36 +0200 Subject: changed demo animations according to demo speed and added some demo speeds. (fixes #206) --- src/game/client/components/particles.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/game/client/components/particles.cpp') 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 #include +#include #include #include @@ -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; } -- cgit 1.4.1