Opened 4 months ago
Closed 4 months ago
#15600 closed defect (fixed)
PEGASUS: Possible bug in Cursor::loadCursorImage()
Reported by: | eriktorbjorn | Owned by: | eriktorbjorn |
---|---|---|---|
Priority: | normal | Component: | Engine: Pegasus |
Version: | Keywords: | ||
Cc: | Game: | Journeyman Project Pegasus Prime |
Description
I don't know where this happens, but I was looking at the Pegasus engine's Cursor::loadCursorImage()
for reference and noticed this:
// Mask section cicnStream->readUint32BE(); // mask baseAddr uint16 maskRowBytes = cicnStream->readUint16BE(); // mask rowBytes cicnStream->skip(3 * 2); // mask rect /* uint16 maskHeight = */ cicnStream->readUint16BE(); // Bitmap section cicnStream->readUint32BE(); // baseAddr uint16 rowBytes = cicnStream->readUint16BE(); cicnStream->readUint16BE(); // top cicnStream->readUint16BE(); // left uint16 height = cicnStream->readUint16BE(); // bottom cicnStream->readUint16BE(); // right // Data section cicnStream->readUint32BE(); // icon handle cicnStream->skip(maskRowBytes * height); // FIXME: maskHeight doesn't work here, though the specs say it should cicnStream->skip(rowBytes * height);
It's using height
to skip the mask because "maskHeight
doesn't work here". But it would have read maskHeight
from the last field in the mask rect. Judging by how it reads height
, it should have used the third field, because the fourth one would be the width, wouldn't it? (Assuming the top and left fields are both zero.)
Change History (3)
comment:1 by , 4 months ago
comment:3 by , 4 months ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I have replaced the old cicn loading code, fixing some issues with the new one in the process. I haven't played the game, but I've tried it with all nine cicn resources I could find, as well as the cicn resources from the Mac SCUMM games to make sure it didn't regress.
I'll see if I can rewrite this to use the new cicn decoder that was added recently. It's only been tested with the Mac SCUMM games, but it was based partly on the code in this engine.