aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-03 20:15:45 +0000
committerJohannes Schickel2008-11-03 20:15:45 +0000
commit4905d827b70c9c0e626be27a1f7d15201a60d747 (patch)
tree14d0c6a1c0fe994ab556faf4b45224f2f0d48432
parent112feada4e68ecae1bdbd380f9b8d4fac15bd396 (diff)
downloadscummvm-rg350-4905d827b70c9c0e626be27a1f7d15201a60d747.tar.gz
scummvm-rg350-4905d827b70c9c0e626be27a1f7d15201a60d747.tar.bz2
scummvm-rg350-4905d827b70c9c0e626be27a1f7d15201a60d747.zip
Removed dependency on OSystem::RGBToColor, by using Graphics::RGBToColor + Graphics::PixelFormat instead.
svn-id: r34888
-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;