[Scummvm-devel] PORTERS: Changed made to DefaultSaveFileManager

Max Horn max at quendi.de
Tue Aug 5 13:42:40 CEST 2008


Hi there,

this mail is intended for all porters who use the
DefaultSaveFileManager in their port, in particular
 * iPhone
 * PSP
 * Wii
 * GP2x
 * PalmOS
 * SDL
 * WinCE
 * Symbian

I recently made two major changes to the DefaultSaveFileManager code.

One is that now the default savepath is not set in
base/commandline.cpp anymore, but rather by passing the default path
as a constructor parameter to DefaultSaveFileManager. I already made
the relevant changes to some ports (GP2x, PalmOS, iPhone). For the
others, a backward compatibility constructor exists which contains the
old code for setting the default savepath. The plan is to gradually
phase this out.


The second change is that now we don't use std C FILE to implement the
savefiles, but rather rely on FilesystemNode (which right now also
makes use of Common::File and Common::DumpFile for the actual I/O, but
that is going to change, see the recent big thread on this list). The
immediate change, though, is that the "savepath" is now convered into
a FSNode; and the savefile which is to be loaded/saved/deleted is then
acquired by invoking FSNode::getChild() on that dir node.

Ideally, all ports will run just fine with these changes. However, it
uncovered a bug in the Windows implementation of FSNode::getChild()
already. After some visual inspection, it seems that the PalmOS and
Symbian ports are affected as well: Their getChild method returns 0 if
the requested child node does not exist, but that makes it impossible
to acquire a node for a file which does not yet exist but is about to
be created. The correct implementation would be to return a node which
returns false when it's exists() method is called.
I *think* no other port is affected, but certainly the only way to be
sure is to do testing. In particular, trying to load saves and save
saves (for the latter, try both saving over an existing save, and
creating a new state).

If you notice any regressions or have questions, do not hesitate to
contact me and as usual I'll do my best to work with you on finding a
solution.

Cheers,
Max




More information about the Scummvm-devel mailing list