HDB: Add getTileIndex and getPicture to DrawMan

This commit is contained in:
Nipun Garg 2019-06-08 00:18:30 +05:30 committed by Eugene Sandulenko
parent 76abfae403
commit 29c670b199
2 changed files with 18 additions and 0 deletions

View file

@ -102,6 +102,22 @@ Tile *DrawMan::getTile(int index) {
return _tLookupArray[index].tData;
}
int DrawMan::getTileIndex(const char *name) {
for (int i = 0; i < _numTiles; i++) {
if (_tLookupArray[i].filename == name) {
return i;
}
}
return -1;
}
Picture *DrawMan::getPicture(const char *name) {
Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(name, TYPE_PIC);
Picture *picture = new Picture;
picture->load(stream);
return picture;
}
int DrawMan::isSky(int index) {
if (!index) {
return 0;

View file

@ -50,6 +50,8 @@ public:
bool init();
Tile *getTile(int index);
int getTileIndex(const char *name);
Picture *getPicture(const char *name);
int isSky(int skyIndex);
private: