diff options
author | Sven Hesse | 2008-05-28 21:15:11 +0000 |
---|---|---|
committer | Sven Hesse | 2008-05-28 21:15:11 +0000 |
commit | 8da68b29648f9dbdcc05b3a1efe4a29ed2c4e88c (patch) | |
tree | 7f2416cbf176f53a871b0cc3bea4785284ba4889 /engines/gob/map_v4.cpp | |
parent | c9fd5fef7645cc7ba6e14ddfeaab91d941f3b8f7 (diff) | |
download | scummvm-rg350-8da68b29648f9dbdcc05b3a1efe4a29ed2c4e88c.tar.gz scummvm-rg350-8da68b29648f9dbdcc05b3a1efe4a29ed2c4e88c.tar.bz2 scummvm-rg350-8da68b29648f9dbdcc05b3a1efe4a29ed2c4e88c.zip |
Script variables are now always stored in the game version's native endianess.
This should make Woodruff playable on big-endian systems.
svn-id: r32352
Diffstat (limited to 'engines/gob/map_v4.cpp')
-rw-r--r-- | engines/gob/map_v4.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/gob/map_v4.cpp b/engines/gob/map_v4.cpp index a3c3222213..3a74c4b6aa 100644 --- a/engines/gob/map_v4.cpp +++ b/engines/gob/map_v4.cpp @@ -54,7 +54,7 @@ void Map_v4::loadMapObjects(const char *avjFile) { uint32 passPos; var = _vm->_parse->parseVarIndex(); - variables = _vm->_global->_inter_variables + var; + variables = _vm->_inter->_variables->getAddressOff8(var, 0); id = _vm->_inter->load16(); @@ -62,7 +62,7 @@ void Map_v4::loadMapObjects(const char *avjFile) { warning("Woodruff Stub: loadMapObjects ID >= 65520"); return; } else if (id == -1) { - _passMap = (int8 *)(_vm->_global->_inter_variables + var); + _passMap = (int8 *) _vm->_inter->_variables->getAddressOff8(var, 0); return; } @@ -120,18 +120,17 @@ void Map_v4::loadMapObjects(const char *avjFile) { // In the original asm, this writes byte-wise into the variables-array tmpPos = mapData.pos(); mapData.seek(passPos); - if (variables != _vm->_global->_inter_variables) { - byte *sizes; + if ((variables != 0) && + (variables != _vm->_inter->_variables->getAddressOff8(0, 0))) { _passMap = (int8 *) variables; mapHeight = _screenHeight / _tilesHeight; mapWidth = _screenWidth / _tilesWidth; - sizes = _vm->_global->_inter_variablesSizes + - (((byte *) _passMap) - _vm->_global->_inter_variables); + for (int i = 0; i < mapHeight; i++) { for (int j = 0; j < mapWidth; j++) setPass(j, i, mapData.readSByte()); - memset(sizes + i * _passWidth, 0, mapWidth); + _vm->_inter->_variables->getAddressOff8(var + i * _passWidth, mapWidth); } } mapData.seek(tmpPos); |