ported sgs-sdl to latest version of SGScript