precalculate sprite drawing order