mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2025-05-31 14:11:42 +05:30
Merge branch 'python/finalize' of https://git.teknik.io/scuti/lib3ddevil1 into feature/documentation
This commit is contained in:
@ -136,7 +136,8 @@ class pyTextureBatch:
|
|||||||
self.cstruct.batch = None
|
self.cstruct.batch = None
|
||||||
tbd = pyTextureBatchDescriptor(i, filedata)
|
tbd = pyTextureBatchDescriptor(i, filedata)
|
||||||
self.amount = tbd.gettexnumber()
|
self.amount = tbd.gettexnumber()
|
||||||
memsize = self.amount * tbd.gettexturesize()
|
self.size = tbd.gettexturesize()
|
||||||
|
memsize = self.amount * self.size
|
||||||
self.cstruct.batch = ctypes.cast(
|
self.cstruct.batch = ctypes.cast(
|
||||||
ctypes.create_string_buffer(memsize),
|
ctypes.create_string_buffer(memsize),
|
||||||
ctypes.POINTER(Texture))
|
ctypes.POINTER(Texture))
|
||||||
@ -149,5 +150,12 @@ class pyTextureBatch:
|
|||||||
return
|
return
|
||||||
|
|
||||||
def gettextures(self):
|
def gettextures(self):
|
||||||
return self.cstruct.batch[:self.amount]
|
ptrs = self.cstruct.batch[:self.amount]
|
||||||
|
textures = []
|
||||||
|
for ptr in ptrs:
|
||||||
|
texture = ctypes.cast(ptr.data,
|
||||||
|
ctypes.POINTER(
|
||||||
|
ctypes.c_ubyte * self.size))[0]
|
||||||
|
textures.append(texture)
|
||||||
|
return textures
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user