diff options
author | Nipun Garg | 2019-07-04 01:19:13 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:10 +0200 |
commit | 9b6e83451fe5dc24801e6c6ea1bf0116b5b6fd7d (patch) | |
tree | 86e4f7aa51cbcb2f7cd902cb85daeb8b32db6ec1 | |
parent | 92a4ff67feeb83755dcc271be65855593448eb34 (diff) | |
download | scummvm-rg350-9b6e83451fe5dc24801e6c6ea1bf0116b5b6fd7d.tar.gz scummvm-rg350-9b6e83451fe5dc24801e6c6ea1bf0116b5b6fd7d.tar.bz2 scummvm-rg350-9b6e83451fe5dc24801e6c6ea1bf0116b5b6fd7d.zip |
HDB: Add check for unknown size
-rw-r--r-- | engines/hdb/gfx.cpp | 8 | ||||
-rw-r--r-- | engines/hdb/gfx.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index a17eab6f03..2f3e501d7d 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -308,7 +308,7 @@ bool Gfx::selectGfxType(const char *name) { return true; } -Tile *Gfx::getTileGfx(const char *name, uint32 size) { +Tile *Gfx::getTileGfx(const char *name, int32 size) { // Try to find graphic for (Common::Array<GfxCache *>::iterator it = _gfxCache->begin(); it != _gfxCache->end(); it++) { if (Common::matchString((*it)->name, name)) { @@ -328,6 +328,8 @@ Tile *Gfx::getTileGfx(const char *name, uint32 size) { gfxTile->load(stream); gc->tileGfx = gfxTile; + if (size == -1) + size = g_hdb->_fileMan->getLength(name, TYPE_TILE32); gc->size = size; gc->loaded = 1; @@ -336,7 +338,7 @@ Tile *Gfx::getTileGfx(const char *name, uint32 size) { return gc->tileGfx; } -Picture *Gfx::getPicGfx(const char *name, uint32 size) { +Picture *Gfx::getPicGfx(const char *name, int32 size) { // Try to find graphic for (Common::Array<GfxCache *>::iterator it = _gfxCache->begin(); it != _gfxCache->end(); it++) { if (Common::matchString((*it)->name, name)) { @@ -356,6 +358,8 @@ Picture *Gfx::getPicGfx(const char *name, uint32 size) { gfxPic->load(stream); gc->picGfx = gfxPic; + if (size == -1) + size = g_hdb->_fileMan->getLength(name, TYPE_PIC); gc->size = size; gc->loaded = 1; diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h index fb26fe4e04..41277a1e4c 100644 --- a/engines/hdb/gfx.h +++ b/engines/hdb/gfx.h @@ -121,8 +121,8 @@ public: // Returns: true->Tile, false->Pic bool selectGfxType(const char *name); - Tile *getTileGfx(const char *name, uint32 size); - Picture *getPicGfx(const char *name, uint32 size); + Tile *getTileGfx(const char *name, int32 size); + Picture *getPicGfx(const char *name, int32 size); int isSky(int skyIndex); void setSky(int skyIndex); |