aboutsummaryrefslogtreecommitdiff
path: root/backends/dc
diff options
context:
space:
mode:
authorMarcus Comstedt2005-04-03 19:42:02 +0000
committerMarcus Comstedt2005-04-03 19:42:02 +0000
commit167badf727496e35c245305742a39e0a2b555b75 (patch)
tree50a7a1de1a3d380946865c07deb9d6fd5c744a60 /backends/dc
parentd2214dca9913011fb9f5f7545309d2d4042fc50c (diff)
downloadscummvm-rg350-167badf727496e35c245305742a39e0a2b555b75.tar.gz
scummvm-rg350-167badf727496e35c245305742a39e0a2b555b75.tar.bz2
scummvm-rg350-167badf727496e35c245305742a39e0a2b555b75.zip
Switch overlay mode to ARGB4444.
svn-id: r17355
Diffstat (limited to 'backends/dc')
-rw-r--r--backends/dc/dc.h14
-rw-r--r--backends/dc/display.cpp15
2 files changed, 17 insertions, 12 deletions
diff --git a/backends/dc/dc.h b/backends/dc/dc.h
index 10f2c6c33b..42994c0012 100644
--- a/backends/dc/dc.h
+++ b/backends/dc/dc.h
@@ -133,6 +133,20 @@ class OSystem_Dreamcast : public OSystem {
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);
diff --git a/backends/dc/display.cpp b/backends/dc/display.cpp
index c470e713e1..fd6d84fec6 100644
--- a/backends/dc/display.cpp
+++ b/backends/dc/display.cpp
@@ -356,7 +356,7 @@ void OSystem_Dreamcast::updateScreen(void)
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 @@ void OSystem_Dreamcast::clearOverlay()
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 @@ int OSystem_Dreamcast::getGraphicsMode() const
return 0;
}
-int gBitFormat = 565;
+int gBitFormat = 4444;