Gankro/Jterniabound — pull request #27 by LtSquigs (2012-09-03 06:11:57+00:00)
Title: Fixing Serialization Saving/Loading

This pull request fixes a few minor things:

First off, I had to change compression algorithms for the save/load to a library called base32k. The problem with the old compression algorithm was a lack of proper UTF support, this one should have more support. (If you don't want to add the library, could just not have compression on the serialized data).

For the serialization saving/loading I fixed a type in the XML that was preventing it from loading correctly, and I changed what URL the AJAX loading method passes to the asset manager. Before it was constructing a blob url to pass to it, which was then causing the asset manager to mess up really bad when trying to load the serialized data, now it just passes it the original assets url.

With these changes loading and saving state seems to work fine for me. So this should solve issue #20 (you can test it in console by calling Sburb.saveStateToStorage() and Sburb.loadStateFromStorage())

Also, one last fix. For some reason the line

xhr.onabort = xhr.onerror = asset.failure;

wasn't actually working for me. So I changed it to:

xhr.onabort = function() { asset.failure() };
xhr.onerror = function() { asset.failure() };

and now it properly reports failed loads.