From da4201440282afa825f298874ca7482dfac8d024 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 16 Jan 2011 08:15:47 +0000 Subject: SWORD25: Fix main menu button text colour In the other cases I've found in the code, the colour components are stored in the order B, G, R and A. Assume that's the case here too. I hope that is correct. It doesn't seem to break anything obvious. svn-id: r55255 --- engines/sword25/gfx/image/renderedimage.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'engines/sword25/gfx/image') diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index fb82f893c6..ce04d79aa3 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -269,9 +269,9 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe out = outo; in = ino; for (int j = 0; j < img->w; j++) { - int r = in[0]; + int b = in[0]; int g = in[1]; - int b = in[2]; + int r = in[2]; int a = in[3]; in += inStep; @@ -284,39 +284,39 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe out += 4; break; case 255: // Full opacity - if (cr != 255) - *out++ = (r * cr) >> 8; + if (cb != 255) + *out++ = (b * cb) >> 8; else - *out++ = r; + *out++ = b; if (cg != 255) *out++ = (g * cg) >> 8; else *out++ = g; - if (cb != 255) - *out++ = (b * cb) >> 8; + if (cr != 255) + *out++ = (r * cr) >> 8; else - *out++ = b; + *out++ = r; *out++ = a; break; default: // alpha blending - if (cr != 255) - *out += ((r - *out) * a * cr) >> 16; + if (cb != 255) + *out += ((b - *out) * a * cb) >> 16; else - *out += ((r - *out) * a) >> 8; + *out += ((b - *out) * a) >> 8; out++; if (cg != 255) *out += ((g - *out) * a * cg) >> 16; else *out += ((g - *out) * a) >> 8; out++; - if (cb != 255) - *out += ((b - *out) * a * cb) >> 16; + if (cr != 255) + *out += ((r - *out) * a * cr) >> 16; else - *out += ((b - *out) * a) >> 8; + *out += ((r - *out) * a) >> 8; out++; *out = 255; out++; -- cgit v1.2.3