aboutsummaryrefslogtreecommitdiff
path: root/backends/morphos/morphos.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2004-05-05 02:32:46 +0000
committerEugene Sandulenko2004-05-05 02:32:46 +0000
commitb7e62e4b61c7552fa91c9dbdd9273b620d7f876b (patch)
tree61cc2d13b77e8c8514954241f050b8245155283b /backends/morphos/morphos.cpp
parent5d0f0ea0c6afd7defaba3df69b39879a63256776 (diff)
downloadscummvm-rg350-b7e62e4b61c7552fa91c9dbdd9273b620d7f876b.tar.gz
scummvm-rg350-b7e62e4b61c7552fa91c9dbdd9273b620d7f876b.tar.bz2
scummvm-rg350-b7e62e4b61c7552fa91c9dbdd9273b620d7f876b.zip
Extend setMouseCursor with additional keycolor parameter. Lets saga use 255
as white color. Made this function more safe by copying cursor data to newly created buffer. svn-id: r13777
Diffstat (limited to 'backends/morphos/morphos.cpp')
-rw-r--r--backends/morphos/morphos.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp
index ed62106f32..d7f3f9e345 100644
--- a/backends/morphos/morphos.cpp
+++ b/backends/morphos/morphos.cpp
@@ -130,6 +130,7 @@ OSystem_MorphOS::OSystem_MorphOS(SCALERTYPE gfx_mode, bool full_screen)
ScummNoCursor = NULL;
UpdateRegion = NULL;
NewUpdateRegion = NULL;
+ MouseImage = NULL;
}
bool OSystem_MorphOS::Initialise()
@@ -1360,7 +1361,7 @@ void OSystem_MorphOS::DrawMouse()
if (xdraw+x < ScummBufferWidth)
{
bak[x] = dst[x];
- if ((color=buf[x])!=0xFF)
+ if ((color=buf[x])!=MouseKeycolor)
dst[x] = color;
}
}
@@ -1423,7 +1424,7 @@ void OSystem_MorphOS::set_mouse_pos(int x, int y)
}
}
-void OSystem_MorphOS::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y)
+void OSystem_MorphOS::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor = 255)
{
MouseWidth = w;
MouseHeight = h;
@@ -1431,7 +1432,13 @@ void OSystem_MorphOS::setMouseCursor(const byte *buf, uint w, uint h, int hotspo
MouseHotspotX = hotspot_x;
MouseHotspotY = hotspot_y;
- MouseImage = (byte*)buf;
+ MouseKeycolor = keycolor;
+
+ if (MouseImage)
+ free(MouseImage);
+
+ MouseImage = (byte *)malloc(w * h);
+ memcpy(mouseImage, buf, w * h);
UndrawMouse();
}