diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp index 4cade1f5e2f..7abd1a33add 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,63 +240,7 @@ WinCursorGroup::~WinCursorGroup() { delete cursors[i].cursor; } -WinCursorGroup *WinCursorGroup::createCursorGroup(Common::NEResources *exe, const Common::WinResourceID &id) { - Common::ScopedPtr 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 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) { +WinCursorGroup *WinCursorGroup::createCursorGroup(Common::WinResources *exe, const Common::WinResourceID &id) { Common::ScopedPtr stream(exe->getResource(Common::kWinGroupCursor, id)); if (!stream || stream->size() <= 6) diff --git a/graphics/wincursor.h b/graphics/wincursor.h index d77314458bb..77d00d2d69c 100644 --- a/graphics/wincursor.h +++ b/graphics/wincursor.h @@ -29,8 +29,6 @@ #include "graphics/cursor.h" namespace Common { -class NEResources; -class PEResources; class SeekableReadStream; } @@ -56,10 +54,8 @@ struct WinCursorGroup { Common::Array cursors; - /** Create a cursor group from an NE EXE, returns 0 on failure */ - static WinCursorGroup *createCursorGroup(Common::NEResources *exe, const Common::WinResourceID &id); - /** Create a cursor group from an PE EXE, returns 0 on failure */ - static WinCursorGroup *createCursorGroup(Common::PEResources *exe, const Common::WinResourceID &id); + /** Create a cursor group from an EXE, returns 0 on failure */ + static WinCursorGroup *createCursorGroup(Common::WinResources *exe, const Common::WinResourceID &id); }; /**