GRAPHICS: Add support for loading oversized Mac CURS resources
This commit is contained in:
parent
30b7ab77f8
commit
1ea57c994c
2 changed files with 6 additions and 4 deletions
|
@ -42,12 +42,14 @@ void MacCursor::clear() {
|
|||
memset(_palette, 0, 256 * 3);
|
||||
}
|
||||
|
||||
bool MacCursor::readFromStream(Common::SeekableReadStream &stream, bool forceMonochrome, byte monochromeInvertedPixelColor) {
|
||||
bool MacCursor::readFromStream(Common::SeekableReadStream &stream, bool forceMonochrome, byte monochromeInvertedPixelColor, bool forceCURSFormat) {
|
||||
clear();
|
||||
|
||||
// Older Mac CURS monochrome cursors had a set size
|
||||
const int minCursSize = 32 * 2 + 4;
|
||||
|
||||
// Older Mac CURS monochrome cursors had a set size, but sometimes contain extra unused bytes
|
||||
// All crsr cursors are larger than this
|
||||
if (stream.size() == 32 * 2 + 4)
|
||||
if (stream.size() == minCursSize || (forceCURSFormat && stream.size() >= minCursSize))
|
||||
return readFromCURS(stream, monochromeInvertedPixelColor);
|
||||
|
||||
return readFromCRSR(stream, forceMonochrome, monochromeInvertedPixelColor);
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
uint16 getPaletteCount() const { return 256; }
|
||||
|
||||
/** Read the cursor's data out of a stream. */
|
||||
bool readFromStream(Common::SeekableReadStream &stream, bool forceMonochrome = false, byte monochromeInvertedPixelColor = 0xff);
|
||||
bool readFromStream(Common::SeekableReadStream &stream, bool forceMonochrome = false, byte monochromeInvertedPixelColor = 0xff, bool forceCURSFormat = false);
|
||||
|
||||
protected:
|
||||
bool readFromCURS(Common::SeekableReadStream &stream, byte monochromeInvertedPixelColor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue