Fixed the game resizing algorithm and made it much more robust.

This is part of #232 and #206.
The windows resizing algorithm was using a function only working in fullscreen mode. Thanks to bit.dangler from libsdl for pointing out
my own mistake.

The game will now use the desktop current resolution when in fullscreen and back up to a standard resolution if the fullscreen was higher than 1024 in width.