Mercurial > fife-parpg
diff engine/core/util/time/timeevent.cpp @ 484:e584b0b8b4a2
Added SoundEmitter::getDecodedLength and SoundEmitter::getDuration. The getDuration function will allow a timer to be registered to fire after the sound has been played. This is not a callback as requested but it does provide the functionality if required. I will be committing an example of it in the shooter demo shortly. [t:346]
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 30 Apr 2010 15:33:27 +0000 |
parents | 90005975cdbb |
children |
line wrap: on
line diff
--- a/engine/core/util/time/timeevent.cpp Thu Apr 29 16:09:56 2010 +0000 +++ b/engine/core/util/time/timeevent.cpp Fri Apr 30 15:33:27 2010 +0000 @@ -29,13 +29,14 @@ // These includes are split up in two parts, separated by one empty line // First block: files included from the FIFE root src directory // Second block: files included from the same folder +#include "timemanager.h" #include "timeevent.h" namespace FIFE { TimeEvent::TimeEvent(int period): m_period(period), - m_last_updated(SDL_GetTicks()) { + m_last_updated(TimeManager::instance()->getTime()) { } TimeEvent::~TimeEvent() { @@ -47,7 +48,7 @@ if (m_period < 0) { return; } else if (m_period == 0 || time_delta >= m_period) { - updateEvent(time); + updateEvent(time_delta); m_last_updated = time; } } @@ -68,5 +69,5 @@ m_last_updated = ms; } - + } //FIFE