mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 05:42:59 +05:30
Added pack to packed structs
This commit is contained in:
parent
8585702471
commit
790afd9960
@ -31,6 +31,7 @@ class Devil1PLD_FN(ctypes.Structure):
|
||||
#--------------------------------------+
|
||||
|
||||
class TexturePack(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("id", ctypes.c_char * 4), # fixed length 4, reverse order
|
||||
("batchNumber", ctypes.c_int),
|
||||
@ -39,6 +40,7 @@ class TexturePack(ctypes.Structure):
|
||||
]
|
||||
|
||||
class TextureBatchDescriptor(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("batchIdx", ctypes.c_int),
|
||||
("hash", ctypes.c_int),
|
||||
@ -49,11 +51,13 @@ class TextureBatchDescriptor(ctypes.Structure):
|
||||
]
|
||||
|
||||
class Texture(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("data", ctypes.c_ubyte)
|
||||
]
|
||||
|
||||
class TextureBatch(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("batch", ctypes.POINTER(Texture))
|
||||
]
|
||||
@ -98,6 +102,7 @@ class Devil1TEX_FN(ctypes.Structure):
|
||||
#--------------------------------------+
|
||||
|
||||
class Header(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("numMesh", ctypes.c_ubyte),
|
||||
("unknownNumberB", ctypes.c_ubyte),
|
||||
@ -108,6 +113,7 @@ class Header(ctypes.Structure):
|
||||
]
|
||||
|
||||
class MeshHeader(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("numBatch", ctypes.c_short),
|
||||
("numVertex", ctypes.c_short),
|
||||
@ -117,6 +123,7 @@ class MeshHeader(ctypes.Structure):
|
||||
]
|
||||
|
||||
class Coordinate(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("x", ctypes.c_float),
|
||||
("y", ctypes.c_float),
|
||||
@ -124,23 +131,27 @@ class Coordinate(ctypes.Structure):
|
||||
]
|
||||
|
||||
class UVs(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("u", ctypes.c_short),
|
||||
("v", ctypes.c_short)
|
||||
]
|
||||
|
||||
class BoneIndexes(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("indexes", ctypes.c_ubyte * 4),
|
||||
]
|
||||
|
||||
class BoneWeights(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("weights", ctypes.c_short)
|
||||
]
|
||||
|
||||
|
||||
class BatchData(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("numVertex", ctypes.c_short),
|
||||
("uB", ctypes.c_short),
|
||||
@ -154,6 +165,7 @@ class BatchData(ctypes.Structure):
|
||||
]
|
||||
|
||||
class VertexData(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("positions", ctypes.POINTER(Coordinate)),
|
||||
("normals", ctypes.POINTER(Coordinate)),
|
||||
@ -163,12 +175,14 @@ class VertexData(ctypes.Structure):
|
||||
]
|
||||
|
||||
class Batch(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("bd", ctypes.POINTER(BatchData)),
|
||||
("vd", VertexData)
|
||||
]
|
||||
|
||||
class Mesh(ctypes.Structure):
|
||||
_pack_ = 1
|
||||
_fields_ = [
|
||||
("b", ctypes.POINTER(Batch))
|
||||
]
|
||||
@ -220,6 +234,7 @@ if __name__ == "__main__":
|
||||
devil1pld.printheader(ctypes.byref(pldheader))
|
||||
print(pldheader)
|
||||
print(pldheader.numOffset)
|
||||
print(pldheader.offsets)
|
||||
for i in range(0, pldheader.numOffset):
|
||||
print(hex(pldheader.offsets[i]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user