surface: Use a more stable sort for the Z buffer
surface: Use a more stable sort for the Z buffer

The normal Array.sort() method is very much implementation-dependant and
will cause sprites with the same Z-index to constantly swap during
redraw.

For example on Firefox, Array.sort() behaves like ArraySort, but on
Chrome/Chromium it is highly unstable.

Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org>

aszlig/hase