mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
add uint32uint8array
This commit is contained in:
parent
ecc2c11600
commit
e3a9436f07
@ -48,6 +48,11 @@
|
|||||||
self.addUint16(len(arg) << 2)
|
self.addUint16(len(arg) << 2)
|
||||||
for i in arg:
|
for i in arg:
|
||||||
self.addUint32(int(i*divisor))
|
self.addUint32(int(i*divisor))
|
||||||
|
elif subatomicType == STUint32uint8array:
|
||||||
|
self.addUint16(len(arg) * 5)
|
||||||
|
for i in arg:
|
||||||
|
self.addUint32(int(i[0]*divisor))
|
||||||
|
self.addUint8(int(i[1]*divisor))
|
||||||
else:
|
else:
|
||||||
raise Exception("Error: No such type as: " + subatomicType)
|
raise Exception("Error: No such type as: " + subatomicType)
|
||||||
return None
|
return None
|
||||||
|
@ -56,6 +56,13 @@
|
|||||||
retVal = []
|
retVal = []
|
||||||
for i in range(len):
|
for i in range(len):
|
||||||
retVal.append(self.getUint32())
|
retVal.append(self.getUint32())
|
||||||
|
elif subatomicType == STUint32uint8array:
|
||||||
|
len = self.getUint16() / 5
|
||||||
|
retVal = []
|
||||||
|
for i in range(len):
|
||||||
|
a = self.getUint32()
|
||||||
|
b = self.getUint8()
|
||||||
|
retVal.append((a, b))
|
||||||
else:
|
else:
|
||||||
raise Exception("Error: No such type as: " + str(subAtomicType))
|
raise Exception("Error: No such type as: " + str(subAtomicType))
|
||||||
else:
|
else:
|
||||||
@ -112,6 +119,13 @@
|
|||||||
retVal = []
|
retVal = []
|
||||||
for i in range(len):
|
for i in range(len):
|
||||||
retVal.append(self.getUint32()/float(divisor))
|
retVal.append(self.getUint32()/float(divisor))
|
||||||
|
elif subatomicType == STUint32uint8array:
|
||||||
|
len = self.getUint16() / 5
|
||||||
|
retVal = []
|
||||||
|
for i in range(len):
|
||||||
|
a = self.getUint32()
|
||||||
|
b = self.getUint8()
|
||||||
|
retVal.append((a / float(divisor), b / float(divisor)))
|
||||||
else:
|
else:
|
||||||
raise Exception("Error: No such type as: " + str(subAtomicType))
|
raise Exception("Error: No such type as: " + str(subAtomicType))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user