aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/draw-manager.cpp15
-rw-r--r--engines/hdb/draw-manager.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index 133a24d01d..c35514c07d 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -170,6 +170,15 @@ Picture *DrawMan::loadPic(const char *picName) {
return pic;
}
+Tile *DrawMan::loadTile(const char *tileName) {
+ Tile *tile = new Tile;
+ Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(tileName, TYPE_TILE32);
+ if (!stream)
+ return NULL;
+ tile->load(stream);
+ return tile;
+}
+
Tile *DrawMan::getTile(int index) {
if (index < 0 || index > _numTiles) {
@@ -601,6 +610,12 @@ void DrawMan::getDimensions(const char *string, int *pixelsWide, int *lines) {
*lines = height;
}
+int DrawMan::stringLength(const char *string) {
+ int w, h;
+ getDimensions(string, &w, &h);
+ return w;
+}
+
void DrawMan::setTextEdges(int left, int right, int top, int bottom) {
_eLeft = left;
_eRight = right;
diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h
index 3b908e7bd2..d63b58256f 100644
--- a/engines/hdb/draw-manager.h
+++ b/engines/hdb/draw-manager.h
@@ -94,6 +94,7 @@ public:
void turnOffFade() { _fadeInfo.active = _fadeInfo.stayFaded = false; }
Picture *loadPic(const char *picName);
+ Tile *loadTile(const char *tileName);
Tile *getTile(int index);
void cacheTileSequence(int index, int count);
@@ -120,6 +121,7 @@ public:
bool loadFont(const char *string);
void drawText(const char *string);
void getDimensions(const char *string, int *pixelsWide, int *lines);
+ int stringLength(const char *string);
void setTextEdges(int left, int right, int top, int bottom);
void getTextEdges(int *left, int *right, int *top, int *bottom);
void setKernLead(int kern, int lead);