Adapted to changes in texture manager.