porting code to libtcod. what a pain.