Replaced std::sort with std::stable_sort in Sprite.cpp