altered meta2tile.c