From 74de944083d8e65a1ed93262212e8b2146092865 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 30 Nov 2000 01:22:25 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/extensions/Datagram-extensions.py | 54 ++++---- .../extensions/DatagramIterator-extensions.py | 116 +++++++++--------- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/direct/src/extensions/Datagram-extensions.py b/direct/src/extensions/Datagram-extensions.py index 76694f4376..6cabc7e84e 100644 --- a/direct/src/extensions/Datagram-extensions.py +++ b/direct/src/extensions/Datagram-extensions.py @@ -1,27 +1,27 @@ - - def putArg(self, arg, subatomicType, divisor=1): - # Import the type numbers - from DCSubatomicType import * - if subatomicType == STInt8: - self.addInt8(int(arg*divisor)) - elif subatomicType == STInt16: - self.addInt16(int(arg*divisor)) - elif subatomicType == STInt32: - self.addInt32(int(arg*divisor)) - elif subatomicType == STInt64: - self.addInt64(int(arg*divisor)) - elif subatomicType == STUint8: - self.addUint8(int(arg*divisor)) - elif subatomicType == STUint16: - self.addUint16(int(arg*divisor)) - elif subatomicType == STUint32: - self.addUint32(int(arg*divisor)) - elif subatomicType == STUint64: - self.addUint64(int(arg*divisor)) - elif subatomicType == STFloat64: - self.addFloat64(arg) - elif subatomicType == STString: - self.addString(arg) - else: - raise Exception("Error: No such type as: " + subatomicType) - return None + + def putArg(self, arg, subatomicType, divisor=1): + # Import the type numbers + from DCSubatomicType import * + if subatomicType == STInt8: + self.addInt8(int(arg*divisor)) + elif subatomicType == STInt16: + self.addInt16(int(arg*divisor)) + elif subatomicType == STInt32: + self.addInt32(int(arg*divisor)) + elif subatomicType == STInt64: + self.addInt64(int(arg*divisor)) + elif subatomicType == STUint8: + self.addUint8(int(arg*divisor)) + elif subatomicType == STUint16: + self.addUint16(int(arg*divisor)) + elif subatomicType == STUint32: + self.addUint32(int(arg*divisor)) + elif subatomicType == STUint64: + self.addUint64(int(arg*divisor)) + elif subatomicType == STFloat64: + self.addFloat64(arg) + elif subatomicType == STString: + self.addString(arg) + else: + raise Exception("Error: No such type as: " + subatomicType) + return None diff --git a/direct/src/extensions/DatagramIterator-extensions.py b/direct/src/extensions/DatagramIterator-extensions.py index ee839e7569..6d998e8ae7 100644 --- a/direct/src/extensions/DatagramIterator-extensions.py +++ b/direct/src/extensions/DatagramIterator-extensions.py @@ -1,58 +1,58 @@ - - def getArg(self, subatomicType, divisor=1): - # Import the type numbers - from DCSubatomicType import * - if divisor == 1: - # No division necessary - if subatomicType == STInt8: - retVal = self.getInt8() - elif subatomicType == STInt16: - retVal = self.getInt16() - elif subatomicType == STInt32: - retVal = self.getInt32() - elif subatomicType == STInt64: - retVal = self.getInt64() - elif subatomicType == STUint8: - retVal = self.getUint8() - elif subatomicType == STUint16: - retVal = self.getUint16() - elif subatomicType == STUint32: - retVal = self.getUint32() - elif subatomicType == STUint64: - retVal = self.getUint64() - elif subatomicType == STFloat64: - retVal = self.getFloat64() - elif subatomicType == STString: - retVal = self.getString() - else: - raise Exception("Error: No such type as: " + str(subAtomicType)) - else: - # This needs to be divided - if subatomicType == STInt8: - retVal = (self.getInt8()/float(divisor)) - elif subatomicType == STInt16: - retVal = (self.getInt16()/float(divisor)) - elif subatomicType == STInt32: - retVal = (self.getInt32()/float(divisor)) - elif subatomicType == STInt64: - retVal = (self.getInt64()/float(divisor)) - elif subatomicType == STUint8: - retVal = (self.getUint8()/float(divisor)) - elif subatomicType == STUint16: - retVal = (self.getUint16()/float(divisor)) - elif subatomicType == STUint32: - retVal = (self.getUint32()/float(divisor)) - elif subatomicType == STUint64: - retVal = (self.getUint64()/float(divisor)) - elif subatomicType == STFloat64: - retVal = self.getFloat64() - elif subatomicType == STString: - retVal = self.getString() - else: - raise Exception("Error: No such type as: " + str(subAtomicType)) - - - - return retVal - - + + def getArg(self, subatomicType, divisor=1): + # Import the type numbers + from DCSubatomicType import * + if divisor == 1: + # No division necessary + if subatomicType == STInt8: + retVal = self.getInt8() + elif subatomicType == STInt16: + retVal = self.getInt16() + elif subatomicType == STInt32: + retVal = self.getInt32() + elif subatomicType == STInt64: + retVal = self.getInt64() + elif subatomicType == STUint8: + retVal = self.getUint8() + elif subatomicType == STUint16: + retVal = self.getUint16() + elif subatomicType == STUint32: + retVal = self.getUint32() + elif subatomicType == STUint64: + retVal = self.getUint64() + elif subatomicType == STFloat64: + retVal = self.getFloat64() + elif subatomicType == STString: + retVal = self.getString() + else: + raise Exception("Error: No such type as: " + str(subAtomicType)) + else: + # This needs to be divided + if subatomicType == STInt8: + retVal = (self.getInt8()/float(divisor)) + elif subatomicType == STInt16: + retVal = (self.getInt16()/float(divisor)) + elif subatomicType == STInt32: + retVal = (self.getInt32()/float(divisor)) + elif subatomicType == STInt64: + retVal = (self.getInt64()/float(divisor)) + elif subatomicType == STUint8: + retVal = (self.getUint8()/float(divisor)) + elif subatomicType == STUint16: + retVal = (self.getUint16()/float(divisor)) + elif subatomicType == STUint32: + retVal = (self.getUint32()/float(divisor)) + elif subatomicType == STUint64: + retVal = (self.getUint64()/float(divisor)) + elif subatomicType == STFloat64: + retVal = self.getFloat64() + elif subatomicType == STString: + retVal = self.getString() + else: + raise Exception("Error: No such type as: " + str(subAtomicType)) + + + + return retVal + +