diff options
author | Alejandro Marzini | 2010-08-06 03:21:21 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-08-06 03:21:21 +0000 |
commit | 33e40e1a20c4cc60031854c87d6da5e461f9eb73 (patch) | |
tree | f76425d516e75d147ffbbacbec3fad49297da1b1 /graphics | |
parent | f97809a9a62a2d8840229facb2c2b6f75e37bad3 (diff) | |
parent | 6c8bcd2ba1cad1312f0a588ca284110bbbb81ccc (diff) | |
download | scummvm-rg350-33e40e1a20c4cc60031854c87d6da5e461f9eb73.tar.gz scummvm-rg350-33e40e1a20c4cc60031854c87d6da5e461f9eb73.tar.bz2 scummvm-rg350-33e40e1a20c4cc60031854c87d6da5e461f9eb73.zip |
Merged from trunk, from r51495 to r51775
svn-id: r51776
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/font.cpp | 8 | ||||
-rw-r--r-- | graphics/thumbnail.cpp | 2 | ||||
-rw-r--r-- | graphics/thumbnail.h | 6 | ||||
-rw-r--r-- | graphics/video/avi_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/avi_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.cpp | 12 | ||||
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.h | 16 | ||||
-rw-r--r-- | graphics/video/dxa_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/dxa_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/flic_decoder.cpp | 19 | ||||
-rw-r--r-- | graphics/video/flic_decoder.h | 6 | ||||
-rw-r--r-- | graphics/video/qt_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/qt_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/smk_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/smk_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/video_decoder.cpp | 11 | ||||
-rw-r--r-- | graphics/video/video_decoder.h | 2 |
17 files changed, 53 insertions, 53 deletions
diff --git a/graphics/font.cpp b/graphics/font.cpp index 629f2f4b82..74247d4da1 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -609,8 +609,8 @@ bool NewFont::cacheFontData(const NewFont &font, const Common::String &filename) cacheFile.writeUint16BE(font.desc.height); cacheFile.writeUint16BE(font.desc.fbbw); cacheFile.writeUint16BE(font.desc.fbbh); - cacheFile.writeUint16BE(font.desc.fbbx); - cacheFile.writeUint16BE(font.desc.fbby); + cacheFile.writeSint16BE(font.desc.fbbx); + cacheFile.writeSint16BE(font.desc.fbby); cacheFile.writeUint16BE(font.desc.ascent); cacheFile.writeUint16BE(font.desc.firstchar); cacheFile.writeUint16BE(font.desc.size); @@ -667,8 +667,8 @@ NewFont *NewFont::loadFromCache(Common::SeekableReadStream &stream) { data->height = stream.readUint16BE(); data->fbbw = stream.readUint16BE(); data->fbbh = stream.readUint16BE(); - data->fbbx = stream.readUint16BE(); - data->fbby = stream.readUint16BE(); + data->fbbx = stream.readSint16BE(); + data->fbby = stream.readSint16BE(); data->ascent = stream.readUint16BE(); data->firstchar = stream.readUint16BE(); data->size = stream.readUint16BE(); diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index 4c8ce289cf..ccde78806d 100644 --- a/graphics/thumbnail.cpp +++ b/graphics/thumbnail.cpp @@ -82,7 +82,7 @@ bool checkThumbnailHeader(Common::SeekableReadStream &in) { return hasHeader; } -bool skipThumbnailHeader(Common::SeekableReadStream &in) { +bool skipThumbnail(Common::SeekableReadStream &in) { uint32 position = in.pos(); ThumbnailHeader header; diff --git a/graphics/thumbnail.h b/graphics/thumbnail.h index b3fdb70b95..9341582aa1 100644 --- a/graphics/thumbnail.h +++ b/graphics/thumbnail.h @@ -39,14 +39,14 @@ namespace Graphics { bool checkThumbnailHeader(Common::SeekableReadStream &in); /** - * Skips a thumbnail header, if present. + * Skips a thumbnail, if present. * * @param in stream to process */ -bool skipThumbnailHeader(Common::SeekableReadStream &in); +bool skipThumbnail(Common::SeekableReadStream &in); /** - * Lodas a thumbnail from the given input stream. + * Loads a thumbnail from the given input stream. * The loaded thumbnail will be automatically converted to the * current overlay pixelformat. */ diff --git a/graphics/video/avi_decoder.cpp b/graphics/video/avi_decoder.cpp index 4c3c770c60..06589d99b0 100644 --- a/graphics/video/avi_decoder.cpp +++ b/graphics/video/avi_decoder.cpp @@ -211,10 +211,10 @@ void AviDecoder::handleStreamHeader() { } } -bool AviDecoder::load(Common::SeekableReadStream &stream) { +bool AviDecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; _decodedHeader = false; // Read chunks until we have decoded the header diff --git a/graphics/video/avi_decoder.h b/graphics/video/avi_decoder.h index 5f09992647..72cf2d7ef5 100644 --- a/graphics/video/avi_decoder.h +++ b/graphics/video/avi_decoder.h @@ -178,7 +178,7 @@ public: Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType); virtual ~AviDecoder(); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); bool isVideoLoaded() const { return _fileStream != 0; } diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp index 4d93815b44..9ee9fd68d0 100644 --- a/graphics/video/coktelvideo/coktelvideo.cpp +++ b/graphics/video/coktelvideo/coktelvideo.cpp @@ -127,14 +127,14 @@ Common::MemoryReadStream *PreImd::getExtraData(const char *fileName) { return 0; } -bool PreImd::load(Common::SeekableReadStream &stream) { +bool PreImd::load(Common::SeekableReadStream *stream) { // Since PreIMDs don't have any width and height values stored, // we need them to be specified in the constructor assert((_forcedWidth > 0) && (_forcedHeight > 0)); unload(); - _stream = &stream; + _stream = stream; _stream->seek(0); @@ -564,10 +564,10 @@ bool Imd::loadFrameTables(uint32 framesPosPos, uint32 framesCoordsPos) { return true; } -bool Imd::load(Common::SeekableReadStream &stream) { +bool Imd::load(Common::SeekableReadStream *stream) { unload(); - _stream = &stream; + _stream = stream; uint16 handle; @@ -1656,10 +1656,10 @@ void Vmd::readExtraData() { } } -bool Vmd::load(Common::SeekableReadStream &stream) { +bool Vmd::load(Common::SeekableReadStream *stream) { unload(); - _stream = &stream; + _stream = stream; uint16 headerLength; uint16 handle; diff --git a/graphics/video/coktelvideo/coktelvideo.h b/graphics/video/coktelvideo/coktelvideo.h index 8fbd861e82..f8b1965f41 100644 --- a/graphics/video/coktelvideo/coktelvideo.h +++ b/graphics/video/coktelvideo/coktelvideo.h @@ -23,12 +23,8 @@ * */ -// Currently, only GOB and SCI32 games play IMDs and VMDs, so skip compiling if GOB and SCI32 is disabled. -#if !(defined(ENABLE_GOB) || defined(ENABLE_SCI32) || defined(DYNAMIC_MODULES)) - -// Do not compile the CoktelVideo code - -#else +// Currently, only GOB and SCI32 games play IMDs and VMDs +#if defined(ENABLE_GOB) || defined(ENABLE_SCI32) || defined(DYNAMIC_MODULES) #ifndef GRAPHICS_VIDEO_COKTELVIDEO_H #define GRAPHICS_VIDEO_COKTELVIDEO_H @@ -153,7 +149,7 @@ public: virtual Common::MemoryReadStream *getExtraData(const char *fileName) = 0; /** Load a video out of a stream. */ - virtual bool load(Common::SeekableReadStream &stream) = 0; + virtual bool load(Common::SeekableReadStream *stream) = 0; /** Unload the currently loaded video. */ virtual void unload() = 0; @@ -243,7 +239,7 @@ public: bool hasExtraData(const char *fileName) const; Common::MemoryReadStream *getExtraData(const char *fileName); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void unload(); void setXY(int16 x, int16 y); @@ -322,7 +318,7 @@ public: uint32 getSyncLag() const; - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void unload(); void setXY(int16 x, int16 y); @@ -451,7 +447,7 @@ public: bool hasExtraData(const char *fileName) const; Common::MemoryReadStream *getExtraData(const char *fileName); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void unload(); int16 getWidth() const; diff --git a/graphics/video/dxa_decoder.cpp b/graphics/video/dxa_decoder.cpp index 3f26012f5e..5066e8cf37 100644 --- a/graphics/video/dxa_decoder.cpp +++ b/graphics/video/dxa_decoder.cpp @@ -66,10 +66,10 @@ DXADecoder::~DXADecoder() { close(); } -bool DXADecoder::load(Common::SeekableReadStream &stream) { +bool DXADecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; uint32 tag = _fileStream->readUint32BE(); assert(tag == MKID_BE('DEXA')); diff --git a/graphics/video/dxa_decoder.h b/graphics/video/dxa_decoder.h index d61346324f..eb4426dbbc 100644 --- a/graphics/video/dxa_decoder.h +++ b/graphics/video/dxa_decoder.h @@ -43,7 +43,7 @@ public: DXADecoder(); virtual ~DXADecoder(); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); bool isVideoLoaded() const { return _fileStream != 0; } diff --git a/graphics/video/flic_decoder.cpp b/graphics/video/flic_decoder.cpp index b07e369cd8..843d3ee093 100644 --- a/graphics/video/flic_decoder.cpp +++ b/graphics/video/flic_decoder.cpp @@ -41,10 +41,10 @@ FlicDecoder::~FlicDecoder() { close(); } -bool FlicDecoder::load(Common::SeekableReadStream &stream) { +bool FlicDecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; /* uint32 frameSize = */ _fileStream->readUint32LE(); uint16 frameType = _fileStream->readUint16LE(); @@ -71,9 +71,8 @@ bool FlicDecoder::load(Common::SeekableReadStream &stream) { _fileStream->readUint16LE(); // flags // Note: The normal delay is a 32-bit integer (dword), whereas the overriden delay is a 16-bit integer (word) - // frameDelay is the FLIC "speed", in milliseconds. Our frameDelay is calculated in 1/100 ms, so we convert it here - uint32 frameDelay = 100 * _fileStream->readUint32LE(); - _frameRate = 100 * 1000 / frameDelay; + // the frame delay is the FLIC "speed", in milliseconds. + _frameRate = Common::Rational(1000, _fileStream->readUint32LE()); _fileStream->seek(80); _offsetFrame1 = _fileStream->readUint32LE(); @@ -209,10 +208,10 @@ Surface *FlicDecoder::decodeNextFrame() { chunkCount = _fileStream->readUint16LE(); // Note: The overriden delay is a 16-bit integer (word), whereas the normal delay is a 32-bit integer (dword) - // frameDelay is the FLIC "speed", in milliseconds. Our frameDelay is calculated in 1/100 ms, so we convert it here + // the frame delay is the FLIC "speed", in milliseconds. uint16 newFrameDelay = _fileStream->readUint16LE(); // "speed", in milliseconds if (newFrameDelay > 0) - _frameRate = 1000 / newFrameDelay; + _frameRate = Common::Rational(1000, newFrameDelay); _fileStream->readUint16LE(); // reserved, always 0 uint16 newWidth = _fileStream->readUint16LE(); @@ -268,15 +267,15 @@ Surface *FlicDecoder::decodeNextFrame() { _curFrame++; - if (_curFrame == 0) - _startTime = g_system->getMillis(); - // If we just processed the ring frame, set the next frame if (_curFrame == (int32)_frameCount) { _curFrame = 0; _fileStream->seek(_offsetFrame2); } + if (_curFrame == 0) + _startTime = g_system->getMillis(); + return _surface; } diff --git a/graphics/video/flic_decoder.h b/graphics/video/flic_decoder.h index 60d68889a2..bba1403c22 100644 --- a/graphics/video/flic_decoder.h +++ b/graphics/video/flic_decoder.h @@ -51,7 +51,7 @@ public: * Load a video file * @param stream the stream to load */ - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); /** @@ -72,7 +72,7 @@ public: void copyDirtyRectsToBuffer(uint8 *dst, uint pitch); byte *getPalette() { _paletteChanged = false; return _palette; } - bool hasDirtyPalette() { return _paletteChanged; } + bool hasDirtyPalette() const { return _paletteChanged; } void reset(); protected: @@ -91,7 +91,7 @@ private: Common::SeekableReadStream *_fileStream; Surface *_surface; uint32 _frameCount; - uint32 _frameRate; + Common::Rational _frameRate; Common::List<Common::Rect> _dirtyRects; }; diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp index 61b0f5166d..470441dab8 100644 --- a/graphics/video/qt_decoder.cpp +++ b/graphics/video/qt_decoder.cpp @@ -308,8 +308,8 @@ bool QuickTimeDecoder::loadFile(const Common::String &filename) { return true; } -bool QuickTimeDecoder::load(Common::SeekableReadStream &stream) { - _fd = &stream; +bool QuickTimeDecoder::load(Common::SeekableReadStream *stream) { + _fd = stream; _foundMOOV = _foundMDAT = false; _numStreams = 0; _partial = 0; diff --git a/graphics/video/qt_decoder.h b/graphics/video/qt_decoder.h index db4ff8180b..196d4c02cb 100644 --- a/graphics/video/qt_decoder.h +++ b/graphics/video/qt_decoder.h @@ -89,7 +89,7 @@ public: * Load a QuickTime video file from a SeekableReadStream * @param stream the stream to load */ - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); /** * Close a QuickTime encoded video file diff --git a/graphics/video/smk_decoder.cpp b/graphics/video/smk_decoder.cpp index 0b7de774eb..4d03305cce 100644 --- a/graphics/video/smk_decoder.cpp +++ b/graphics/video/smk_decoder.cpp @@ -367,10 +367,10 @@ uint32 SmackerDecoder::getElapsedTime() const { return VideoDecoder::getElapsedTime(); } -bool SmackerDecoder::load(Common::SeekableReadStream &stream) { +bool SmackerDecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; // Seek to the first frame _header.signature = _fileStream->readUint32BE(); diff --git a/graphics/video/smk_decoder.h b/graphics/video/smk_decoder.h index 6bf671f318..43bb84a4f8 100644 --- a/graphics/video/smk_decoder.h +++ b/graphics/video/smk_decoder.h @@ -57,7 +57,7 @@ public: Audio::Mixer::SoundType soundType = Audio::Mixer::kSFXSoundType); virtual ~SmackerDecoder(); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); bool isVideoLoaded() const { return _fileStream != 0; } diff --git a/graphics/video/video_decoder.cpp b/graphics/video/video_decoder.cpp index 9733afc5cc..081f47bf78 100644 --- a/graphics/video/video_decoder.cpp +++ b/graphics/video/video_decoder.cpp @@ -42,7 +42,7 @@ bool VideoDecoder::loadFile(const Common::String &filename) { return false; } - return load(*file); + return load(file); } uint32 VideoDecoder::getElapsedTime() const { @@ -81,9 +81,14 @@ bool VideoDecoder::endOfVideo() const { void VideoDecoder::pauseVideo(bool pause) { if (pause) { _pauseLevel++; - } else { - assert(_pauseLevel); // We can't go negative + + // We can't go negative + } else if (_pauseLevel) { _pauseLevel--; + + // Do nothing + } else { + return; } if (_pauseLevel == 1 && pause) { diff --git a/graphics/video/video_decoder.h b/graphics/video/video_decoder.h index d96545d2c1..a398a62009 100644 --- a/graphics/video/video_decoder.h +++ b/graphics/video/video_decoder.h @@ -93,7 +93,7 @@ public: * Load a video file * @param stream the stream to load */ - virtual bool load(Common::SeekableReadStream &stream) = 0; + virtual bool load(Common::SeekableReadStream *stream) = 0; /** * Close a video file |