Fixed TEXturePack struct

This commit is contained in:
_ 2018-04-27 04:44:55 -07:00
parent be691baffb
commit 62841adcb9

View File

@ -275,21 +275,18 @@ class PLDHeader:
class TEXturePack:
def __init__(self, filedata):
self.cstruct = TexturePack()
self.th = ctypes.pointer(self.cstruct)
devil1tex.getheader(ctypes.byref(self.th), filedata)
devil1tex.printheader(self.th)
self.cstruct = ctypes.pointer(TexturePack())
devil1tex.getheader(ctypes.byref(self.cstruct), filedata)
return
def show(self):
devil1tex.printheader(ctypes.byref(self.cstruct))
devil1tex.printheader(self.th)
devil1tex.printheader(self.cstruct)
def getbatchno(self):
return self.cstruct.batchNumber
return self.cstruct.contents.batchNumber
def getfirstbatchoffset(self):
return self.cstruct.firstBatchOffset
return self.cstruct.contents.firstBatchOffset
class TEXtureBatchDescriptor:
def __init__(self, i, filedata):
@ -390,6 +387,8 @@ if __name__ == "__main__":
data = f.read()
txp = TEXturePack(data)
txp.show()
print(txp.getbatchno())
print(txp.getfirstbatchoffset())
#---------------------------------------+
# main()
mainx()