diff --git a/bindings/py3devil1.py b/bindings/py3devil1.py index 24b9ada..20c5b4d 100755 --- a/bindings/py3devil1.py +++ b/bindings/py3devil1.py @@ -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()