+ moved Serializer and Deserializer to utils.serialization package
+ put all backward code in utils.serialization.backward
+ added static method on Deserializer to make its usage similar to other
utils in the package
- still not happy with the names used in Deserializer classes
(deserializer.deserialize ...)
+ piskel deserialization is now clearly asynchronous
+ added utils.Deserializer (not a singleton though, more a builder/loader)
+ utils.Deserializer constructor expects a callback
+ when all layers are loaded and piskel is ready, the callback provided by
the client is called with piskel as the first argument
- Deserializer doesn't fit in the utils package, which should be reserved
to singletons : can move it to service as a PiskelLoaderService, and
Deserializer could remain with only the purely static methods
- ImportController is realying on the Deserializer to build a Piskel but
it shouldn't. Find a way to mutualize the code necessary to create a
Piskel from an array of pskl.model.Frame
- still cleanup to do in app.js
- comments to add as well
- Initial implementation : working but ...
- MODEL_VERSION has been bumped to 2
- The loading process is now theoretically asynchronous (loading images to
read the content of the layers), but for now, the asynchronous behaviour
is hidden behind a nasty hack, which is somehow similar to lazy loading.
When loading the piskel, a Piskel is created synchronously, with fake
empty frames, and as the images will get loaded, the fake frames will be
replaced by the actual frames.
I really don't like this, and the asynchronous nature of the loading
should be clearly expressed
- There is no backward compatible deserializer for the previous version of
the model (1)
- The Serializer utils is just badly designed. Serialization and
deserialization should be splitted into two different classes
- Saving & loading are still done in app.js and should be moved to
services
BUT : the size of the piskels is now pretty small. A piskel which was
using 890kB previously is now using only 10kB. Although it should be
noted, that after gzip there is no significant difference between this
version and the existing one. The only gains we can really expect with
this are : less disk space used on appengine, ability to reuse the
layers' pngs directly on piskel-website (but to be honest I can't see any
valid use case for this)
!! NOT STABLE !!
Initial implementation. No UI update yet.
Check js/model/Piskel.js and js/model/Layer.js for an overview of the new
API.
Piskels can be saved on the existing service.
Previous piskels cannot be loaded. This should be fixed soon.