diff options
author | Eugene Sandulenko | 2004-05-05 02:32:46 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-05-05 02:32:46 +0000 |
commit | b7e62e4b61c7552fa91c9dbdd9273b620d7f876b (patch) | |
tree | 61cc2d13b77e8c8514954241f050b8245155283b /backends/PalmOS/Src/palm.cpp | |
parent | 5d0f0ea0c6afd7defaba3df69b39879a63256776 (diff) | |
download | scummvm-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/PalmOS/Src/palm.cpp')
-rw-r--r-- | backends/PalmOS/Src/palm.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/backends/PalmOS/Src/palm.cpp b/backends/PalmOS/Src/palm.cpp index 278cc68211..0b7eceb8e6 100644 --- a/backends/PalmOS/Src/palm.cpp +++ b/backends/PalmOS/Src/palm.cpp @@ -62,6 +62,7 @@ void OSystem_PALMOS::init_intern(UInt16 gfx_mode) { _vibrate = gVars->vibrator; _fullscreen = (ConfMan.getBool("fullscreen") && OPTIONS_TST(kOptModeWide)); _adjustAspectRatio = ConfMan.getBool("aspect_ratio"); + _mouseDataP = NULL; } void OSystem_PALMOS::setPalette(const byte *colors, uint start, uint num) { @@ -701,14 +702,19 @@ void OSystem_PALMOS::set_mouse_pos(int x, int y) { } } -void OSystem_PALMOS::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { +void OSystem_PALMOS::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor) { _mouseCurState.w = w; _mouseCurState.h = h; _mouseHotspotX = hotspot_x; _mouseHotspotY = hotspot_y; - _mouseDataP = (byte*)buf; + _mouseKeycolor = keycolor; + + if (_mouseDataP) + free(_mouseDataP); + _mouseDataP = malloc(w * h); + memcpy(_mouseDataP, buf, w * h); undraw_mouse(); } @@ -1316,7 +1322,7 @@ void OSystem_PALMOS::draw_mouse() { while (width > 0) { *bak++ = *dst; color = *src++; - if (color != 0xFF) // 0xFF = transparent, don't draw + if (color != _mouseKeycolor) // transparent, don't draw *dst = color; dst++; width--; |