From d9cf723ee9911cd8a84baa5cc39fe39fffe5ff39 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 22 Jan 2009 16:56:22 +0000 Subject: Minor cleanup (got rid of a dynamic array). svn-id: r35999 --- engines/kyra/lol.cpp | 2 -- engines/kyra/lol.h | 1 - engines/kyra/scene_lol.cpp | 11 ++++------- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index d04374a53e..bd85b892e4 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -238,7 +238,6 @@ LoLEngine::~LoLEngine() { delete[] _levelBlockProperties; delete[] _lvl415; - delete[] _lvlShpHeader; delete[] _levelFileData; delete[] _vcnExpTable; delete[] _vcnBlocks; @@ -343,7 +342,6 @@ Common::Error LoLEngine::init() { memset(_gameFlags, 0, 15 * sizeof(uint16)); memset(_unkEMC46, 0, 16 * sizeof(uint16)); - _lvlShpHeader = 0; _levelFileData = 0; _lvlShpFileHandle = 0; diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 529039f954..dd998d7bd9 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -550,7 +550,6 @@ private: Common::SeekableReadStream *_lvlShpFileHandle; uint16 _lvlShpNum; - uint32 *_lvlShpHeader; uint16 _levelFileDataSize; LevelShapeProperty *_levelFileData; 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); -- cgit v1.2.3