diff options
author | Nipun Garg | 2019-06-25 11:01:19 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:00 +0200 |
commit | 9ba96ae83ef3ee972155af89915946012f386abc (patch) | |
tree | b155e8796d093b4cd978423ddaf8b077a0e94b9b /engines | |
parent | 4344b2f8c8fd34994f28e86d7707f7803a811c61 (diff) | |
download | scummvm-rg350-9ba96ae83ef3ee972155af89915946012f386abc.tar.gz scummvm-rg350-9ba96ae83ef3ee972155af89915946012f386abc.tar.bz2 scummvm-rg350-9ba96ae83ef3ee972155af89915946012f386abc.zip |
HDB: Add loadTile() and stringLength()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 15 | ||||
-rw-r--r-- | engines/hdb/draw-manager.h | 2 |
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); |