diff options
| author | Max Horn | 2002-12-24 16:10:31 +0000 | 
|---|---|---|
| committer | Max Horn | 2002-12-24 16:10:31 +0000 | 
| commit | 190685dc69dad12563ccf8ed3689ec1f34cff360 (patch) | |
| tree | 540f3044d93a6049b8f3e862be44dceb59dff68b /scumm/resource.cpp | |
| parent | 22ab263b002c2f0946fa56c2463860f64b384278 (diff) | |
| download | scummvm-rg350-190685dc69dad12563ccf8ed3689ec1f34cff360.tar.gz scummvm-rg350-190685dc69dad12563ccf8ed3689ec1f34cff360.tar.bz2 scummvm-rg350-190685dc69dad12563ccf8ed3689ec1f34cff360.zip | |
added a map from object names to object ids
svn-id: r6104
Diffstat (limited to 'scumm/resource.cpp')
| -rw-r--r-- | scumm/resource.cpp | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 475e80bbc0..1d49f702b5 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -25,6 +25,8 @@  #include "resource.h"  #include "verbs.h"  #include "scumm/sound.h" +#include "common/map.h" +#include "common/str.h"  #include <stdio.h> @@ -274,8 +276,13 @@ void Scumm::readIndexFile()  			assert(num == _numGlobalObjects);  			if (_features & GF_AFTER_V8) {	/* FIXME: Not sure.. */ +				char buffer[40];  				for (i = 0; i < num; i++) { -					_fileHandle.seek(40, SEEK_CUR); +					_fileHandle.read(buffer, 40); +					if (buffer[0]) { +						// Add to object name-to-id map +						_objectIDMap[buffer] = i; +					}  					_objectStateTable[i] = _fileHandle.readByte();  					_objectRoomTable[i] = _fileHandle.readByte();  					_classData[i] = _fileHandle.readUint32LE(); @@ -292,7 +299,7 @@ void Scumm::readIndexFile()  					_objectOwnerTable[i] &= OF_OWNER_MASK;  				}  			} - +			  			if (!(_features & GF_AFTER_V8)) {  				_fileHandle.read(_classData, num * sizeof(uint32)); | 
