Esempio n. 1
0
 def formatData(self):
     output = StreamWriter()
     output.writeString(self.string.ljust(0x100, "\0"))
     output.writeInt(0)
     output.writeInt(self.type)
     if self.type == 0:
         output.write(b'\xff' * 8)
     else:
         output.writeInt(self.decompressed_size)
         output.write(b'\00' * 4)
     return output.getvalue()
Esempio n. 2
0
 def compile(self, stream: StreamWriter):
     stream.writeInt(self.size)
     stream.writeInt(self.flags)
     if self.fourCC:
         stream.writeString(self.fourCC)
     else:
         stream.writeInt(0)
     stream.writeInt(self.RGBBitCount)
     stream.writeInt(self.RBitMask)
     stream.writeInt(self.GBitMask)
     stream.writeInt(self.BBitMask)
     stream.writeInt(self.ABitMask)
Esempio n. 3
0
 def formatData(self):
     output = StreamWriter()
     output.writeInt(self.offset)
     output.writeInt(self.size)
     # if scene data, don't write a string
     if self.string == "SceneData":
         output.writeInt(0)
     else:
         output.writeInt(self.string_length)
         output.writeString(self.string, encoding="utf-8")
     output.writeInt(self.type)
     # write padding
     output.write(b"\x00" * 8)
     return output.getvalue()
Esempio n. 4
0
 def formatData(self):
     output = StreamWriter()
     output.writeString(self.string.ljust(0x108, "\0"))
     output.writeInt(1)
     output.writeInt(self.width)
     output.writeInt(self.height)
     output.writeInt(1)
     output.writeInt(self.mip_map_count)
     output.writeInt(self.face_count)
     output.writeInt(self.type)
     output.write(b'\0' * 8)
     output.writeInt(self.size)
     output.writeInt(0)
     output.writeInt(self.size2)
     output.writeInt(self.offset)
     output.writeInt(0)
     output.writeInt(self.size3)
     output.writeInt(0)
     return output.getvalue()
Esempio n. 5
0
 def compile(self):
     stream = StreamWriter()
     stream.writeString(self.magic)
     stream.writeInt(self.size)
     stream.writeInt(self.flags)
     stream.writeInt(self.height)
     stream.writeInt(self.width)
     stream.writeInt(self.pitchOrLinearSize)
     stream.writeInt(self.depth)
     stream.writeInt(self.mipmap_count)
     for item in self.reserved:
         stream.writeInt(0)
     self.ddspf.compile(stream)
     stream.writeInt(self.caps)
     stream.writeInt(self.caps2)
     stream.writeInt(self.caps3)
     stream.writeInt(self.caps4)
     stream.writeInt(self.reserved2)
     return stream.getvalue()