From 78cab22a61786a23f2ee1ad7c5dcbec0024befca Mon Sep 17 00:00:00 2001 From: Sheikh Dawood Abdul Ajees Date: Tue, 27 Nov 2018 13:02:50 -0600 Subject: PhysX 3.4, APEX 1.4 patch release @25256367 --- PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp') diff --git a/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp b/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp index 3cc55dae..c29c04a4 100644 --- a/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp +++ b/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp @@ -120,24 +120,32 @@ bool physx::readFloatBuffer(PxF32* dest, PxU32 nbFloats, bool mismatch, PxInputS void physx::writeFloatBuffer(const PxF32* src, PxU32 nb, bool mismatch, PxOutputStream& stream) { - while(nb--) + if(mismatch) { - PxF32 f = *src++; - if(mismatch) + while(nb--) + { + PxF32 f = *src++; flip(f); - stream.write(&f, sizeof(PxF32)); + stream.write(&f, sizeof(PxF32)); + } } + else + stream.write(src, sizeof(PxF32) * nb); } void physx::writeWordBuffer(const PxU16* src, PxU32 nb, bool mismatch, PxOutputStream& stream) { - while(nb--) + if(mismatch) { - PxU16 w = *src++; - if(mismatch) + while(nb--) + { + PxU16 w = *src++; flip(w); - stream.write(&w, sizeof(PxU16)); + stream.write(&w, sizeof(PxU16)); + } } + else + stream.write(src, sizeof(PxU16) * nb); } void physx::readWordBuffer(PxU16* dest, PxU32 nb, bool mismatch, PxInputStream& stream) -- cgit v1.2.3