The `setCurrentTime()` function calls `AL.sourcePlay()` if `playing` is
still true, so that should only be called after `playing = false;`.
One could also place the call before `AL.sourceStop()`, but that will
lead to a few extra function calls. Plus, if `stop()` is supposed to
reset the playback time, it should probably do that whether or not the
sound is playing (i.e., outside the `if` block).
Packed asset libraries are sequences of individual files, sometimes compressed, and concatenated. If each file is compressed, this causes the asset pack as a whole to begin with compressed file headers, which may cause some software to mistake the file as being one large compressed file, which it isn't.
For example, some html5 web portals may try to automatically determine if a file is gzip-compressed, and if they are, serve the file with the "content-encoding: gzip" header. That will cause a web browser to decompress the file while downloading it, leading to two issues:
1. The compressed file header is only for the first file in the pack, so we'll only receive the data for the first file.
2. The data will be in an already-decompressed state, which we don't expect.
This will manifest as an error like "Uncaught incorrect header check" when trying to load and decompress what we expect to be compressed data.
This change prepends the string "asset-pack" to the start of the file. It's applied to all pack types, not just compressed ones. For uncompressed packs, I presume that there's the possibility that whatever file header happens to be present on the first file in the pack has other inadvertent effects.
When parsing the attributes attached to a launchStoryboard element, in addition to the colon character (`:`), allow the hyphen character (`-`) to be used as the separator between a template property's name and its type.
Although colon is familiar to Haxe developers as the variable type specifier (e.g. `var i:Int = 0;`), the colon character's expected usage within xml is to separate the local name from the namespace. So usage of colon here could be unexpected, and also causes trouble in formalizing the specification as an xsd.
Retain the ability to parse `:` for backward compatibility.
The previous version was backwards - `native_audio_buffers` would be ignored if defined, and used if not defined. Worse, with all the `!` operators, it was hard to tell.
This implementation tries to fix the error in a way that is easier for a human to check.
Now that `project.workingDirectory` exists, we may as well use it.
I considered adding "${workingDirectory}" as a valid value, to match
"`project.workingDirectory`", but decided to keep changes to a minimum.