コード例 #1
0
 def read(self, fin, start, size):
     self.mipmapCount, self.width, self.height = self.header.unpack(
         fin.read(0x38))
     self.data = readTextureData(fin,
                                 self.format,
                                 self.width,
                                 self.height,
                                 mipmapCount=self.mipmapCount)
コード例 #2
0
ファイル: bfn.py プロジェクト: vgisuruex/smstools
 def read(self, fin, start, size):
     fin.seek(0xC, 1)
     self.format, self.w, self.h = self.header.unpack(fin.read(0xa))
     self.arrayCount = (size-0x18)/calcTextureSize(self.format, self.w, self.h)
     #self.h = (size-0x18)/w
     #if format == 0: self.h *= 2
     fin.seek(2, 1)
     self.data = readTextureData(fin, self.format, self.w, self.h, arrayCount=self.arrayCount)
コード例 #3
0
 def read(self, fin, start, size):
     self.count, self.format, self.width, self.height, offset = self.header.unpack(
         fin.read(0x18))
     print("Fmt:", self.format, "Sz:", self.width, self.height)
     fin.seek(offset)
     self.data = readTextureData(fin,
                                 self.format,
                                 self.width,
                                 self.height,
                                 arrayCount=self.count)
コード例 #4
0
 def read(self, fin, start, size):
     self.minimumFontCode, self.maximumFontCode, self.glyphWidth, self.glyphHeight, self.arraySize, self.format, self.columns, self.rows, self.w, self.h = self.header.unpack(
         fin.read(self.header.size))
     self.format = TF(self.format)
     self.arrayCount = (size - self.header.size - 8) / self.arraySize
     #self.h = (size-0x18)/w
     #if format == 0: self.h *= 2
     self.data = readTextureData(fin,
                                 self.format,
                                 self.w,
                                 self.h,
                                 arrayCount=self.arrayCount)
コード例 #5
0
assert zero1 == 0, hex(fin.tell())

print("%d regions" % nRegions)

for i in range(nRegions):
    sz, zero2 = unpack('>II', fin.read(8))

    #assert sz == 0x20000, hex(fin.tell())
    #assert zero2 == 0, hex(fin.tell())

    x1, y1, z1, x2, y2, z2 = unpack('>ffffff', fin.read(24))

    widthPow, heightPow, unk3, dataOffset = unpack('>HHII', fin.read(12))
    width = 1 << widthPow
    height = 1 << heightPow

    print("(%f,%f,%f),(%f,%f,%f) 0x%X" % (x1, y1, z1, x2, y2, z2, unk3))

    lastRegionHeader = fin.tell()

    fin.seek(dataOffset)
    data = readTextureData(fin, GX_TF_I8, width, height)

    images = decodeTexturePIL(data, GX_TF_I8, width, height, 0, None)
    images[0][0].save(
        os.path.splitext(sys.argv[1])[0] + "-%d-%X.png" % (i, unk3))

    fin.seek(lastRegionHeader)

fin.close()
コード例 #6
0
ファイル: ymap.py プロジェクト: impiaaa/smstools
fin.seek(dataOffset)

print("%d regions" % nRegions)

for i in range(nRegions):
    sz, zero2 = unpack('>II', fin.read(8))

    #assert sz == 0x20000, hex(fin.tell())
    #assert zero2 == 0, hex(fin.tell())

    x1, y1, z1, x2, y2, z2 = unpack('>ffffff', fin.read(24))

    widthPow, heightPow, unk3, dataOffset = unpack('>HHII', fin.read(12))
    width = 1 << widthPow
    height = 1 << heightPow

    print("(%f,%f,%f),(%f,%f,%f) 0x%X" % (x1, y1, z1, x2, y2, z2, unk3))

    lastRegionHeader = fin.tell()

    fin.seek(dataOffset)
    data = readTextureData(fin, TF.I8, width, height)

    images = decodeTexturePIL(data, TF.I8, width, height, 0, None)
    images[0][0].save(
        os.path.splitext(sys.argv[1])[0] + "-%d-%X.png" % (i, unk3))

    fin.seek(lastRegionHeader)

fin.close()