diff --git a/bindings/py3devil1.py b/bindings/py3devil1.py index bf879af..9b958cf 100755 --- a/bindings/py3devil1.py +++ b/bindings/py3devil1.py @@ -89,7 +89,7 @@ class Devil1TEX_FN(ctypes.Structure): ctypes.c_uint, ctypes.c_char_p, ctypes.c_uint)), - ("gettexture", ctypes.CFUNCTYPE( + ("gettextures", ctypes.CFUNCTYPE( ctypes.c_bool, ctypes.POINTER(Texture), ctypes.c_uint, @@ -299,9 +299,12 @@ class TEXtureBatchDescriptor: def gettexturesize(self): return self.cstruct.contents.textureSize + +# Needs testing / correction - gettextures will 'return by parameter' +# a dynamic array of textures. Need to be able to access multiple Texture() class TEXtures: - def __init__(self, i, batchdescriptor, filedata): - self.cstruct = Texture()[batchdescriptor.gettexno()] + def __init__(self, i, count, filedata): + self.cstruct = ctypes.byref(Texture()) if filedata: devil1tex.gettextures(self.cstruct, i, filedata, len(filedata)) return @@ -383,6 +386,7 @@ if __name__ == "__main__": tbd = TEXtureBatchDescriptor(1, data) tbd.show() print(tbd.gettexturesize()) + tx = TEXtures(0, tbd.gettexno(), data) #---------------------------------------+ main()