[Scummvm-devel] WriteStream error checking
Marcus Comstedt
marcus at mc.pp.se
Thu Oct 13 07:25:50 CEST 2005
Hi guys.
When checking up the general status of the Dreamcast port, I noticed
that the savegame handling still needs a bit polishing. For one
thing, you get a popup happily proclaming that the save succeeded,
even if it in fact didn't due to a full memory card (this happens on
all systems, but is masked by the fact that harddisks are seldom that
full).
So I started to fix the Scumm engine save code to take into account
the ioFailed() method now avaiable. But it turned out not to be fully
that simple. The thing is that I buffer writes rather agressively on
the Dreamcast, because the memory cards are A) slow, B) flash memory,
and C) I want to try compressing the whole thing before I write
anything. But before I can say whether or not a series of writes
result in an I/O failure or not, I have to perform the actual I/O of
course.
My initial idea was to flush the data in the ioFailed() method, but
that won't really fly as the method is declared "const". So what I
want to do is to add a new method "void flush()" to the WriteStream
class, which should commit all data to storage and update the return
value of ioFailed() as appropriate. I can provide a default (dummy)
implementation, so ports which do not want to implement this
functionality don't have to. OTOH, it would be nice if engines would
use it (and ioFailed()) when saving to improve the quality of their
success reports. ;-)
Any objections?
// Marcus
More information about the Scummvm-devel
mailing list