From bb1c8c3f51cd9856fc3e1629cf31c8f9539221c8 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 12 Sep 2010 18:31:10 +0000 Subject: VIDEO: Fix rounding the Smacker frame rate _frameRate is now stored using Common::Rational instead of uint32. svn-id: r52689 --- graphics/video/smk_decoder.cpp | 4 ++-- graphics/video/smk_decoder.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/graphics/video/smk_decoder.cpp b/graphics/video/smk_decoder.cpp index 4d03305cce..504f92cc3a 100644 --- a/graphics/video/smk_decoder.cpp +++ b/graphics/video/smk_decoder.cpp @@ -390,9 +390,9 @@ bool SmackerDecoder::load(Common::SeekableReadStream *stream) { int32 frameRate = _fileStream->readSint32LE(); if (frameRate > 0) - _frameRate = 1000 / frameRate; + _frameRate = Common::Rational(1000, frameRate); else if (frameRate < 0) - _frameRate = 100000 / (-frameRate); + _frameRate = Common::Rational(100000, -frameRate); else _frameRate = 10; diff --git a/graphics/video/smk_decoder.h b/graphics/video/smk_decoder.h index 43bb84a4f8..516fd5aab6 100644 --- a/graphics/video/smk_decoder.h +++ b/graphics/video/smk_decoder.h @@ -120,7 +120,7 @@ private: byte *_palette; bool _dirtyPalette; - uint32 _frameRate; + Common::Rational _frameRate; uint32 _frameCount; Surface *_surface; -- cgit v1.2.3