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

Method getFileElement

Extras/Serialize/BulletFileLoader/bFile.cpp:1024–1049  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1022
1023// ----------------------------------------------------- //
1024char *bFile::getFileElement(short *firstStruct, char *lookupName, char *lookupType, char *data, short **foundPos)
1025{
1026 short *old = firstStruct; //mFileDNA->getStruct(old_nr);
1027 int elementLength = old[1];
1028 old += 2;
1029
1030 for (int i = 0; i < elementLength; i++, old += 2)
1031 {
1032 char *type = mFileDNA->getType(old[0]);
1033 char *name = mFileDNA->getName(old[1]);
1034 int len = mFileDNA->getElementSize(old[0], old[1]);
1035
1036 if (strcmp(lookupName, name) == 0)
1037 {
1038 if (strcmp(type, lookupType) == 0)
1039 {
1040 if (foundPos)
1041 *foundPos = old;
1042 return data;
1043 }
1044 return 0;
1045 }
1046 data += len;
1047 }
1048 return 0;
1049}
1050
1051// ----------------------------------------------------- //
1052void 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