aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2018-11-27 13:02:50 -0600
committerSheikh Dawood Abdul Ajees <[email protected]>2018-11-27 13:02:50 -0600
commit78cab22a61786a23f2ee1ad7c5dcbec0024befca (patch)
tree27cb86e3add785670ddfdbfc901f1654d74d1cb2 /PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp
parentPhysX 3.4, APEX 1.4 patch release @24990349 (diff)
downloadphysx-3.4-78cab22a61786a23f2ee1ad7c5dcbec0024befca.tar.xz
physx-3.4-78cab22a61786a23f2ee1ad7c5dcbec0024befca.zip
PhysX 3.4, APEX 1.4 patch release @25256367
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/GuSerialize.cpp24
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)