Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GAFile:
- def __init__(self, bs, mdlList):
- self.bs = bs
- self.mdlList = mdlList
- bs.setEndian(NOE_BIGENDIAN)
- def check(self):
- return self.bs.readUInt() <= self.bs.getSize() and [self.bs.readUInt() for i in range(3)][2] == 0x11 # ?
- def load(self):
- bs = self.bs
- addr = bs.readUInt()
- unk = bs.readUInt()
- unk = bs.readUInt()
- unk0 = bs.readUInt() # 0x11
- loop = bs.readUInt()
- flag = bs.readUInt()
- numFrames = bs.readUInt()
- numBones = bs.readUInt()
- addrBones = bs.readUInt()
- addr1 = bs.readUInt()
- addr2 = bs.readUInt()
- addr3 = bs.readUInt()
- bs.seek(addrBones)
- bones = [{
- 'id': bs.readUInt(),
- 'unk': bs.readUInt(),
- 'start': bs.readUInt(),
- 'num': bs.readUInt(),
- } for i in range(numBones)]
- for x in bones:
- bs.seek(addr1 + x['start'] * 0xC)
- x[1] = [{
- 'unk0': [bs.readUByte() for j in range(4)],
- 'lastFrame': bs.readUShort(),
- 'num': bs.readUShort(),
- 'unk2': bs.readUShort(), # 0
- 'start': bs.readUShort(),
- } for i in range(x['num'])]
- for y in x[1]:
- bs.seek(addr3 + y['start'] * 0x4)
- y[1] = [{
- 'unke0': bs.readUByte(),
- 'frame': bs.readUByte(),
- 'unke1': bs.readUByte(),
- 'unke2': bs.readUByte(),
- } for i in range(y['num'])]
- for x in bones:
- for y in x:
- if y != 1:
- print(y + ':', x[y])
- for y in x[1]:
- for z in y:
- if z != 1:
- print('\t', z + ':', y[z])
- for z in y[1]:
- print('\t\t', z)
- print()
- return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement