Added Paul's changes to the latest revision of libgdx.