From a4d9d0360155a8ddadd52d3bec60c7711a411d68 Mon Sep 17 00:00:00 2001 From: Julien Templier Date: Mon, 15 Nov 2010 15:48:08 +0000 Subject: LASTEXPRESS: Update Animation::process() - Use Common::Rational to compute the current frame - Added check for _currentChunk != NULL - Add constructor to Chunk structure svn-id: r54245 --- engines/lastexpress/data/animation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/lastexpress/data/animation.cpp') diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 3f1383022f..5ac9f8bf00 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -34,6 +34,8 @@ #include "lastexpress/helpers.h" #include "common/events.h" +#include "common/rational.h" + #include "engines/engine.h" namespace LastExpress { @@ -104,10 +106,10 @@ bool Animation::process() { error("Trying to show an animation before loading data"); // TODO: substract the time paused by the GUI - uint32 currentFrame = (uint32)(((float)(g_engine->_system->getMillis() - _startTime)) / 33.33f); + int32 currentFrame = Common::Rational((g_engine->_system->getMillis() - _startTime) * 100, 3333).toInt(); // Process all chunks until the current frame - while (!_changed && currentFrame > _currentChunk->frame && !hasEnded()) { + while (!_changed && _currentChunk != NULL && currentFrame > _currentChunk->frame && !hasEnded()) { switch(_currentChunk->type) { //TODO: some info chunks are probably subtitle/sync related case kChunkTypeUnknown1: -- cgit v1.2.3