aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wii
diff options
context:
space:
mode:
authorMax Horn2008-11-06 15:02:50 +0000
committerMax Horn2008-11-06 15:02:50 +0000
commitedf9f249260b1fd4364f6727fa622991e81e8cf3 (patch)
tree2b034d5daf7b69212957d8d51ab839974f51f2c5 /backends/platform/wii
parentf238a12b27ebfa9847814b9972fdb5789e484533 (diff)
downloadscummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.tar.gz
scummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.tar.bz2
scummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.zip
Got rid of OSystem::colorToRGB and RGBToColor; added implementations for OSystem::getOverlayFormat to several ports (pending testing by the porters)
svn-id: r34912
Diffstat (limited to 'backends/platform/wii')
-rw-r--r--backends/platform/wii/osystem.h4
-rw-r--r--backends/platform/wii/osystem_gfx.cpp17
2 files changed, 4 insertions, 17 deletions
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index f17644ba1b..bedfadd934 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -136,9 +136,7 @@ public:
int x, int y, int w, int h);
virtual int16 getOverlayWidth();
virtual int16 getOverlayHeight();
-
- virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
- virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
+ virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<565>(); }
virtual bool showMouse(bool visible);
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index f6406a88ed..9ce70e70c3 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -197,7 +197,7 @@ int16 OSystem_Wii::getHeight() {
void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
const byte *p = colors;
for (uint i = 0; i < num; ++i) {
- _palette[start + i] = RGBToColor(p[0], p[1], p[2]);
+ _palette[start + i] = Graphics::RGBToColor<ColorMasks<565> >(p[0], p[1], p[2]);
p += 4;
}
}
@@ -206,7 +206,7 @@ void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) {
byte *p = colors;
u8 r, g, b;
for (uint i = 0; i < num; ++i) {
- colorToRGB(_palette[start + i], r, g, b);
+ Graphics::colorToRGB<ColorMasks<565> >(_palette[start + i], r, g, b);
p[0] = r;
p[1] = g;
p[2] = b;
@@ -218,7 +218,7 @@ void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) {
void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) {
const byte *p = colors;
for (uint i = 0; i < num; ++i) {
- _cursorPalette[start + i] = RGBToColor(p[0], p[1], p[2]);
+ _cursorPalette[start + i] = Graphics::RGBToColor<ColorMasks<565> >(p[0], p[1], p[2]);
p += 4;
}
@@ -443,17 +443,6 @@ int16 OSystem_Wii::getOverlayHeight() {
return _overlayHeight;
}
-OverlayColor OSystem_Wii::RGBToColor(uint8 r, uint8 g, uint8 b) {
- return (((r >> 3) & 0x1f) << 11) | (((g >> 2) & 0x3f) << 5 ) |
- ((b >> 3) & 0x1f);
-}
-
-void OSystem_Wii::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
- r = ((color >> 11) & 0x1f) << 3;
- g = ((color >> 5) & 0x3f) << 2;
- b = (color & 0x1f) << 3;
-}
-
bool OSystem_Wii::showMouse(bool visible) {
bool last = _mouseVisible;
_mouseVisible = visible;