aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-07 18:11:25 +0530
committerEugene Sandulenko2019-09-03 17:16:44 +0200
commit79136f44d2e5c1c623c7a89a2a85fb3d37ad257e (patch)
tree29c28aba3c82f45f48c0d589f67b8045068e6475
parent712caa6620b29c6812f544b5a8b532d1f08510a9 (diff)
downloadscummvm-rg350-79136f44d2e5c1c623c7a89a2a85fb3d37ad257e.tar.gz
scummvm-rg350-79136f44d2e5c1c623c7a89a2a85fb3d37ad257e.tar.bz2
scummvm-rg350-79136f44d2e5c1c623c7a89a2a85fb3d37ad257e.zip
HDB: Fix breaking changes in map-loader
-rw-r--r--engines/hdb/map-loader.cpp49
-rw-r--r--engines/hdb/map-loader.h27
2 files changed, 8 insertions, 68 deletions
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp
index e529d7959f..e4577b3b48 100644
--- a/engines/hdb/map-loader.cpp
+++ b/engines/hdb/map-loader.cpp
@@ -47,14 +47,14 @@ bool Map::load(Common::SeekableReadStream *stream) {
// Reading Background
_background = new uint16[_width * _height];
stream->seek(_backgroundOffset);
- for (uint i = 0; i < _width * _height; i++) {
+ for (int i = 0; i < _width * _height; i++) {
_background[i] = stream->readUint16LE();
}
// Reading Foreground
_foreground = new uint16[_width * _height];
stream->seek(_foregroundOffset);
- for (uint i = 0; i < _width * _height; i++) {
+ for (int i = 0; i < _width * _height; i++) {
_foreground[i] = stream->readUint16LE();
}
@@ -79,53 +79,20 @@ bool Map::load(Common::SeekableReadStream *stream) {
TODO: Add the InfoList when it comes up
*/
- return true;
-}
-
-#if 0
-MapLoader::MapLoader() {
- _mapLoaded = false;
-}
-
-bool MapLoader::loadMap(Common::SeekableReadStream *stream, int32 length) {
-
- if (_mapLoaded) {
- return false;
- }
-
- // Load MSM data into _mapHeader
- _mapHeader = new MSMHeader;
- stream->read(_mapHeader->name, 32);
- _mapHeader->width = stream->readUint16LE();
- _mapHeader->height = stream->readUint16LE();
- _mapHeader->background = stream->readUint32LE();
- _mapHeader->foreground = stream->readUint32LE();
- _mapHeader->iconNum = stream->readUint16LE();
- _mapHeader->iconList = stream->readUint32LE();
- _mapHeader->infoNum = stream->readUint16LE();
- _mapHeader->infoList = stream->readUint32LE();
-
/*
- TODO: Set the InMapName in hdb.cpp
+ TODO: Set the InMapName once its setup
*/
- mapWidth = _mapHeader->width;
- mapHeight = _mapHeader->height;
+ _mapExplosions = new char[_width * _height];
+ _mapExpBarrels = new char[_width * _height];
+ _mapLaserBeams = new char[_width * _height];
- // Create matrices to keep track of Explosions, Barrels and LaserBeams
- _mapExplosions = new char[mapWidth * mapHeight];
- _mapExpBarrels = new char[mapWidth * mapHeight];
- _mapLaserBeams = new char[mapWidth * mapHeight];
mapX = mapY = 0;
- debug("Background: %d\n", _mapHeader->background);
- debug("Foreground: %d\n", _mapHeader->foreground);
- debug("IconList: %d\n", _mapHeader->iconList);
- debug("InfoList: %d\n", _mapHeader->infoList);
+ _mapLoaded = true;
- warning("STUB: MAPLOADER: LOAD MAP INCOMPLETE");
- return false;
+ return true;
}
int MapLoader::loadTiles() {
diff --git a/engines/hdb/map-loader.h b/engines/hdb/map-loader.h
index beae262d11..ce4d809761 100644
--- a/engines/hdb/map-loader.h
+++ b/engines/hdb/map-loader.h
@@ -24,7 +24,6 @@
#define HDB_MAP_LOADER_H
#include "common/system.h"
-#include "common/array.h"
namespace HDB {
@@ -78,32 +77,6 @@ private:
bool _mapLoaded;
};
-
-#if 0
-class MapLoader {
-public:
- MapLoader();
-
- bool loadMap(Common::SeekableReadStream *stream, int32 length);
- int loadTiles();
-
- bool isLoaded() {
- return _mapLoaded;
- }
-
- int mapX, mapY; // Coordinates of Map
- int mapWidth, mapHeight; // Map Dimensions
- int mapTileX, mapTileY; // Tile Coordinates of Map
- int mapTileXoff, mapTileYoff; // Tile Coordinates Offset (0-31)
-
- Common::Array<SeeThroughTile *> mapGratings, mapForegrounds;
- int numGratings, numForegrounds;
-
-private:
- bool _mapLoaded;
-};
-#endif
-
}
#endif // !HDB_MAP_LOADER_H