Building-sprite functions mostly restored, though not terribly optimised?  Anyway...