I spent a whole day researching this, but finally I've come up with a
design that I'm pretty confident will be able to be translated to a Mac
backend. I mean, it probably will... maybe. I think.
This comes with some API changes: it turns out most animated models use
a feature called "smooth skinning", which means animation transforms are
per vertex as well as per bone. Because of this, there's no longer any
need to expose bone IDs to plugins.
Completely changed the way Buffer objects are exposed in the API to make
them more in line with JavaScript's DataView. There are a few advantages
to this:
1. Much easier to understand how to send binary data from Lua<->Browser.
Basically only need to understand one API instead of two.
2. More depth than before with less complexity.
3. Buffer read functions can now also be used on strings.
This is a very big change. It goes some way to breaking up the massive
wall of code that was plugin.c, and also removes all the documentation
from plugin_api.h, in preparation for it soon being properly documented
using Texinfo. It also changes the way function tables and metatables
are loaded to make it easier to add new ones (and reduce binary size a
lot.)