diff options
author | yinsimei | 2017-05-30 09:59:56 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-13 18:27:45 +0200 |
commit | 8c59f8deac6da7fd3b46234b70ca1cea428ca1f5 (patch) | |
tree | 5ceb323ae2ac20c28120084726330b17bbd2861c /engines/sludge/thumbnail.cpp | |
parent | b920f61a111b2dddac41b44a318c9078dea833ff (diff) | |
download | scummvm-rg350-8c59f8deac6da7fd3b46234b70ca1cea428ca1f5.tar.gz scummvm-rg350-8c59f8deac6da7fd3b46234b70ca1cea428ca1f5.tar.bz2 scummvm-rg350-8c59f8deac6da7fd3b46234b70ca1cea428ca1f5.zip |
SLUDGE: Replace sludge stream reading functions by scummvm ones
Diffstat (limited to 'engines/sludge/thumbnail.cpp')
-rw-r--r-- | engines/sludge/thumbnail.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/sludge/thumbnail.cpp b/engines/sludge/thumbnail.cpp index 7c588a283a..5e77936fb6 100644 --- a/engines/sludge/thumbnail.cpp +++ b/engines/sludge/thumbnail.cpp @@ -44,8 +44,8 @@ bool saveThumbnail(Common::WriteStream *stream) { #if 0 GLuint thumbnailTextureName = 0; - put4bytes(thumbWidth, fp); - put4bytes(thumbHeight, fp); + fp->writeUint32LE(thumbWidth); + fp->writeUint32LE(thumbHeight); if (thumbWidth && thumbHeight) { if (! freeze()) return false; @@ -148,8 +148,8 @@ void showThumbnail(char *filename, int atX, int atY) { FILE *fp = openAndVerify(filename, 'S', 'A', ERROR_GAME_LOAD_NO, ssgVersion); if (ssgVersion >= VERSION(1, 4)) { if (fp == NULL) return; - int fileWidth = get4bytes(fp); - int fileHeight = get4bytes(fp); + int fileWidth = fp->readUint32LE(); + int fileHeight = fp->readUint32LE(); int picWidth = fileWidth; int picHeight = fileHeight; @@ -170,7 +170,7 @@ void showThumbnail(char *filename, int atX, int atY) { for (t2 = 0; t2 < fileHeight; t2 ++) { t1 = 0; while (t1 < fileWidth) { - c = (unsigned short) get2bytes(fp); + c = (unsigned short) fp->readUint16BE(); target = thumbnailTexture + 4 * picWidth * t2 + t1 * 4; target[0] = (GLubyte) redValue(c); target[1] = (GLubyte) greenValue(c); @@ -252,12 +252,12 @@ void showThumbnail(char *filename, int atX, int atY) { } bool skipThumbnail(Common::SeekableReadStream *stream) { - thumbWidth = get4bytes(stream); - thumbHeight = get4bytes(stream); + thumbWidth = stream->readUint32LE(); + thumbHeight = stream->readUint32LE(); uint32_t skippy = thumbWidth; skippy *= thumbHeight << 1; stream->seek(skippy, 1); - return (getch(stream) == '!'); + return (stream->readByte() == '!'); } } // End of namespace Sludge |