mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-26 00:38:55 +05:30
Adjusted constructor to allow default 'blank' pld's
This commit is contained in:
parent
a349c8da52
commit
e06d7dcd8f
@ -239,12 +239,12 @@ devil1tex = Devil1TEX_FN.in_dll(libc, "DEVIL1TEX")
|
|||||||
devil1geo = Devil1GEO_FN.in_dll(libc, "DEVIL1GEO")
|
devil1geo = Devil1GEO_FN.in_dll(libc, "DEVIL1GEO")
|
||||||
|
|
||||||
class PLDHeader:
|
class PLDHeader:
|
||||||
def __init__(self, filedata):
|
def __init__(self, filedata = None):
|
||||||
h = PldHeader()
|
|
||||||
devil1pld.getheader(ctypes.byref(h), filedata)
|
|
||||||
self.offsets = []
|
self.offsets = []
|
||||||
for i in range(0, h.numOffset):
|
if filedata:
|
||||||
self.offsets.append(h.offsets[i])
|
h = PldHeader()
|
||||||
|
devil1pld.getheader(ctypes.byref(h), filedata)
|
||||||
|
self.offsets = h.offsets[:h.numOffset]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
output = "numOffset: %s" % str(len(self.offsets))
|
output = "numOffset: %s" % str(len(self.offsets))
|
||||||
@ -313,6 +313,8 @@ if __name__ == "__main__":
|
|||||||
data = f.read()
|
data = f.read()
|
||||||
pld = PLDHeader(data)
|
pld = PLDHeader(data)
|
||||||
print(pld)
|
print(pld)
|
||||||
|
pld2 = PLDHeader()
|
||||||
|
print(pld2)
|
||||||
#---------------------------------------+
|
#---------------------------------------+
|
||||||
# main()
|
# main()
|
||||||
mainx()
|
mainx()
|
||||||
|
Loading…
Reference in New Issue
Block a user