aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
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
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')
-rw-r--r--engines/kyra/lol.cpp2
-rw-r--r--engines/kyra/lol.h1
-rw-r--r--engines/kyra/scene_lol.cpp11
3 files changed, 4 insertions, 10 deletions
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);