This patch makes HWR_SortVisSprites faster by replacing selection sort ($O(n^2)) with quicksort. (O(n \log n)$)
O(n^2)
) with quicksort. (
O(n \log n)
Performance comparison: