aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-06-21 06:17:54 +0530
committerEugene Sandulenko2019-09-03 17:16:53 +0200
commit04ff0635f13c9234b80311329ec26543842077ca (patch)
treed4ea6e860e05ffd7bec9c4e046fa320b6316013f /engines
parent244a51298f0edb6065964e5fef9d826d50574489 (diff)
downloadscummvm-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.cpp32
-rw-r--r--engines/hdb/map-loader.h2
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);