mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
COMMON: Add a key color field to NECursor
This commit is contained in:
parent
a2a0b13de2
commit
e053373dd3
@ -38,6 +38,7 @@ NECursor::NECursor() {
|
||||
_hotspotX = 0;
|
||||
_hotspotY = 0;
|
||||
_surface = 0;
|
||||
_keyColor = 0;
|
||||
memset(_palette, 0, 256 * 3);
|
||||
}
|
||||
|
||||
@ -61,6 +62,10 @@ uint16 NECursor::getHotspotY() const {
|
||||
return _hotspotY;
|
||||
}
|
||||
|
||||
byte NECursor::getKeyColor() const {
|
||||
return _keyColor;
|
||||
}
|
||||
|
||||
void NECursor::setDimensions(uint16 width, uint16 height) {
|
||||
_width = width;
|
||||
_height = height;
|
||||
@ -156,7 +161,7 @@ bool NECursor::readCursor(SeekableReadStream &stream, uint32 count) {
|
||||
else
|
||||
*rowDest = 1;
|
||||
} else
|
||||
*rowDest = 0;
|
||||
*rowDest = _keyColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,8 @@ public:
|
||||
uint16 getHotspotX() const;
|
||||
/** Return the cursor's hotspot's y coordinate. */
|
||||
uint16 getHotspotY() const;
|
||||
/** Return the cursor's transparent key. */
|
||||
byte getKeyColor() const;
|
||||
|
||||
const byte *getSurface() const { return _surface; }
|
||||
const byte *getPalette() const { return _palette; }
|
||||
@ -70,6 +72,7 @@ private:
|
||||
uint16 _height; ///< The cursor's height.
|
||||
uint16 _hotspotX; ///< The cursor's hotspot's x coordinate.
|
||||
uint16 _hotspotY; ///< The cursor's hotspot's y coordinate.
|
||||
byte _keyColor; ///< The cursor's transparent key
|
||||
|
||||
/** Clear the cursor. */
|
||||
void clear();
|
||||
|
@ -301,7 +301,7 @@ void NECursorManager::setCursor(uint16 id) {
|
||||
for (uint32 i = 0; i < cursors.size(); i++) {
|
||||
if (cursors[i].id == id) {
|
||||
Common::NECursor *cursor = cursors[i].cursors[0];
|
||||
CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), 0);
|
||||
CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor());
|
||||
CursorMan.replaceCursorPalette(cursor->getPalette(), 0, 256);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user