Every thing look's ok... if you are not using {$mode Delphi} then you must write code like this:
Code:
if &#40;&#40;X < GameScreen^.w&#41; or &#40;X > -TileSize&#41;&#41; and &#40;&#40;Y < GameScreen^.h&#41; or &#40;Y > -TileSize&#41;&#41;
Maybe I'm wrong, but i think that FPC doesn't automaticly convert pointer types to non pointer types (PSDL_Surface to TSDL_Surface).