[Scummvm-devel] Unifying data loading, saving and printing (SCUMM, Tinsel & Cine, maybe others?)
Max Horn
max at quendi.de
Sat Aug 2 23:50:43 CEST 2008
Am 30.07.2008 um 13:20 schrieb Kari Salminen:
> Hi everyone,
Hi Kari!
Since so far nobody said anything, I guess we are mostly alone with
this one :)
>
> Max threw the idea that at some point we might combine
> the savegame handling so that at least SCUMM, Tinsel and
> Cine could use the same code for handling their savegames.
> I really like this idea but it also brought another thing to my mind:
> How about also putting debug printing into the mix (As saving
> and loading of data is already combined into a single function in
> the SCUMM engine).
>
> Using the same structs that describe what variables to load or
> save we could make a printout of the variables' values (The
> structs contain information about what type the variables are,
> their signedness, size etc). That'd be a big help in debugging
> and it'd be nice to not have to generate those debug printing
> routines by hand ;-).
That might be a nice touch, it could even be automatically hooked to
the debugger, to make it possible to read (and even write) all of
these values from there. However, I would consider it as a secondary
feature.
Plus, in the approach we chose in Tinsel, it wouldn't work like that,
because we don't store the required data in a struct there, like SCUMM
does. One of the reasons being that the code in SCUMM requires a nasty
hack in order to derive offsets for class members relative to the
start of an arbitrary instance, thus resulting in code which violates
the C++ standard a bit, and thus in theory could lead to problems in
some future compiler (it does not cause any problems with any existing
C++ compiler, AFAIK, and it seems unlikely that it ever will, but it
could...)
Bye,
Max
More information about the Scummvm-devel
mailing list