aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/map-loader.cpp18
-rw-r--r--engines/hdb/map-loader.h16
2 files changed, 33 insertions, 1 deletions
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp
index b04beccd5a..b54953efdd 100644
--- a/engines/hdb/map-loader.cpp
+++ b/engines/hdb/map-loader.cpp
@@ -26,6 +26,24 @@ namespace HDB {
Map::Map() {
_mapLoaded = false;
+
+ for (int i = 0; i < kMaxGratings;i++) {
+ _gratings[i] = new Foreground;
+ }
+
+ for (int i = 0; i < kMaxForegrounds;i++) {
+ _foregrounds[i] = new Foreground;
+ }
+}
+
+Map::~Map() {
+ for (int i = 0; i < kMaxGratings;i++) {
+ delete _gratings[i];
+ }
+
+ for (int i = 0; i < kMaxForegrounds;i++) {
+ delete _foregrounds[i];
+ }
}
int Map::loadTiles() {
diff --git a/engines/hdb/map-loader.h b/engines/hdb/map-loader.h
index 9a44cd02ba..8ee0760643 100644
--- a/engines/hdb/map-loader.h
+++ b/engines/hdb/map-loader.h
@@ -29,7 +29,9 @@ namespace HDB {
enum {
kScreenXTiles = 17,
- kScreenYTiles = 16
+ kScreenYTiles = 16,
+ kMaxGratings = 250,
+ kMaxForegrounds = 250
};
struct MSMIcon {
@@ -47,6 +49,14 @@ struct MSMIcon {
MSMIcon(): icon(0), x(0), y(0), funcInit(""), funcAction(""), funcUse(""), dir(0), level(0), value1(0), value2(0) {}
};
+struct Foreground {
+ uint16 x;
+ uint16 y;
+ uint16 tile;
+
+ Foreground() : x(0), y(0), tile(0) {}
+};
+
struct SeeThroughTile {
uint16 x;
uint16 y;
@@ -58,6 +68,7 @@ struct SeeThroughTile {
class Map {
public:
Map();
+ ~Map();
int loadTiles();
bool load(Common::SeekableReadStream *stream);
@@ -83,6 +94,9 @@ public:
int _mapTileX, _mapTileY; // Tile Coordinates of Map
int _mapTileXOff, _mapTileYOff; // Tile Coordinates Offset (0-31)
+ Foreground *_gratings[kMaxGratings], *_foregrounds[kMaxForegrounds];
+ int _numGratings, _numForegrounds;
+
int _animCycle; // Tile Animation Counter
Common::Array<uint32> _listBGAnimSlow;
Common::Array<uint32> _listBGAnimMedium;