Minor cleanup (got rid of a dynamic array).

svn-id: r35999
This commit is contained in:
Johannes Schickel 2009-01-22 16:56:22 +00:00
parent adf15c1007
commit d9cf723ee9
3 changed files with 4 additions and 10 deletions

View File

@ -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;

View File

@ -550,7 +550,6 @@ private:
Common::SeekableReadStream *_lvlShpFileHandle;
uint16 _lvlShpNum;
uint32 *_lvlShpHeader;
uint16 _levelFileDataSize;
LevelShapeProperty *_levelFileData;

View File

@ -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);