Factored out -1 bone index check (still treats it as unsigned)
Factored out adding each vertex to the surface
Add vertices without indices and then let SurfaceTool generate
indices
Tested on Windows with some other changes to get it to compile that I
haven't included. Appears to be exactly as broken as the original, but it should be a bit faster and use less GPU memory since it only adds each vertex once per index and then reindexes instead of adding all vertexes to each surface.
Tested on Windows with some other changes to get it to compile that I haven't included. Appears to be exactly as broken as the original, but it should be a bit faster and use less GPU memory since it only adds each vertex once per index and then reindexes instead of adding all vertexes to each surface.