aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorArnaud Boutonné2009-09-01 20:36:03 +0000
committerArnaud Boutonné2009-09-01 20:36:03 +0000
commit76d60f3b5a1ee059c06c9b9d7f4343a045880ecf (patch)
treeede6b9c583a89b751bd6946c29b74716c4a1c241 /engines/gob
parentfe2f11049ecb39d9a9ca61a96602db0ca42f54d2 (diff)
downloadscummvm-rg350-76d60f3b5a1ee059c06c9b9d7f4343a045880ecf.tar.gz
scummvm-rg350-76d60f3b5a1ee059c06c9b9d7f4343a045880ecf.tar.bz2
scummvm-rg350-76d60f3b5a1ee059c06c9b9d7f4343a045880ecf.zip
Playtoons: Add support to IDs 65530, 65531, 65532, 65534, and renamed Id -1 into 65535 in Map_v2::loadMapObjects. This allows to start the contruction mode and "somehow" use it. (Thanks DrMcCoy for pointing out my errors)
svn-id: r43896
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/map.h1
-rw-r--r--engines/gob/map_v2.cpp32
2 files changed, 29 insertions, 4 deletions
diff --git a/engines/gob/map.h b/engines/gob/map.h
index ba976ff7ac..0c5f97b97a 100644
--- a/engines/gob/map.h
+++ b/engines/gob/map.h
@@ -72,6 +72,7 @@ public:
int16 _tilesHeight;
int16 _passWidth;
bool _bigTiles;
+ bool _mapUnknownBool;
int8 *_passMap; // [y * _mapWidth + x], getPass(x, y);
int16 **_itemsMap; // [y][x]
diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp
index 51caad74b8..69227b6bf3 100644
--- a/engines/gob/map_v2.cpp
+++ b/engines/gob/map_v2.cpp
@@ -54,6 +54,7 @@ void Map_v2::loadMapObjects(const char *avjFile) {
byte *variables;
uint32 tmpPos;
uint32 passPos;
+ uint16 i;
var = _vm->_game->_script->readVarIndex();
variables = _vm->_inter->_variables->getAddressOff8(var);
@@ -61,10 +62,33 @@ void Map_v2::loadMapObjects(const char *avjFile) {
id = _vm->_game->_script->readInt16();
if (((uint16) id) >= 65520) {
- warning("Map_v2::loadMapObjects(): ID >= 65520");
- return;
- } else if (id == -1) {
- _passMap = (int8 *) _vm->_inter->_variables->getAddressOff8(var);
+ switch ((uint16) id) {
+ case 65530:
+ for (i = 0; i < _mapWidth * _mapHeight; i++)
+ _passMap[i] -= READ_VARO_UINT8(var + i);
+ break;
+ case 65531:
+ for (i = 0; i < _mapWidth * _mapHeight; i++)
+ _passMap[i] += READ_VARO_UINT8(var + i);
+ break;
+ case 65532:
+ for (i = 0; i < _mapWidth * _mapHeight; i++)
+ WRITE_VARO_UINT8(var + i, 0x00);
+ break;
+ case 65533:
+ warning("Map_v2::loadMapObjects(): ID == 65533");
+ break;
+ case 65534:
+ _tilesWidth = READ_VARO_UINT8(var);
+ _tilesHeight = READ_VARO_UINT8(var + 1);
+ _mapWidth = READ_VARO_UINT8(var + 2);
+ _mapHeight = READ_VARO_UINT8(var + 3);
+ _mapUnknownBool = READ_VARO_UINT8(var + 4) ? true : false;
+ break;
+ case 65535:
+ _passMap = (int8 *) _vm->_inter->_variables->getAddressOff8(var);
+ break;
+ }
return;
}