""" A simple tool for converting 512x64x512 icemap files into vxl. NOTE: this does NOT do the icemap footer variant. (Yet.) GreaseMonkey, 2012 - Public Domain """ import sys, struct USAGE_MSG = """ usage: python2 icemap2vxl.py in.icemap out.vxl note: icemap file MUST be 512x64x512, and the type information will be LOST! """ if len(sys.argv) <= 2: print USAGE_MSG exit() infp = open(sys.argv[1],"rb") if infp.read(8) != "IceMap\x1A\x01": raise Exception("not an IceMap v1 file") while True: tag = infp.read(7) taglen = ord(infp.read(1)) if tag == " "*7: break if taglen == 255: taglen, = struct.unpack("