aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-06-30 08:16:19 -0400
committerJohannes Schickel2012-03-20 01:06:47 +0100
commit426c81a7a7a4d6f47b73db1a75908b548d250e4e (patch)
treed9a5be538bbf1cda43196765b7fc1204324bd47f /engines
parent29f7cc33fb66ded97a8261beb8d16dd951bdec59 (diff)
downloadscummvm-rg350-426c81a7a7a4d6f47b73db1a75908b548d250e4e.tar.gz
scummvm-rg350-426c81a7a7a4d6f47b73db1a75908b548d250e4e.tar.bz2
scummvm-rg350-426c81a7a7a4d6f47b73db1a75908b548d250e4e.zip
GRAPHICS: Rewrite ImageDecoder to have an improved API
The new bitmap decoder class is based off the Mohawk one, and now has 8bpp decoding capability.
Diffstat (limited to 'engines')
-rw-r--r--engines/hugo/dialogs.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp
index c43cdd7b46..e0b0198470 100644
--- a/engines/hugo/dialogs.cpp
+++ b/engines/hugo/dialogs.cpp
@@ -21,7 +21,7 @@
*/
#include "common/substream.h"
-#include "graphics/imagedec.h"
+#include "graphics/decoders/bmp.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
@@ -128,7 +128,16 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
uint16 bmpSize = in.readUint16BE();
uint32 filPos = in.pos();
Common::SeekableSubReadStream stream(&in, filPos, filPos + bmpSize);
- arrayBmp[i * 2] = Graphics::ImageDecoder::loadFile(stream, g_system->getOverlayFormat());
+
+ Graphics::BitmapDecoder bitmapDecoder;
+ if (!bitmapDecoder.loadStream(stream))
+ error("TopMenu::loadBmpArr(): Could not load bitmap");
+
+ const Graphics::Surface *bitmapSrc = bitmapDecoder.getSurface();
+ if (bitmapSrc->format.bytesPerPixel == 1)
+ error("TopMenu::loadBmpArr(): Unhandled paletted image");
+
+ arrayBmp[i * 2] = bitmapSrc->convertTo(g_system->getOverlayFormat());
arrayBmp[i * 2 + 1] = new Graphics::Surface();
arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat());
byte *src = (byte *)arrayBmp[i * 2]->pixels;
@@ -154,7 +163,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
}
}
- in.skip(bmpSize);
+ in.seek(filPos + bmpSize);
}
}