diff options
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp')
| -rw-r--r-- | PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
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) |