diff options
author | Kari Salminen | 2008-07-22 10:15:58 +0000 |
---|---|---|
committer | Kari Salminen | 2008-07-22 10:15:58 +0000 |
commit | 2a90435e5dccc0085613e35cc7177d1766cea6d0 (patch) | |
tree | f803f0d048754e9733925a63ab345cab7d05ce14 /engines/cine/script_fw.cpp | |
parent | 446a0406de97dba9417df8f82c4363cd3542a64b (diff) | |
download | scummvm-rg350-2a90435e5dccc0085613e35cc7177d1766cea6d0.tar.gz scummvm-rg350-2a90435e5dccc0085613e35cc7177d1766cea6d0.tar.bz2 scummvm-rg350-2a90435e5dccc0085613e35cc7177d1766cea6d0.zip |
Fix for bug #2019355 (FW: broken compatibility with 0.11.1 saves):
- Changed savegame loading related functions to use SeekableReadStream
rather than InSaveFile so MemoryReadStream can be used transparently.
- Fixed loadResourcesFromSave to load multiframe animations correctly
and to load 0.11.0/0.11.1 Future Wars savegames which used a slightly
different format.
- Added a savegame format detector that tries to detect between the old
Future Wars savegame format, the new one and a broken revision of the
new one.
- Changed makeLoad to first load the savegame fully into memory and only
then handle it (If the savegame's packed then it's unpacked first). If
the packed savegame can't tell its unpacked size (i.e. it's using zlib
format) then we'll try to load up to 256kB of the savegame data.
Thanks to wjp for his help with nailing this release critical bug.
svn-id: r33192
Diffstat (limited to 'engines/cine/script_fw.cpp')
-rw-r--r-- | engines/cine/script_fw.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index 54a4976000..57b1e8f7b4 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -230,7 +230,7 @@ ScriptVars::ScriptVars(unsigned int len) : _size(len), _vars(new int16[len]) { * \param fHandle Savefile open for reading * \param len Size of array */ -ScriptVars::ScriptVars(Common::InSaveFile &fHandle, unsigned int len) +ScriptVars::ScriptVars(Common::SeekableReadStream &fHandle, unsigned int len) : _size(len), _vars(new int16[len]) { assert(_vars); @@ -306,7 +306,7 @@ void ScriptVars::save(Common::OutSaveFile &fHandle, unsigned int len) const { /*! \brief Restore array from savefile * \param fHandle Savefile open for reading */ -void ScriptVars::load(Common::InSaveFile &fHandle) { +void ScriptVars::load(Common::SeekableReadStream &fHandle) { load(fHandle, _size); } @@ -314,7 +314,7 @@ void ScriptVars::load(Common::InSaveFile &fHandle) { * \param fHandle Savefile open for reading * \param len Length of data to be read */ -void ScriptVars::load(Common::InSaveFile &fHandle, unsigned int len) { +void ScriptVars::load(Common::SeekableReadStream &fHandle, unsigned int len) { debug(6, "assert(%d <= %d)", len, _size); assert(len <= _size); for (unsigned int i = 0; i < len; i++) { |