[Scummvm-devel] Unifying data loading, saving and printing (SCUMM, Tinsel & Cine, maybe others?)
Johannes Schickel
lordhoto at gmail.com
Sun Aug 3 15:23:16 CEST 2008
On Sunday 03 August 2008 14:54:12 Max Horn wrote:
> > Also I would propose instead of those BE/LE member functions to
> > change the Serializer to accept an SeekableSubReadStreamEndian or
> > similar. For example in Kyra I am using unlike the original
> > savegames, which used LE, BE for saving. Thus to share as much as
> > possible loading code (we leave out some unused data) I'm using
> > SeekableSubReadStreamEndian to read the data.
>
> Could you elaborate a bit on this, i.e. explain what the advantage
> would be?
Well the KYRA engine is able to load both ScummVM savegames and savegames
from original interpreter (just some specific savegame versions though). For
reducing the code duplication overhead I'm using an
SeekableSubReadStreamEndian to specifcy the endianness used by the specific
format. If I wouldn't do that I would have to write two sperate functions:
One for loading ScummVM savegames and one for loading original savegames.
Check out engines/kyra/saveload_hof.cpp for example.
Short: The advantage is reduced code size when supporting different endianess
savegames. Might be of course a KYRA specific issue though, but I wouldn't
want to switch to another solution until it offers any advantages :-). So
that's only thing which I would like to see supported by such a 'versioned'
serializer apart proper versioning support.
// Johannes
More information about the Scummvm-devel
mailing list