Minor optimizations to drawing of flats

Removed some redundant code, and shifted calculation of sky texture
height so done only once per pass.