[Scummvm-cvs-logs] SF.net SVN: scummvm:[54245] scummvm/trunk/engines/lastexpress/data
littleboy at users.sourceforge.net
littleboy at users.sourceforge.net
Mon Nov 15 16:48:09 CET 2010
Revision: 54245
http://scummvm.svn.sourceforge.net/scummvm/?rev=54245&view=rev
Author: littleboy
Date: 2010-11-15 15:48:08 +0000 (Mon, 15 Nov 2010)
Log Message:
-----------
LASTEXPRESS: Update Animation::process()
- Use Common::Rational to compute the current frame
- Added check for _currentChunk != NULL
- Add constructor to Chunk structure
Modified Paths:
--------------
scummvm/trunk/engines/lastexpress/data/animation.cpp
scummvm/trunk/engines/lastexpress/data/animation.h
Modified: scummvm/trunk/engines/lastexpress/data/animation.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/data/animation.cpp 2010-11-15 15:20:48 UTC (rev 54244)
+++ scummvm/trunk/engines/lastexpress/data/animation.cpp 2010-11-15 15:48:08 UTC (rev 54245)
@@ -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 @@
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:
Modified: scummvm/trunk/engines/lastexpress/data/animation.h
===================================================================
--- scummvm/trunk/engines/lastexpress/data/animation.h 2010-11-15 15:20:48 UTC (rev 54244)
+++ scummvm/trunk/engines/lastexpress/data/animation.h 2010-11-15 15:48:08 UTC (rev 54245)
@@ -69,6 +69,7 @@
// despite their size field, info chunks don't have a payload
enum ChunkType {
+ kChunkTypeNone = 0,
kChunkTypeUnknown1 = 1,
kChunkTypeUnknown2 = 2,
kChunkTypeAudioInfo = 3,
@@ -91,6 +92,12 @@
ChunkType type;
uint16 frame;
uint32 size;
+
+ Chunk() {
+ type = kChunkTypeNone;
+ frame = 0;
+ size = 0;
+ }
};
void reset();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list