示例#1
0
    def Atom(self, name, fourcc, data):
        print '\t' + fourcc

        count = Struct.uint16(data[0x10:0x12], endian='>')

        # file('rlat/%s.%s' % (name, fourcc), 'wb').write(data[:0x18])
        triplets = []

        # Calculate offset to triplets (added by dasda).
        off = Struct.uint16(data[4:6], endian='<') * 8 + 16

        for i in xrange(count):
            af = Struct.float(data[off:off + 4], endian='>')
            bf = Struct.float(data[off + 4:off + 8], endian='>')
            cf = Struct.float(data[off + 8:off + 0xC], endian='>')

            triplets.append((af, bf, cf))
            off += 0xC

        if fourcc == 'RLPA':
            self.brlyt.Objects[name].RLPA(triplets, self.Loop)
        elif fourcc == 'RLVC':
            self.brlyt.Objects[name].RLVC(triplets, self.Loop)
        elif fourcc == 'RLTS':
            self.brlyt.Objects[name].RLTS(triplets, self.Loop)
        elif fourcc == 'RLMC':
            self.brlyt.Objects[name].RLMC(triplets, self.Loop)
        else:
            for trip in triplets:
                print '\t\tTriplet: %f %f %f' % trip
示例#2
0
	def Atom(self, name, fourcc, data):
		#print '\t' + fourcc
		
		count = Struct.uint16(data[0x10:0x12], endian='>')
		
		# file('rlat/%s.%s' % (name, fourcc), 'wb').write(data[:0x18])
		triplets = []
		
		# Calculate offset to triplets (added by dasda).
		off = Struct.uint16(data[4:6], endian='<') * 8 + 16;
		
		for i in xrange(count):
			af = Struct.float(data[off:off+4], endian='>')
			bf = Struct.float(data[off+4:off+8], endian='>')
			cf = Struct.float(data[off+8:off+0xC], endian='>')
			
			triplets.append((af, bf, cf))
			off += 0xC
		
		if fourcc == 'RLPA':
			self.brlyt.Objects[name].RLPA(triplets, self.Loop)
		elif fourcc == 'RLVC':
			self.brlyt.Objects[name].RLVC(triplets, self.Loop)
		elif fourcc == 'RLTS':
			self.brlyt.Objects[name].RLTS(triplets, self.Loop)
		elif fourcc == 'RLMC':
			self.brlyt.Objects[name].RLMC(triplets, self.Loop)
		else:
			for trip in triplets:
				print '\t\tTriplet: %f %f %f' % trip
示例#3
0
	def PIC1(self, data):
		wii.chexdump(data)
		name = data[0xC:].split('\0', 1)[0]
		mat = Struct.uint16(data[0x5C:0x5E], endian='>')
		mat = self.Materials[mat]
		xs = Struct.float(data[0x44:0x48], endian='>')
		ys = Struct.float(data[0x48:0x4C], endian='>')
		x = Struct.float(data[0x24:0x28], endian='>')
		y = Struct.float(data[0x28:0x2C], endian='>')
		#print 'Picture %s maps to material %s' % (name, mat[0])
		#print '\t%fx%f (%f, %f)' % (xs, ys, x, y)
		
		p=Picture(name, mat, [x, y, xs, ys])
		self.PanePath[-1].Add(p)
		self.Objects[name] = p
示例#4
0
    def PIC1(self, data):
        wii.chexdump(data)
        name = data[0xC:].split('\0', 1)[0]
        mat = Struct.uint16(data[0x5C:0x5E], endian='>')
        mat = self.Materials[mat]
        xs = Struct.float(data[0x44:0x48], endian='>')
        ys = Struct.float(data[0x48:0x4C], endian='>')
        x = Struct.float(data[0x24:0x28], endian='>')
        y = Struct.float(data[0x28:0x2C], endian='>')
        print 'Picture %s maps to material %s' % (name, mat[0])
        print '\t%fx%f (%f, %f)' % (xs, ys, x, y)

        p = Picture(name, mat, [x, y, xs, ys])
        self.PanePath[-1].Add(p)
        self.Objects[name] = p
示例#5
0
	def PAN1(self, data):
		wii.chexdump(data)
		name =  data[0xC:].split('\0', 1)[0]
		x = Struct.float(data[0x24:0x28], endian='>')
		y = Struct.float(data[0x28:0x2C], endian='>')
		a = Struct.float(data[0x3C:0x40], endian='>')
		b = Struct.float(data[0x40:0x44], endian='>')
		xs = Struct.float(data[0x44:0x48], endian='>')
		ys = Struct.float(data[0x48:0x4C], endian='>')
		coords = [x, y, xs, ys]
		#print 'Pane %s:' % name, coords+[a,b]
		self.CurPane = Pane(name, coords)
示例#6
0
 def PAN1(self, data):
     wii.chexdump(data)
     name = data[0xC:].split("\0", 1)[0]
     x = Struct.float(data[0x24:0x28], endian=">")
     y = Struct.float(data[0x28:0x2C], endian=">")
     a = Struct.float(data[0x3C:0x40], endian=">")
     b = Struct.float(data[0x40:0x44], endian=">")
     xs = Struct.float(data[0x44:0x48], endian=">")
     ys = Struct.float(data[0x48:0x4C], endian=">")
     coords = [x, y, xs, ys]
     print "Pane %s:" % name, coords + [a, b]
     self.CurPane = Pane(name, coords)
示例#7
0
 def PAN1(self, data):
     wii.chexdump(data)
     name = data[0xC:].split('\0', 1)[0]
     x = Struct.float(data[0x24:0x28], endian='>')
     y = Struct.float(data[0x28:0x2C], endian='>')
     a = Struct.float(data[0x3C:0x40], endian='>')
     b = Struct.float(data[0x40:0x44], endian='>')
     xs = Struct.float(data[0x44:0x48], endian='>')
     ys = Struct.float(data[0x48:0x4C], endian='>')
     coords = [x, y, xs, ys]
     print 'Pane %s:' % name, coords + [a, b]
     self.CurPane = Pane(name, coords)