From accf440047793abd6e44f19071ce3778799c4ad8 Mon Sep 17 00:00:00 2001 From: _ <_> Date: Sun, 13 May 2018 01:08:56 -0700 Subject: [PATCH] Added interface for GEOHeader --- bindings/py3devil1.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bindings/py3devil1.py b/bindings/py3devil1.py index 9b958cf..18d1e67 100755 --- a/bindings/py3devil1.py +++ b/bindings/py3devil1.py @@ -309,6 +309,18 @@ class TEXtures: devil1tex.gettextures(self.cstruct, i, filedata, len(filedata)) return +class GEOHeader: + def __init__(self, filedata): + self.cstruct = ctypes.pointer(Header()) + ptrofptr = ctypes.byref(self.cstruct) + if filedata: + devil1geo.getheader(ptrofptr, filedata) + return + + def show(self): + devil1geo.printheader(self.cstruct) + pass + #--------------------------------------+ # Regular Python #--------------------------------------+ @@ -388,7 +400,12 @@ if __name__ == "__main__": print(tbd.gettexturesize()) tx = TEXtures(0, tbd.gettexno(), data) + with open("pl00.pld_0", "rb") as f: + data = f.read() + gh = GEOHeader(data) + gh.show() + #---------------------------------------+ - main() + # main() mainx()