mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 05:42:59 +05:30
Added exceptions for textures objects
This commit is contained in:
parent
cef4720e42
commit
53ec9b0474
@ -82,7 +82,8 @@ del libc
|
||||
class pyTexturePack:
|
||||
def __init__(self, filedata):
|
||||
self.cstruct = ctypes.pointer(TexturePack())
|
||||
devil1tex.getheader(ctypes.byref(self.cstruct), filedata)
|
||||
if not devil1tex.getheader(ctypes.byref(self.cstruct), filedata):
|
||||
raise RuntimeError("failed to get texture pack header")
|
||||
return
|
||||
|
||||
def show(self):
|
||||
@ -99,7 +100,12 @@ class pyTextureBatchDescriptor:
|
||||
self.cstruct = ctypes.pointer(TextureBatchDescriptor())
|
||||
ptrofptr = ctypes.byref(self.cstruct)
|
||||
if filedata:
|
||||
devil1tex.getbatchdesc(ptrofptr, i, filedata, len(filedata))
|
||||
if not devil1tex.getbatchdesc(
|
||||
ptrofptr,
|
||||
i,
|
||||
filedata,
|
||||
len(filedata)):
|
||||
raise RuntimeError("failed to get texturebatchdescriptor #" + str(i))
|
||||
return
|
||||
|
||||
def show(self):
|
||||
@ -128,7 +134,12 @@ class pyTextureBatch:
|
||||
self.cstruct.batch = ctypes.cast(
|
||||
ctypes.create_string_buffer(memsize),
|
||||
ctypes.POINTER(Texture))
|
||||
devil1tex.gettextures(self.cstruct.batch, i, filedata, len(filedata))
|
||||
if not devil1tex.gettextures(
|
||||
self.cstruct.batch,
|
||||
i,
|
||||
filedata,
|
||||
len(filedata)):
|
||||
raise RuntimeError("failed to get textures of batch #" + str(i))
|
||||
return
|
||||
|
||||
def gettextures(self):
|
||||
|
Loading…
Reference in New Issue
Block a user