[Scummvm-cvs-logs] CVS: scummvm/backends/dc dc.h,1.30,1.31 display.cpp,1.24,1.25

Eugene Sandulenko sev at users.sourceforge.net
Tue May 4 19:32:02 CEST 2004


Update of /cvsroot/scummvm/scummvm/backends/dc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22596/dc

Modified Files:
	dc.h display.cpp 
Log Message:
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.


Index: dc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dc.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- dc.h	28 Mar 2004 16:30:46 -0000	1.30
+++ dc.h	5 May 2004 02:30:13 -0000	1.31
@@ -85,7 +85,7 @@
   void warpMouse(int x, int y);
 
   // 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);
@@ -163,6 +163,7 @@
   int _current_shake_pos, _screen_w, _screen_h;
   int _overlay_x, _overlay_y;
   unsigned char *_ms_buf;
+  unsigned char _ms_keycolor;
   SoundProc _sound_proc;
   void *_sound_proc_param;
   bool _overlay_visible, _overlay_dirty, _screen_dirty;

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/display.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- display.cpp	28 Mar 2004 16:30:47 -0000	1.24
+++ display.cpp	5 May 2004 02:30:13 -0000	1.25
@@ -259,15 +259,21 @@
 }
 
 void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
-					 int hotspot_x, int hotspot_y)
+								   int hotspot_x, int hotspot_y, byte keycolor)
 {
   _ms_cur_w = w;
   _ms_cur_h = h;
   
   _ms_hotspot_x = hotspot_x;
   _ms_hotspot_y = hotspot_y;
+
+  _ms_keycolor = keycolor;
   
-  _ms_buf = (byte*)buf;
+  if (_ms_buf)
+    free(_ms_buf);
+
+  _ms_buf = (byte *)malloc(w * h);
+  memcpy(_ms_buf, buf, w * h);
 }
 
 void OSystem_Dreamcast::set_shake_pos(int shake_pos)
@@ -456,7 +462,7 @@
     for(int y=0; y<h; y++) {
       int x;
       for(x=0; x<w; x++)
-	if(*buf == 0xff) {
+	if(*buf == _ms_keycolor) {
 	  *dst++ = 0;
 	  buf++;
 	} else





More information about the Scummvm-git-logs mailing list