MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / resolvePointers

Method resolvePointers

src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:1358–1404  ·  view source on GitHub ↗

Resolve pointers replaces the original pointers in structures, and linked lists by the new in-memory structures

Source from the content-addressed store, hash-verified

1356
1357///Resolve pointers replaces the original pointers in structures, and linked lists by the new in-memory structures
1358void bFile::resolvePointers(int verboseMode)
1359{
1360 bParse::bDNA *fileDna = mFileDNA ? mFileDNA : mMemoryDNA;
1361
1362 //char *dataPtr = mFileBuffer+mDataStart;
1363
1364 if (1) //mFlags & (FD_BITS_VARIES | FD_VERSION_VARIES))
1365 {
1366 resolvePointersMismatch();
1367 }
1368
1369 {
1370 if (verboseMode & FD_VERBOSE_EXPORT_XML)
1371 {
1372 printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1373 int numitems = m_chunks.size();
1374 printf("<bullet_physics version=%d itemcount = %d>\n", b3GetVersion(), numitems);
1375 }
1376 for (int i = 0; i < m_chunks.size(); i++)
1377 {
1378 const bChunkInd &dataChunk = m_chunks.at(i);
1379
1380 if (!mFileDNA || fileDna->flagEqual(dataChunk.dna_nr))
1381 {
1382 //dataChunk.len
1383 short int *oldStruct = fileDna->getStruct(dataChunk.dna_nr);
1384 char *oldType = fileDna->getType(oldStruct[0]);
1385
1386 if (verboseMode & FD_VERBOSE_EXPORT_XML)
1387 printf(" <%s pointer=%p>\n", oldType, dataChunk.oldPtr);
1388
1389 resolvePointersChunk(dataChunk, verboseMode);
1390
1391 if (verboseMode & FD_VERBOSE_EXPORT_XML)
1392 printf(" </%s>\n", oldType);
1393 }
1394 else
1395 {
1396 //printf("skipping mStruct\n");
1397 }
1398 }
1399 if (verboseMode & FD_VERBOSE_EXPORT_XML)
1400 {
1401 printf("</bullet_physics>\n");
1402 }
1403 }
1404}
1405
1406// ----------------------------------------------------- //
1407void *bFile::findLibPointer(void *ptr)

Callers

nothing calls this directly

Calls 6

b3GetVersionFunction · 0.85
sizeMethod · 0.45
atMethod · 0.45
flagEqualMethod · 0.45
getStructMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected