[aquaria] [patch] Demo Saving and Loading

GMMan yukaili.geek at gmail.com
Tue Jan 4 10:55:10 EST 2011


Hello everyone,

Attached is a patch I made that implements loading and saving demos into xml
format (and zlib compressed counterpart). Saving and loading is accessible
from the developer menu (Shift-Backspace) and using "L" to load and "D" to
save.

This is my first piece of non-book-exercise type code in C++, so it's bound
to be a little less efficient than it should be. The most particular thing
that I think should be changed is overloading ">>" to load values to the
ButtonState enum instead of using a function, but because I'm not
established in C++, that means I might waste tens of minutes recompiling
because every declaration is in DSQ.h (a gripe I have about it).

A few to-dos for the demo system:
- Make a UI so that it's not cluttering up the developer menu
- Fix a minor glitch that freezes input when there are no frames recorded
(should not happen, but does anyway)
- Add entity states to demo file so that we're not shooting at non-existent
enemies or trying to open a song egg that's already opened.

That's all I can think of at the moment. Have fun with the patch.

--GMMan

P. S. Mercurial decided to swap out entire files instead of doing a simple
diff, so the attached patch is gzipped.

------------------------------------------

Description for the patch:

Implemented demo loading and saving.

Features can be accessed through the developer menu at Shift-Backspace. "L"
is for loading and "D" is for saving. If you want to be able to use the
developer menu globally, make sure to undefine AQUARIA_FULL and
AQUARIA_DEMO.

Patch by GMMan (Yukai Li) <yukaili.geek at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/aquaria/attachments/20110104/422277a3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo_impl.diff.gz
Type: application/x-gzip
Size: 55804 bytes
Desc: not available
URL: <http://icculus.org/pipermail/aquaria/attachments/20110104/422277a3/attachment-0001.gz>


More information about the aquaria mailing list