mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
add uint32uint8array
This commit is contained in:
parent
ecc2c11600
commit
e3a9436f07
@ -48,6 +48,11 @@
|
||||
self.addUint16(len(arg) << 2)
|
||||
for i in arg:
|
||||
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:
|
||||
raise Exception("Error: No such type as: " + subatomicType)
|
||||
return None
|
||||
|
@ -56,6 +56,13 @@
|
||||
retVal = []
|
||||
for i in range(len):
|
||||
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:
|
||||
raise Exception("Error: No such type as: " + str(subAtomicType))
|
||||
else:
|
||||
@ -112,6 +119,13 @@
|
||||
retVal = []
|
||||
for i in range(len):
|
||||
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:
|
||||
raise Exception("Error: No such type as: " + str(subAtomicType))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user