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

Function main

Extras/Serialize/HeaderGenerator/apiGen.cpp:203–331  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

201
202///////////////////////////////////////////////////////////////////////////////
203int main(int argc, char **argv)
204{
205 using namespace bParse;
206 dump = fopen("dump.py", "w");
207
208 if (!dump) return 0;
209 fprintf(dump, "%s\n", data);
210
211#if 0
212 char* filename = "../../../../data/r2d2_multibody.bullet";
213
214 if (argc==2)
215 filename = argv[1];
216
217 bString fileStr(filename);
218 bString extension(".bullet");
219
220 int index2 = fileStr.find(extension);
221 if (index2>=0)
222 isBulletFile=true;
223
224
225 FILE* fp = fopen (filename,"rb");
226
227 if (!fp)
228 {
229 printf("error: file not found %s\n",filename);
230 exit(0);
231 }
232
233 char* memBuf = 0;
234 int len = 0;
235
236 long currentpos = ftell(fp); /* save current cursor position */
237 long newpos;
238 int bytesRead;
239
240 fseek(fp, 0, SEEK_END); /* seek to end */
241 newpos = ftell(fp); /* find position of end -- this is the length */
242 fseek(fp, currentpos, SEEK_SET); /* restore previous cursor position */
243
244 len = newpos;
245
246 memBuf = (char*)malloc(len);
247 bytesRead = fread(memBuf,len,1,fp);
248
249 bool swap = false;
250
251
252 if (isBulletFile)
253 {
254 btBulletFile f(memBuf,len);
255 swap = (f.getFlags() & FD_ENDIAN_SWAP)!=0;
256 } else
257 {
258 bBlenderFile f(memBuf,len);
259 swap = (f.getFlags() & FD_ENDIAN_SWAP)!=0;
260 }

Callers

nothing calls this directly

Calls 8

exitFunction · 0.85
writeTemplateFunction · 0.85
findMethod · 0.45
getFlagsMethod · 0.45
initMethod · 0.45
getNumStructsMethod · 0.45
getStructMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected