Ejemplo n.º 1
0
    def read(self, stream):
        self.io_start = stream.tell()
        self.dxgi_format = DxgiFormat(stream.read_uint())
        self.resource_dimension = D3D10ResourceDimension(stream.read_uint())
        self.misc_flag = stream.read_uint()
        self.array_size = stream.read_uint()
        self.misc_flag_2 = stream.read_uint()

        self.io_size = stream.tell() - self.io_start
 def __init__(self, arg=None, template=None):
     self.arg = arg
     self.template = template
     self.io_size = 0
     self.io_start = 0
     self.dxgi_format = DxgiFormat()
     self.resource_dimension = D3D10ResourceDimension()
     self.misc_flag = 0
     self.array_size = 0
     self.misc_flag_2 = 0
Ejemplo n.º 3
0
 def __init__(self, context, arg=None, template=None):
     self.name = ''
     self._context = context
     self.arg = arg
     self.template = template
     self.io_size = 0
     self.io_start = 0
     self.dxgi_format = DxgiFormat()
     self.resource_dimension = D3D10ResourceDimension()
     self.misc_flag = 0
     self.array_size = 0
     self.misc_flag_2 = 0
     self.set_defaults()
Ejemplo n.º 4
0
				# add one fully blank line for those cases
				if num_slices_y == 1:
					for k in range(total_width // 4):
						packed_writer.write(self.empty_block)

			packed_mip_bytes = packed_writer.getvalue()

		out_mips.append(packed_mip_bytes)

		# get final merged output bytes
		return b"".join(out_mips)

	def pack_mips_pc(self, num_mips):
		"""Grab the lower mip levels according to the count"""
		first_mip_index = self.mipmap_count - num_mips
		print("first mip", first_mip_index)

		# get final merged output bytes
		return b"".join([b for h, w, b in self.mips[first_mip_index:]])


if __name__ == "__main__":
	m = DdsFile()
	m.load("C:/Users/arnfi/Desktop/parrot/parrot.pbasecolourtexture.dds")
	print(m)
	d = D3D10ResourceDimension()
	print(d)
	d = D3D10ResourceDimension(1)
	print(d)
Ejemplo n.º 5
0
 def set_defaults(self):
     self.dxgi_format = DxgiFormat()
     self.resource_dimension = D3D10ResourceDimension()
     self.misc_flag = 0
     self.array_size = 0
     self.misc_flag_2 = 0