diff options
author | Nipun Garg | 2019-06-21 06:17:54 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:53 +0200 |
commit | 04ff0635f13c9234b80311329ec26543842077ca (patch) | |
tree | d4ea6e860e05ffd7bec9c4e046fa320b6316013f /engines | |
parent | 244a51298f0edb6065964e5fef9d826d50574489 (diff) | |
download | scummvm-rg350-04ff0635f13c9234b80311329ec26543842077ca.tar.gz scummvm-rg350-04ff0635f13c9234b80311329ec26543842077ca.tar.bz2 scummvm-rg350-04ff0635f13c9234b80311329ec26543842077ca.zip |
HDB: Add addBGTileAnimation and addFGTileAnimation
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/map-loader.cpp | 32 | ||||
-rw-r--r-- | engines/hdb/map-loader.h | 2 |
2 files changed, 34 insertions, 0 deletions
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp index f5e2fded8a..431ef6cfe7 100644 --- a/engines/hdb/map-loader.cpp +++ b/engines/hdb/map-loader.cpp @@ -656,6 +656,38 @@ void Map::setMapFGTileIndex(int x, int y, int index) { _foreground[y * _width + x] = index; } +void Map::addBGTileAnimation(int x, int y) { + + int i = y * _width + x; + + uint32 flags = g_hdb->_drawMan->getTile(_background[i])->_flags; + + // BACKGROUND + if (flags & kFlagAnimFast) { + _listBGAnimFast.push_back(i); + } else if (flags & kFlagAnimSlow) { + _listBGAnimSlow.push_back(i); + } else if (flags & kFlagAnimMedium) { + _listBGAnimMedium.push_back(i); + } +} + +void Map::addFGTileAnimation(int x, int y) { + + int i = y * _width + x; + + uint32 flags = g_hdb->_drawMan->getTile(_foreground[i])->_flags; + + // FOREGROUND + if (flags & kFlagAnimFast) { + _listFGAnimFast.push_back(i); + } else if (flags & kFlagAnimSlow) { + _listFGAnimSlow.push_back(i); + } else if (flags & kFlagAnimMedium) { + _listFGAnimMedium.push_back(i); + } +} + void Map::getMapXY(int *x, int *y) { *x = _mapX; *y = _mapY; diff --git a/engines/hdb/map-loader.h b/engines/hdb/map-loader.h index dd1353560d..158b5f9131 100644 --- a/engines/hdb/map-loader.h +++ b/engines/hdb/map-loader.h @@ -69,6 +69,8 @@ public: uint16 getMapFGTileIndex(int x, int y); void setMapBGTileIndex(int x, int y, int index); void setMapFGTileIndex(int x, int y, int index); + void addBGTileAnimation(int x, int y); + void addFGTileAnimation(int x, int y); void getMapXY(int *x, int *y); void setMapXY(int x, int y); |