HDB: Add getTileIndex and getPicture to DrawMan
This commit is contained in:
parent
76abfae403
commit
29c670b199
2 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue