[Scummvm-cvs-logs] CVS: scummvm/backends/dc dc.h,1.37,1.38 display.cpp,1.33,1.34

Marcus Comstedt marcus_c at users.sourceforge.net
Sun Apr 3 12:42:29 CEST 2005


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

Modified Files:
	dc.h display.cpp 
Log Message:
Switch overlay mode to ARGB4444.

Index: dc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dc.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- dc.h	3 Apr 2005 18:02:27 -0000	1.37
+++ dc.h	3 Apr 2005 19:42:02 -0000	1.38
@@ -133,6 +133,20 @@
   void clearOverlay();
   void grabOverlay(int16 *buf, int pitch);
   void copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h);
+  bool hasAlpha() const { return true; }
+  OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) { return ARGBToColor(255, r, g, b); }
+  void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
+    uint8 tmp; colorToARGB(color, tmp, r, g, b);
+  }
+  OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
+    return ((a&0xf0)<<8)|((r&0xf0)<<4)|(g&0xf0)|(b>>4);
+  }
+  void colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) {
+    a = ((color>>8)&0xf0)|((color>>12)&0x0f);
+    r = ((color>>4)&0xf0)|((color>>8)&0x0f);
+    g = (color&0xf0)|((color>>4)&0x0f);
+    b = ((color<<4)&0xf0)|(color&0x0f);
+  }
 
   // Add a callback timer
   void setTimerCallback(TimerProc callback, int timer);

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/display.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- display.cpp	3 Apr 2005 18:02:27 -0000	1.33
+++ display.cpp	3 Apr 2005 19:42:02 -0000	1.34
@@ -356,7 +356,7 @@
       TA_POLYMODE2_ENABLE_ALPHA|
       TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|
       TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512;
-    mypoly.texture = TA_TEXTUREMODE_RGB565|TA_TEXTUREMODE_NON_TWIDDLED|
+    mypoly.texture = TA_TEXTUREMODE_ARGB4444|TA_TEXTUREMODE_NON_TWIDDLED|
       TA_TEXTUREMODE_ADDRESS(ovl_tx[_overlay_buffer]);
     
     mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0.0;
@@ -510,17 +510,8 @@
   if(!_overlay_visible)
     return;
 
-  unsigned char *src = screen+_overlay_x+_overlay_y*SCREEN_W;
-  unsigned short *dst = overlay;
+  memset(overlay, 0, OVL_TXSTRIDE*OVL_H*sizeof(unsigned short));
 
-  for(int y=0; y<OVL_H; y++) {
-    for(int x=0; x<OVL_W; x++) {
-      short pix = palette[src[x]];
-      dst[x] = ((pix&0x7fe0)<<1)|((pix&0x0200)>>4)|(pix&0x1f);
-    }
-    src += SCREEN_W;
-    dst += OVL_W;
-  }
   _overlay_dirty = true;
 }
 
@@ -573,4 +564,4 @@
   return 0;
 }
 
-int gBitFormat = 565;
+int gBitFormat = 4444;





More information about the Scummvm-git-logs mailing list