diff options
author | craigsc | 2020-01-11 12:08:21 -0800 |
---|---|---|
committer | craigsc | 2020-01-11 12:08:21 -0800 |
commit | 3dd4fb16f017a8eab5c6c11fd119a397b457866e (patch) | |
tree | 5b80b5c5038d8577c2d674a5a4742b335deca515 /graphics/wincursor.cpp | |
parent | f9f81ea9baecb714f26cf1c17a1b0ae58431467b (diff) | |
parent | 5893672b80f00fced33c42e63471d68ba47d7dd4 (diff) | |
download | scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.tar.gz scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.tar.bz2 scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'graphics/wincursor.cpp')
-rw-r--r-- | graphics/wincursor.cpp | 64 |
1 files changed, 3 insertions, 61 deletions
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp index 13d9bebfba..7abd1a33ad 100644 --- a/graphics/wincursor.cpp +++ b/graphics/wincursor.cpp @@ -23,8 +23,6 @@ #include "common/ptr.h" #include "common/stream.h" #include "common/textconsole.h" -#include "common/winexe_ne.h" -#include "common/winexe_pe.h" #include "graphics/wincursor.h" @@ -242,64 +240,8 @@ WinCursorGroup::~WinCursorGroup() { delete cursors[i].cursor; } -WinCursorGroup *WinCursorGroup::createCursorGroup(Common::NEResources &exe, const Common::WinResourceID &id) { - Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kWinGroupCursor, id)); - - if (!stream || stream->size() <= 6) - return 0; - - stream->skip(4); - uint32 cursorCount = stream->readUint16LE(); - if ((uint32)stream->size() < (6 + cursorCount * 14)) - return 0; - - WinCursorGroup *group = new WinCursorGroup(); - group->cursors.reserve(cursorCount); - - for (uint32 i = 0; i < cursorCount; i++) { - stream->readUint16LE(); // width - stream->readUint16LE(); // height - - // Plane count - if (stream->readUint16LE() != 1) { - delete group; - return 0; - } - - // Bits per pixel - // NE cursors can only be 1bpp - if (stream->readUint16LE() != 1) { - delete group; - return 0; - } - - stream->readUint32LE(); // data size - uint32 cursorId = stream->readUint16LE(); - - Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kWinCursor, cursorId)); - if (!cursorStream) { - delete group; - return 0; - } - - WinCursor *cursor = new WinCursor(); - if (!cursor->readFromStream(*cursorStream)) { - delete cursor; - delete group; - return 0; - } - - CursorItem item; - item.id = cursorId; - item.cursor = cursor; - group->cursors.push_back(item); - } - - return group; -} - -WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, const Common::WinResourceID &id) { - Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kWinGroupCursor, id)); +WinCursorGroup *WinCursorGroup::createCursorGroup(Common::WinResources *exe, const Common::WinResourceID &id) { + Common::ScopedPtr<Common::SeekableReadStream> stream(exe->getResource(Common::kWinGroupCursor, id)); if (!stream || stream->size() <= 6) return 0; @@ -325,7 +267,7 @@ WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, cons stream->readUint32LE(); // data size uint32 cursorId = stream->readUint16LE(); - Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kWinCursor, cursorId)); + Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe->getResource(Common::kWinCursor, cursorId)); if (!cursorStream) { delete group; return 0; |