From: Dave B. <dbr...@us...> - 2002-01-25 07:56:01
|
Update of /cvsroot/bzflag/bzflag/src/common In directory usw-pr-cvs1:/tmp/cvs-serv16416/bzflag/src/common Modified Files: Flag.cxx Log Message: Better pack/unpack code for vectors Index: Flag.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/common/Flag.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Flag.cxx 2001/02/02 09:14:09 1.3 +++ Flag.cxx 2002/01/25 07:55:57 1.4 @@ -94,15 +94,9 @@ buf = nboPackUShort(buf, uint16_t(status)); buf = nboPackUShort(buf, uint16_t(type)); buf = owner.pack(buf); - buf = nboPackFloat(buf, position[0]); - buf = nboPackFloat(buf, position[1]); - buf = nboPackFloat(buf, position[2]); - buf = nboPackFloat(buf, launchPosition[0]); - buf = nboPackFloat(buf, launchPosition[1]); - buf = nboPackFloat(buf, launchPosition[2]); - buf = nboPackFloat(buf, landingPosition[0]); - buf = nboPackFloat(buf, landingPosition[1]); - buf = nboPackFloat(buf, landingPosition[2]); + buf = nboPackVector(buf, position); + buf = nboPackVector(buf, launchPosition); + buf = nboPackVector(buf, landingPosition); buf = nboPackFloat(buf, flightTime); buf = nboPackFloat(buf, flightEnd); buf = nboPackFloat(buf, initialVelocity); @@ -116,15 +110,9 @@ buf = nboUnpackUShort(buf, data); status = FlagStatus(data); buf = nboUnpackUShort(buf, data); type = FlagType(data); buf = owner.unpack(buf); - buf = nboUnpackFloat(buf, position[0]); - buf = nboUnpackFloat(buf, position[1]); - buf = nboUnpackFloat(buf, position[2]); - buf = nboUnpackFloat(buf, launchPosition[0]); - buf = nboUnpackFloat(buf, launchPosition[1]); - buf = nboUnpackFloat(buf, launchPosition[2]); - buf = nboUnpackFloat(buf, landingPosition[0]); - buf = nboUnpackFloat(buf, landingPosition[1]); - buf = nboUnpackFloat(buf, landingPosition[2]); + buf = nboUnpackVector(buf, position); + buf = nboUnpackVector(buf, launchPosition); + buf = nboUnpackVector(buf, landingPosition); buf = nboUnpackFloat(buf, flightTime); buf = nboUnpackFloat(buf, flightEnd); buf = nboUnpackFloat(buf, initialVelocity); |