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 | |
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')
-rw-r--r-- | backends/PalmOS/Src/palm.cpp | 12 | ||||
-rw-r--r-- | backends/PalmOS/Src/palm.h | 5 |
2 files changed, 12 insertions, 5 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--; diff --git a/backends/PalmOS/Src/palm.h b/backends/PalmOS/Src/palm.h index 8cf579641e..5c203ddfcf 100644 --- a/backends/PalmOS/Src/palm.h +++ b/backends/PalmOS/Src/palm.h @@ -76,7 +76,7 @@ public: // Set the bitmap that's used when drawing the cursor. - void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); + void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor = 255); // Shaking is used in SCUMM. Set current shake position. void set_shake_pos(int shake_pos); @@ -215,6 +215,7 @@ private: MousePos _mouseOldState; int16 _mouseHotspotX; int16 _mouseHotspotY; + byte _mouseKeycolor; int _current_shake_pos; int _new_shake_pos; @@ -284,4 +285,4 @@ private: void init_intern(UInt16 gfx_mode); }; -#endif
\ No newline at end of file +#endif |