diff options
author | Simei Yin | 2018-04-27 14:15:09 +0200 |
---|---|---|
committer | Simei Yin | 2018-04-27 19:48:29 +0200 |
commit | 5ced49576924c18dd3d04c08f4e1822f21c52894 (patch) | |
tree | 8e171f2a7715c716cf6b8b0751401581fde07b95 /engines/sludge/thumbnail.cpp | |
parent | 4ce71f39225b7bc229f0048cf3bcdf5320dc9a84 (diff) | |
download | scummvm-rg350-5ced49576924c18dd3d04c08f4e1822f21c52894.tar.gz scummvm-rg350-5ced49576924c18dd3d04c08f4e1822f21c52894.tar.bz2 scummvm-rg350-5ced49576924c18dd3d04c08f4e1822f21c52894.zip |
SLUDGE: Move global variable thumbnailWidth/Height to GraphicsManager
Diffstat (limited to 'engines/sludge/thumbnail.cpp')
-rw-r--r-- | engines/sludge/thumbnail.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/engines/sludge/thumbnail.cpp b/engines/sludge/thumbnail.cpp index 2c7e007f71..dcbcd91db3 100644 --- a/engines/sludge/thumbnail.cpp +++ b/engines/sludge/thumbnail.cpp @@ -35,14 +35,23 @@ namespace Sludge { -int thumbWidth = 0, thumbHeight = 0; +bool GraphicsManager::setThumbnailSize(int thumbWidth, int thumbHeight) +{ + if (checkSizeValide(thumbWidth, thumbHeight)) + { + _thumbWidth = thumbWidth; + _thumbHeight = thumbHeight; + return true; + } + return false; +} bool GraphicsManager::saveThumbnail(Common::WriteStream *stream) { - stream->writeUint32LE(thumbWidth); - stream->writeUint32LE(thumbHeight); + stream->writeUint32LE(_thumbWidth); + stream->writeUint32LE(_thumbHeight); - if (thumbWidth && thumbHeight) { + if (_thumbWidth && _thumbHeight) { if (!freeze()) return false; @@ -117,12 +126,12 @@ void GraphicsManager::showThumbnail(const Common::String &filename, int atX, int } bool GraphicsManager::skipThumbnail(Common::SeekableReadStream *stream) { - thumbWidth = stream->readUint32LE(); - thumbHeight = stream->readUint32LE(); + _thumbWidth = stream->readUint32LE(); + _thumbHeight = stream->readUint32LE(); // Load image Graphics::Surface tmp; - if (thumbWidth & thumbHeight) { + if (_thumbWidth & _thumbHeight) { if (!ImgLoader::loadPNGImage(stream, &tmp)) return false; else |