small optimization

entities arnt rendered off screen any more
seperate sub routines for rendering the shadows and map texture