aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/map_v4.cpp
diff options
context:
space:
mode:
authorNorbert Lange2009-07-01 14:45:24 +0000
committerNorbert Lange2009-07-01 14:45:24 +0000
commitabef70f4e14f495b20097cb46411d1fafbafdd53 (patch)
tree27462f82f352b303ac059dd275466930c88b2de6 /engines/gob/map_v4.cpp
parent3b94e2488df9a699a899727515ac69af6a0a1a6e (diff)
parentf9298ff40310149779b37ccdecc873afba7adf2f (diff)
downloadscummvm-rg350-abef70f4e14f495b20097cb46411d1fafbafdd53.tar.gz
scummvm-rg350-abef70f4e14f495b20097cb46411d1fafbafdd53.tar.bz2
scummvm-rg350-abef70f4e14f495b20097cb46411d1fafbafdd53.zip
Merging in changes from trunk
svn-id: r41989
Diffstat (limited to 'engines/gob/map_v4.cpp')
-rw-r--r--engines/gob/map_v4.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/engines/gob/map_v4.cpp b/engines/gob/map_v4.cpp
index 858e7972bc..1db3d6a3f8 100644
--- a/engines/gob/map_v4.cpp
+++ b/engines/gob/map_v4.cpp
@@ -31,7 +31,8 @@
#include "gob/goblin.h"
#include "gob/inter.h"
#include "gob/game.h"
-#include "gob/parse.h"
+#include "gob/script.h"
+#include "gob/resources.h"
#include "gob/mult.h"
namespace Gob {
@@ -49,14 +50,13 @@ void Map_v4::loadMapObjects(const char *avjFile) {
int16 mapWidth, mapHeight;
int16 tmp;
byte *variables;
- byte *extData;
uint32 tmpPos;
uint32 passPos;
- var = _vm->_parse->parseVarIndex();
+ var = _vm->_game->_script->readVarIndex();
variables = _vm->_inter->_variables->getAddressOff8(var);
- id = _vm->_inter->load16();
+ id = _vm->_game->_script->readInt16();
if (((uint16) id) >= 65520) {
warning("Woodruff Stub: loadMapObjects ID >= 65520");
@@ -66,8 +66,11 @@ void Map_v4::loadMapObjects(const char *avjFile) {
return;
}
- extData = _vm->_game->loadExtData(id, 0, 0);
- Common::MemoryReadStream mapData(extData, 4294967295U);
+ Resource *resource = _vm->_game->_resources->getResource(id);
+ if (!resource)
+ return;
+
+ Common::SeekableReadStream &mapData = *resource->stream();
_widthByte = mapData.readByte();
if (_widthByte == 4) {
@@ -99,7 +102,7 @@ void Map_v4::loadMapObjects(const char *avjFile) {
passPos = mapData.pos();
mapData.skip(_mapWidth * _mapHeight);
- if (*extData == 1)
+ if (resource->getData()[0] == 1)
wayPointsCount = _wayPointsCount = 40;
else
wayPointsCount = _wayPointsCount == 0 ? 1 : _wayPointsCount;
@@ -146,11 +149,11 @@ void Map_v4::loadMapObjects(const char *avjFile) {
for (int i = 0; i < _vm->_goblin->_gobsCount; i++)
loadGoblinStates(mapData, i);
- _vm->_goblin->_soundSlotsCount = _vm->_inter->load16();
+ _vm->_goblin->_soundSlotsCount = _vm->_game->_script->readInt16();
for (int i = 0; i < _vm->_goblin->_soundSlotsCount; i++)
_vm->_goblin->_soundSlots[i] = _vm->_inter->loadSound(1);
- delete[] extData;
+ delete resource;
}
} // End of namespace Gob