[Scummvm-cvs-logs] CVS: scummvm/backends/dc dc.h,1.41,1.42 display.cpp,1.36,1.37

Marcus Comstedt marcus_c at users.sourceforge.net
Mon Jun 27 08:20:12 CEST 2005


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

Modified Files:
	dc.h display.cpp 
Log Message:
Implemented OSystem_Dreamcast::grabPalette().

Index: dc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dc.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- dc.h	26 Jun 2005 20:59:56 -0000	1.41
+++ dc.h	27 Jun 2005 15:16:58 -0000	1.42
@@ -64,6 +64,7 @@
 
   // Set colors of the palette
   void setPalette(const byte *colors, uint start, uint num);
+  void grabPalette(byte *colors, uint start, uint num);
 
   // Set the size of the video bitmap.
   // Typically, 320x200

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/display.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- display.cpp	26 Jun 2005 20:59:56 -0000	1.36
+++ display.cpp	27 Jun 2005 15:16:58 -0000	1.37
@@ -142,6 +142,20 @@
   _screen_dirty = true;
 }
 
+void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
+{
+  const unsigned short *src = palette + start;
+  if(num>0)
+    while( num-- ) {
+      unsigned short p = *src++;
+      colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
+      colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
+      colors[2] = ((p&0x001f)<<3)|((p&0x001c)>>2);
+      colors[3] = 0xff;
+      colors += 4;
+    }
+}
+
 void OSystem_Dreamcast::setScaling()
 {
   if(_screen_w > 400) {





More information about the Scummvm-git-logs mailing list