aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/imagedec.cpp3
-rw-r--r--gui/widget.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/graphics/imagedec.cpp b/graphics/imagedec.cpp
index e84ca8ca0e..93a895ae03 100644
--- a/graphics/imagedec.cpp
+++ b/graphics/imagedec.cpp
@@ -120,13 +120,14 @@ Surface *BMPDecoder::decodeImage(Common::SeekableReadStream &stream) {
newSurf->create(info.width, info.height, sizeof(OverlayColor));
assert(newSurf->pixels);
OverlayColor *curPixel = (OverlayColor*)newSurf->pixels + (newSurf->h-1) * newSurf->w;
+ PixelFormat overlayFormat = g_system->getOverlayFormat();
int pitchAdd = info.width % 4;
for (int i = 0; i < newSurf->h; ++i) {
for (int i2 = 0; i2 < newSurf->w; ++i2) {
b = stream.readByte();
g = stream.readByte();
r = stream.readByte();
- *curPixel = g_system->RGBToColor(r, g, b);
+ *curPixel = RGBToColor(r, g, b, overlayFormat);
++curPixel;
}
stream.seek(pitchAdd, SEEK_CUR);
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 818676dbf4..1fcf7bc357 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -359,8 +359,8 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
_gfx.create(w, h, sizeof(OverlayColor));
OverlayColor *dst = (OverlayColor*)_gfx.pixels;
- // TODO: get rid of g_system usage
- OverlayColor fillCol = g_system->RGBToColor(r, g, b);
+ Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
+ OverlayColor fillCol = Graphics::RGBToColor(r, g, b, overlayFormat);
while (h--) {
for (int i = 0; i < w; ++i) {
*dst++ = fillCol;