mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 05:42:59 +05:30
Added final names for pld component
This commit is contained in:
parent
42e2d88734
commit
a5abb9d24f
@ -1,4 +1,4 @@
|
||||
from py3devil1pld import PLDHeader
|
||||
from py3devil1pld import PldHeader
|
||||
from py3devil1tex import TEXturePack, TEXtureBatchDescriptor, TEXtureBatch
|
||||
from py3devil1geo import GEOHeader, MEShHeader, MEsh
|
||||
|
||||
@ -68,9 +68,9 @@ if __name__ == "__main__":
|
||||
def mainx():
|
||||
with open("pl01.pld", "rb") as f:
|
||||
data = f.read()
|
||||
pld = PLDHeader(data)
|
||||
pld = PldHeader(data)
|
||||
pld.show()
|
||||
pld2 = PLDHeader()
|
||||
pld2 = PldHeader()
|
||||
pld2.show()
|
||||
|
||||
with open("pl01.pld_1.txp", "rb") as f:
|
||||
|
@ -6,7 +6,7 @@ from .__init__ import libc
|
||||
# Basic Struct
|
||||
#--------------------------------------+
|
||||
|
||||
class PldHeader(ctypes.Structure):
|
||||
class _PldHeader_(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("numOffset", ctypes.c_int),
|
||||
@ -17,14 +17,14 @@ class Devil1PLD_FN(ctypes.Structure):
|
||||
_fields_ = [
|
||||
("getheader" , ctypes.CFUNCTYPE(
|
||||
ctypes.c_bool,
|
||||
ctypes.POINTER(PldHeader),
|
||||
ctypes.POINTER(_PldHeader_),
|
||||
ctypes.c_char_p)),
|
||||
("sizeofsector", ctypes.CFUNCTYPE(
|
||||
ctypes.c_int,
|
||||
ctypes.POINTER(PldHeader),
|
||||
ctypes.POINTER(_PldHeader_),
|
||||
ctypes.c_int)),
|
||||
("printheader" , ctypes.CFUNCTYPE(None,
|
||||
ctypes.POINTER(PldHeader)))
|
||||
ctypes.POINTER(_PldHeader_)))
|
||||
]
|
||||
|
||||
devil1pld = Devil1PLD_FN.in_dll(libc, "DEVIL1PLD")
|
||||
@ -34,10 +34,10 @@ del libc
|
||||
# Pythonic Object
|
||||
#--------------------------------------+
|
||||
|
||||
class PLDHeader:
|
||||
class PldHeader:
|
||||
def __init__(self, filedata = None):
|
||||
# Store C Struct in order to call C functions
|
||||
self.cstruct = PldHeader()
|
||||
self.cstruct = _PldHeader_()
|
||||
if filedata:
|
||||
devil1pld.getheader(ctypes.byref(self.cstruct), filedata)
|
||||
self.eof = len(filedata)
|
||||
|
Loading…
Reference in New Issue
Block a user