diff options
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/m4/script.h | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/m4/script.h b/engines/m4/script.h index 63dc32958b..2cb2219b8d 100644 --- a/engines/m4/script.h +++ b/engines/m4/script.h @@ -120,8 +120,7 @@ public:  		clear();  	}  	template<class T> -	T *load(Common::File *fd, uint32 ofs) { -		T *item; +	void load(Common::File *fd, uint32 ofs, T *&item) {  		if (_cache.contains(ofs)) {  			item = (T*)(_cache[ofs]);  		} else { @@ -130,7 +129,6 @@ public:  			item->load(fd);  			_cache[ofs] = item;  		} -		return item;  	}  	void clear() {  		// TODO: Free all cached items @@ -300,7 +298,8 @@ public:  	const T& toData(const ScriptValue &value) {  		printf("ScriptInterpreter::toData() index = %d; type = %d; max = %d\n", value.value, _data[value.value]->type, _data.size());  		assert((uint32)value.value < _data.size()); -		T *result = _dataCache->load<T>(_scriptFile, _data[value.value]->offset); +		T *result = 0; +		_dataCache->load(_scriptFile, _data[value.value]->offset, result);  		return *result;  	}  | 
