aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/draw-manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hdb/draw-manager.cpp')
-rw-r--r--engines/hdb/draw-manager.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index dc41fdb7a2..6a0d1e0173 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -38,4 +38,29 @@ void DrawMan::loadTile32(char *name, uint32 *length) {
}
+Graphics::Surface Picture::load(Common::SeekableReadStream *stream) {
+ _width = stream->readUint32LE();
+ _height = stream->readUint32LE();
+ stream->read(_name, 64);
+ Graphics::PixelFormat format(2, 5, 6, 5, 0, 11, 5, 0, 0);
+
+ debug(8, "Picture: _width: %d, _height: %d", _width, _height);
+ debug(8, "Picture: _name: %s", _name);
+
+ _surface.create(_width, _height, format);
+ stream->readUint32LE(); // Skip Win32 Surface
+
+ uint16 *ptr;
+
+ for (uint y = 0; y < _height; y++) {
+ ptr = (uint16 *) _surface.getBasePtr(0, y);
+ for (uint x = 0; x < _width; x++) {
+ *ptr = TO_LE_16(stream->readUint16LE());
+ ptr++;
+ }
+ }
+
+ return _surface;
+}
+
}