From f850ad2ced921e15b226a3f9db551fb96042e0dd Mon Sep 17 00:00:00 2001 From: dhewg Date: Mon, 14 Feb 2011 11:38:02 +0100 Subject: WII: Adapt to [set|grab]Palette RGBA->RGB change. --- backends/platform/wii/osystem_gfx.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 09575bb83d..a4e45557f0 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -326,10 +326,8 @@ void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) { const byte *s = colors; u16 *d = _texGame.palette; - for (uint i = 0; i < num; ++i) { + for (uint i = 0; i < num; ++i, s +=3) d[start + i] = Graphics::RGBToColor >(s[0], s[1], s[2]); - s += 4; - } gfx_tex_flush_palette(&_texGame); @@ -339,10 +337,8 @@ void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) { s = colors; d = _texMouse.palette; - for (uint i = 0; i < num; ++i) { + for (uint i = 0; i < num; ++i, s += 3) d[start + i] = Graphics::ARGBToColor >(0xff, s[0], s[1], s[2]); - s += 4; - } _cursorPaletteDirty = true; } @@ -357,13 +353,11 @@ void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) { byte *d = colors; u8 r, g, b; - for (uint i = 0; i < num; ++i) { + for (uint i = 0; i < num; ++i, d += 3) { Graphics::colorToRGB >(s[start + i], r, g, b); d[0] = r; d[1] = g; d[2] = b; - d[3] = 0xff; - d += 4; } } @@ -388,10 +382,8 @@ void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) { const byte *s = colors; u16 *d = _texMouse.palette; - for (uint i = 0; i < num; ++i) { + for (uint i = 0; i < num; ++i, s += 3) d[start + i] = Graphics::ARGBToColor >(0xff, s[0], s[1], s[2]); - s += 4; - } _cursorPaletteDirty = true; } -- cgit v1.2.3