safe bmp tex loading on Mac from 0ffb1d6.