aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/draw-manager.cpp23
-rw-r--r--engines/hdb/draw-manager.h11
2 files changed, 34 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index 6a0d1e0173..7e558e04a5 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -42,6 +42,7 @@ 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);
@@ -63,4 +64,26 @@ Graphics::Surface Picture::load(Common::SeekableReadStream *stream) {
return _surface;
}
+Graphics::Surface Tile::load(Common::SeekableReadStream *stream) {
+ _flags = stream->readUint32LE();
+ stream->read(_name, 64);
+
+ Graphics::PixelFormat format(2, 5, 6, 5, 0, 11, 5, 0, 0);
+
+ _surface.create(32, 32, format);
+ stream->readUint32LE(); // Skip Win32 Surface
+
+ uint16 *ptr;
+
+ for (uint y = 0; y < 32; y++) {
+ ptr = (uint16 *)_surface.getBasePtr(0, y);
+ for (uint x = 0; x < 32; x++) {
+ *ptr = TO_LE_16(stream->readUint16LE());
+ ptr++;
+ }
+ }
+
+ return _surface;
+}
+
}
diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h
index 941e1bfc19..0f8d0442dc 100644
--- a/engines/hdb/draw-manager.h
+++ b/engines/hdb/draw-manager.h
@@ -75,6 +75,17 @@ private:
};
+class Tile {
+public:
+ Graphics::Surface load(Common::SeekableReadStream *stream);
+
+private:
+ uint32 _flags;
+ char _name[64];
+
+ Graphics::Surface _surface;
+};
+
} // End of Namespace HDB
#endif // !HDB_DRAW_MANAGER_H