diff options
| author | sschirm <[email protected]> | 2017-02-27 16:40:12 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2017-03-01 18:04:26 +0100 |
| commit | 7840347c32755e94a807f978f1cbb558717ac8cf (patch) | |
| tree | 295cd3ca93a45f8fcc43cf3cbf3887c0e0c5526b /PhysX_3.4/Source/PhysXExtensions/src/serialization | |
| parent | Pre-release comments marking end of beta. (diff) | |
| download | physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.tar.xz physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.zip | |
PhysX 3.4, APEX 1.4 final release @21757769v3.4.0-rc-2
Diffstat (limited to 'PhysX_3.4/Source/PhysXExtensions/src/serialization')
4 files changed, 35 insertions, 8 deletions
diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/File/SnFile.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/File/SnFile.h index ccb47851..09929d20 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/File/SnFile.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/File/SnFile.h @@ -57,7 +57,7 @@ PX_INLINE PxI32 fopen_s(FILE** file, const char* name, const char* mode) } // namespace sn } // namespace physx -#elif PX_UNIX_FAMILY || PX_PS4 +#elif PX_UNIX_FAMILY || PX_PS4 || PX_NX #include <stdio.h> diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/SnSerialUtils.cpp b/PhysX_3.4/Source/PhysXExtensions/src/serialization/SnSerialUtils.cpp index c958067e..e478a552 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/SnSerialUtils.cpp +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/SnSerialUtils.cpp @@ -38,7 +38,7 @@ using namespace physx; namespace { -#define SN_NUM_BINARY_PLATFORMS 11 +#define SN_NUM_BINARY_PLATFORMS 13 const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] = { PX_MAKE_FOURCC('W','_','3','2'), @@ -51,7 +51,9 @@ const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] = PX_MAKE_FOURCC('A','N','D','R'), PX_MAKE_FOURCC('A','I','O','S'), PX_MAKE_FOURCC('A','A','6','4'), - PX_MAKE_FOURCC('X','O','N','E') + PX_MAKE_FOURCC('X','O','N','E'), + PX_MAKE_FOURCC('N','X','3','2'), + PX_MAKE_FOURCC('N','X','6','4') }; const char* sBinaryPlatformNames[SN_NUM_BINARY_PLATFORMS] = @@ -66,7 +68,9 @@ const char* sBinaryPlatformNames[SN_NUM_BINARY_PLATFORMS] = "android", "ios", "ios64", - "xboxone" + "xboxone", + "nx32", + "nx64" }; #define SN_NUM_BINARY_COMPATIBLE_VERSIONS 1 @@ -107,6 +111,10 @@ PxU32 getBinaryPlatformTag() return sBinaryPlatformTags[9]; #elif PX_XBOXONE return sBinaryPlatformTags[10]; +#elif PX_NX && !PX_A64 + return sBinaryPlatformTags[11]; +#elif PX_NX && PX_A64 + return sBinaryPlatformTags[12]; #else #error Unknown binary platform #endif diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h index 19cb00e6..18e2a9e0 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h @@ -57,6 +57,17 @@ namespace physx { namespace Sn { void deallocate( PxU8* inMem ) { mAllocator->deallocate( inMem ); } }; + inline bool isEmpty(const char *s) + { + while (*s != '\0') + { + if (!isspace(*s)) + return false; + s++; + } + return true; + } + inline void strtoLong( Triangle<PxU32>& ioDatatype,const char*& ioData ) { strto( ioDatatype.mIdx0, ioData ); @@ -144,9 +155,7 @@ namespace physx { namespace Sn { ++theCount; char* theStartData = const_cast< char*>( copyStr( &tempAllocator, theSrcData ) ); const char* theData = theStartData; - PxU32 theLen = strLenght( theData ); - const char* theEndData = theData + theLen; - while( theData < theEndData ) + while( !isEmpty(theData) ) { //These buffers are whitespace delimited. TDataType theType; diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h index 040c42a9..e7286bc5 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h @@ -219,7 +219,12 @@ namespace physx { namespace Sn { , PxU32 inObjPerLine, PxStrideIterator<const TDataType>& inData, TAccessOperator inAccessOperator , PxU32 inBufSize, const char* inPropName, PxU32 /*inStride*/, TWriteOperator inOperator ) { +#if PX_NX + const auto *dat = &inData[0]; + if (inBufSize && dat != NULL) +#else if ( inBufSize && &inData[0]) +#endif { for ( PxU32 idx = 0; idx < inBufSize; ++idx ) { @@ -239,8 +244,13 @@ namespace physx { namespace Sn { inline void writeStrideFlags( XmlWriter& inWriter, MemoryBuffer& inTempBuffer , PxU32 inObjPerLine, PxStrideIterator<const TDataType>& inData, TAccessOperator /*inAccessOperator*/ , PxU32 inBufSize, const char* inPropName, const PxU32ToName* inTable) - { + { +#if PX_NX + const auto *dat = &inData[0]; + if (inBufSize && dat != NULL) +#else if ( inBufSize && &inData[0]) +#endif { for ( PxU32 idx = 0; idx < inBufSize; ++idx ) { |