aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/scene_lol.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-01-22 16:56:22 +0000
committerJohannes Schickel2009-01-22 16:56:22 +0000
commitd9cf723ee9911cd8a84baa5cc39fe39fffe5ff39 (patch)
tree123921b95a5e12f69b5e0253c30ea90737b5b8ce /engines/kyra/scene_lol.cpp
parentadf15c100765608a054143fdf0e1af98c077bd51 (diff)
downloadscummvm-rg350-d9cf723ee9911cd8a84baa5cc39fe39fffe5ff39.tar.gz
scummvm-rg350-d9cf723ee9911cd8a84baa5cc39fe39fffe5ff39.tar.bz2
scummvm-rg350-d9cf723ee9911cd8a84baa5cc39fe39fffe5ff39.zip
Minor cleanup (got rid of a dynamic array).
svn-id: r35999
Diffstat (limited to 'engines/kyra/scene_lol.cpp')
-rw-r--r--engines/kyra/scene_lol.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index fcedec1a76..da839dbf8b 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -345,14 +345,15 @@ uint8 *LoLEngine::getLevelShapes(int shapeIndex) {
if (_lvlShpNum <= shapeIndex)
return 0;
- uint32 offs = _lvlShpHeader[shapeIndex] + 2;
- _lvlShpFileHandle->seek(offs, 0);
+ _lvlShpFileHandle->seek(shapeIndex * 4 + 2, SEEK_SET);
+ uint32 offs = _lvlShpFileHandle->readUint32LE() + 2;
+ _lvlShpFileHandle->seek(offs, SEEK_SET);
uint8 tmp[16];
_lvlShpFileHandle->read(tmp, 16);
uint16 size = _screen->getShapeSize(tmp);
- _lvlShpFileHandle->seek(offs, 0);
+ _lvlShpFileHandle->seek(offs, SEEK_SET);
uint8 *res = new uint8[size];
_lvlShpFileHandle->read(res, size);
@@ -554,10 +555,6 @@ void LoLEngine::loadLevelShpDat(const char *shpFile, const char *datFile, bool f
_lvlShpFileHandle = _res->getFileStream(shpFile);
_lvlShpNum = _lvlShpFileHandle->readUint16LE();
- delete[] _lvlShpHeader;
- _lvlShpHeader = new uint32[_lvlShpNum];
- for (int i = 0; i < _lvlShpNum; i++)
- _lvlShpHeader[i] = _lvlShpFileHandle->readUint32LE();
Common::SeekableReadStream *s = _res->getFileStream(datFile);