MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / serialize

Method serialize

deps/physx/physx/samples/samplelargeworld/ChunkLoader.cpp:696–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694}
695
696void BackgroundLoader::serialize(PxCollection* collection, ChunkID id)
697{
698 const char* theBinPath = getPathname( id );
699 SampleFramework::File* fp = NULL;
700 PxToolkit::fopen_s(&fp, theBinPath, "rb");
701 if( fp )
702 {
703 fclose(fp);
704 return;
705 }
706
707 PxCollection* theExtRef = PxCreateCollection();
708 theExtRef->add(mMaterial, MATERIAL_ID);
709 PxDefaultMemoryOutputStream memBuf;
710
711 PxSerialization::complete(*collection, *mSr, theExtRef);
712 bool bRet = PxSerialization::serializeCollectionToBinary(memBuf, *collection, *mSr, theExtRef, true );
713 PX_ASSERT(bRet);
714 PX_UNUSED(bRet);
715
716 PxDefaultFileOutputStream s( getPathname( id ) );
717
718 Ps::Time localTimer;
719 localTimer.getElapsedSeconds();
720 s.write( memBuf.getData(), memBuf.getSize());
721 mDiskIOTimeCounter += localTimer.getElapsedSeconds();
722
723 theExtRef->release();
724}
725
726//PhysX support buffer inserting actor, so no care about whether physic is simulating here
727void BackgroundLoader::addReadyChunkToScene(ChunkID id)

Callers

nothing calls this directly

Calls 9

PxCreateCollectionFunction · 0.85
PX_UNUSEDFunction · 0.85
fopen_sFunction · 0.50
addMethod · 0.45
getElapsedSecondsMethod · 0.45
writeMethod · 0.45
getDataMethod · 0.45
getSizeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected