aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-22 20:11:50 -0500
committerMatthew Hoops2011-02-22 20:11:50 -0500
commite053373dd344b96e9c29128b97196b3d7f9d2e75 (patch)
tree77b48c7ee22b7ce6ff0d7750024fceb4772439b4
parenta2a0b13de2cd6fb28787b2821466f3ef7c2210ea (diff)
downloadscummvm-rg350-e053373dd344b96e9c29128b97196b3d7f9d2e75.tar.gz
scummvm-rg350-e053373dd344b96e9c29128b97196b3d7f9d2e75.tar.bz2
scummvm-rg350-e053373dd344b96e9c29128b97196b3d7f9d2e75.zip
COMMON: Add a key color field to NECursor
-rw-r--r--common/winexe_ne.cpp7
-rw-r--r--common/winexe_ne.h3
-rw-r--r--engines/mohawk/cursors.cpp2
3 files changed, 10 insertions, 2 deletions
diff --git a/common/winexe_ne.cpp b/common/winexe_ne.cpp
index 8a2b07b4d0..3149528566 100644
--- a/common/winexe_ne.cpp
+++ b/common/winexe_ne.cpp
@@ -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;
}
}
diff --git a/common/winexe_ne.h b/common/winexe_ne.h
index 0c3d5293ab..562c8f72da 100644
--- a/common/winexe_ne.h
+++ b/common/winexe_ne.h
@@ -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();
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index ebc8d1ea8a..cdfdbb3a78 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -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;
}