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

Method getFileElement

src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:991–1016  ·  view source on GitHub ↗

----------------------------------------------------- //

Source from the content-addressed store, hash-verified

989
990// ----------------------------------------------------- //
991char *bFile::getFileElement(short *firstStruct, char *lookupName, char *lookupType, char *data, short **foundPos)
992{
993 short *old = firstStruct; //mFileDNA->getStruct(old_nr);
994 int elementLength = old[1];
995 old += 2;
996
997 for (int i = 0; i < elementLength; i++, old += 2)
998 {
999 char *type = mFileDNA->getType(old[0]);
1000 char *name = mFileDNA->getName(old[1]);
1001 int len = mFileDNA->getElementSize(old[0], old[1]);
1002
1003 if (strcmp(lookupName, name) == 0)
1004 {
1005 if (strcmp(type, lookupType) == 0)
1006 {
1007 if (foundPos)
1008 *foundPos = old;
1009 return data;
1010 }
1011 return 0;
1012 }
1013 data += len;
1014 }
1015 return 0;
1016}
1017
1018// ----------------------------------------------------- //
1019void bFile::swapStruct(int dna_nr, char *data, bool ignoreEndianFlag)

Callers

nothing calls this directly

Calls 3

getTypeMethod · 0.45
getNameMethod · 0.45
getElementSizeMethod · 0.45

Tested by

no test coverage detected