Corrected casts to integers, adjusted for SDL2