diff options
| author | Max Horn | 2007-03-01 17:15:26 +0000 |
|---|---|---|
| committer | Max Horn | 2007-03-01 17:15:26 +0000 |
| commit | c489be38d6c9a1297ff6feab8981c758887e9708 (patch) | |
| tree | 0c269bd0b2e270a8462073c0b729c3c6092f797f /engines/sword2 | |
| parent | 4203819b39d484a74da0ccbbb86e28989328bd80 (diff) | |
| download | scummvm-rg350-c489be38d6c9a1297ff6feab8981c758887e9708.tar.gz scummvm-rg350-c489be38d6c9a1297ff6feab8981c758887e9708.tar.bz2 scummvm-rg350-c489be38d6c9a1297ff6feab8981c758887e9708.zip | |
Removed obsolete 'if' (resp. replaced it by an assert)
svn-id: r25918
Diffstat (limited to 'engines/sword2')
| -rw-r--r-- | engines/sword2/resman.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index d016a5ad18..b8e79a610e 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -423,27 +423,27 @@ Common::File *ResourceManager::openCluFile(uint16 fileNum) { } void ResourceManager::readCluIndex(uint16 fileNum, Common::File *file) { - if (_resFiles[fileNum].entryTab == NULL) { - // we didn't read from this file before, get its index table - assert(file); - - // 1st DWORD of a cluster is an offset to the look-up table - uint32 table_offset = file->readUint32LE(); - debug(6, "table offset = %d", table_offset); - uint32 tableSize = file->size() - table_offset; // the table is stored at the end of the file - file->seek(table_offset); - - assert((tableSize % 8) == 0); - _resFiles[fileNum].entryTab = (uint32*)malloc(tableSize); - _resFiles[fileNum].numEntries = tableSize / 8; - file->read(_resFiles[fileNum].entryTab, tableSize); - if (file->ioFailed()) - error("unable to read index table from file %s\n", _resFiles[fileNum].fileName); + // we didn't read from this file before, get its index table + assert(_resFiles[fileNum].entryTab == NULL); + assert(file); + + // 1st DWORD of a cluster is an offset to the look-up table + uint32 table_offset = file->readUint32LE(); + debug(6, "table offset = %d", table_offset); + uint32 tableSize = file->size() - table_offset; // the table is stored at the end of the file + file->seek(table_offset); + + assert((tableSize % 8) == 0); + _resFiles[fileNum].entryTab = (uint32*)malloc(tableSize); + _resFiles[fileNum].numEntries = tableSize / 8; + file->read(_resFiles[fileNum].entryTab, tableSize); + if (file->ioFailed()) + error("unable to read index table from file %s\n", _resFiles[fileNum].fileName); + #ifdef SCUMM_BIG_ENDIAN - for (int tabCnt = 0; tabCnt < _resFiles[fileNum].numEntries * 2; tabCnt++) - _resFiles[fileNum].entryTab[tabCnt] = FROM_LE_32(_resFiles[fileNum].entryTab[tabCnt]); + for (int tabCnt = 0; tabCnt < _resFiles[fileNum].numEntries * 2; tabCnt++) + _resFiles[fileNum].entryTab[tabCnt] = FROM_LE_32(_resFiles[fileNum].entryTab[tabCnt]); #endif - } } /** |
