Exemplo n.º 1
0
def write_planet_str():
    vals = scan.collect_data()
    planetctbase = [x for x in vals if x[0] == 'OOLITE_COLOR_TAB'][0]
    (basepkg, ctinst, typ) = scan.res_decode_str(planetctbase[1])
    xltinst = ctinst + 1
    reslist = []
    deflist = []
    rmplist = []
    pkg = basepkg
    for (planettype, xltindex) in zip(planettypes, xlattabs):
        ctres = "planet.%s.colortable" % planettype
        xltres = "planet.%s.translatetable" % planettype
        defname = planettype
        if planettype in headersymbols:
            defname = headersymbols[defname]
        defname = defname.upper()
        ctdef = "%s_COLOR_TAB" % defname
        xltdef = "%s_XLAT_TAB" % defname
        if xltindex in headersymbols:
            oldxltdef = "%s_XLAT_TAB" % headersymbols[xltindex].upper()
        else:
            oldxltdef = "%s_XLAT_TAB" % xltindex.upper()
        ctmatch = [x for x in vals if x[0] == ctdef]
        xltmatch = [x for x in vals if x[0] == oldxltdef]
        if len(ctmatch) != 1:
            raise ValueError, "Couldn't find unique %s" % ctdef
        if len(xltmatch) != 1:
            raise ValueError, "Couldn't find unique %s" % oldxltdef
        ctfile = ctmatch[0][3]
        xltfile = xltmatch[0][3]
        reslist.append("%3d %3d %3d %s" % (pkg, ctinst, typ, ctres))
        reslist.append("%3d %3d %3d %s" % (pkg, xltinst, typ, xltres))
        deflist.append("#define %s %s" %
                       (ctdef, scan.res_encode_str(pkg, ctinst, typ)))
        deflist.append("#define %s  %s" %
                       (xltdef, scan.res_encode_str(pkg, xltinst, typ)))
        rmplist.append("%s = STRTAB:%s" % (ctres, ctfile))
        rmplist.append("%s = STRTAB:%s" % (xltres, xltfile))
        pkg += 1
    for l in reslist:
        print l
    print
    print "---"
    print
    for l in deflist:
        print l
    print
    print "---"
    print
    for l in rmplist:
        print l
Exemplo n.º 2
0
def write_planet_str():
    vals = scan.collect_data()
    planetctbase = [x for x in vals if x[0] == "OOLITE_COLOR_TAB"][0]
    (basepkg, ctinst, typ) = scan.res_decode_str(planetctbase[1])
    xltinst = ctinst + 1
    reslist = []
    deflist = []
    rmplist = []
    pkg = basepkg
    for (planettype, xltindex) in zip(planettypes, xlattabs):
        ctres = "planet.%s.colortable" % planettype
        xltres = "planet.%s.translatetable" % planettype
        defname = planettype
        if planettype in headersymbols:
            defname = headersymbols[defname]
        defname = defname.upper()
        ctdef = "%s_COLOR_TAB" % defname
        xltdef = "%s_XLAT_TAB" % defname
        if xltindex in headersymbols:
            oldxltdef = "%s_XLAT_TAB" % headersymbols[xltindex].upper()
        else:
            oldxltdef = "%s_XLAT_TAB" % xltindex.upper()
        ctmatch = [x for x in vals if x[0] == ctdef]
        xltmatch = [x for x in vals if x[0] == oldxltdef]
        if len(ctmatch) != 1:
            raise ValueError, "Couldn't find unique %s" % ctdef
        if len(xltmatch) != 1:
            raise ValueError, "Couldn't find unique %s" % oldxltdef
        ctfile = ctmatch[0][3]
        xltfile = xltmatch[0][3]
        reslist.append("%3d %3d %3d %s" % (pkg, ctinst, typ, ctres))
        reslist.append("%3d %3d %3d %s" % (pkg, xltinst, typ, xltres))
        deflist.append("#define %s %s" % (ctdef, scan.res_encode_str(pkg, ctinst, typ)))
        deflist.append("#define %s  %s" % (xltdef, scan.res_encode_str(pkg, xltinst, typ)))
        rmplist.append("%s = STRTAB:%s" % (ctres, ctfile))
        rmplist.append("%s = STRTAB:%s" % (xltres, xltfile))
        pkg += 1
    for l in reslist:
        print l
    print
    print "---"
    print
    for l in deflist:
        print l
    print
    print "---"
    print
    for l in rmplist:
        print l
Exemplo n.º 3
0
def write_planet_gfx():
    vals = scan.collect_data()
    planetanibase = vals.index([x for x in vals if x[0] == "PLANET00_BIG_MASK_PMAP_ANIM"][0])
    (pkg, inst, typ) = scan.res_decode_str(vals[planetanibase][1])
    resmap = []
    for planettype in planettypes:
        for size in ["large", "medium", "small"]:
            print "%3d %3d %3d planet.%s.%s" % (pkg, inst, typ, planettype, size)
            resmap.append(("planet.%s.%s" % (planettype, size), vals[planetanibase][3]))
            planetanibase += 1
            inst += 1
        pkg += 1
    print
    print "---"
    print
    for (key, val) in resmap:
        print "%s = GFXRES:%s" % (key, val)
Exemplo n.º 4
0
def write_planet_gfx():
    vals = scan.collect_data()
    planetanibase = vals.index(
        [x for x in vals if x[0] == 'PLANET00_BIG_MASK_PMAP_ANIM'][0])
    (pkg, inst, typ) = scan.res_decode_str(vals[planetanibase][1])
    resmap = []
    for planettype in planettypes:
        for size in ['large', 'medium', 'small']:
            print "%3d %3d %3d planet.%s.%s" % (pkg, inst, typ, planettype,
                                                size)
            resmap.append(
                ("planet.%s.%s" % (planettype, size), vals[planetanibase][3]))
            planetanibase += 1
            inst += 1
        pkg += 1
    print
    print "---"
    print
    for (key, val) in resmap:
        print "%s = GFXRES:%s" % (key, val)