[Alephmodular-devel] Saved Games Serialized on branch
Status: Pre-Alpha
Brought to you by:
brefin
From: Br'fin <br...@ma...> - 2005-06-16 17:52:25
|
On Jun 16, 2005, at 1:17 PM, Jeremy Parsons wrote: > Update of /cvsroot/alephmodular/alephModular/marathon2 > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6535 > > Modified Files: > Tag: devel-loader > weapons.cpp computer_interface.cpp game_wad.cpp > Log Message: > Reworked load/save game paths to use tag_loader_array > Fixed CLoader's CListLoader to find array to load via sub-classed > accessor as opposed to specified at construction (When many arrays > hadn't been referenced at all yet) > With this set of changes, the devel-loader branch now has working serialization for all aspects of the saved game. Attempting to load a saved game from any previous compile results in an assert in the debug code and undefined behavior otherwise. Aside from general cleanup (Such as removing the old tag to global array and size table and code) I'm currently musing on some other aspects. - CListLoader's default _load_count() method should throw a CLoader::failure for the case it currently asserts on in the future this might even lead to meaningful error displays. - Many aspects of map loading are pretty much the same for a map as for a saved game. Appropriate loaders can and should be used there. - Right now the tag-to-loader roll is handled by an array. Should there be code to actually manage this and perform tag lookups? (for instance, the map could might then have loader_for_tag (ENDPOINT_TAG).load_data(data, length) whereas in the nearer future it might just have cl_endpoint_loader.load_data(data_length) instead.) - Certain loader classes could be further developed to detect the case of CLoader::failure due to bad count * unit_size vs length issues and try to fallback to a 'raw' reading method. This option should probably have ifdefs to only be allowed on PPC macs and if the structure still has a particular size. -Jeremy Parsons http://alephmodular.sourceforge.net/ |