MCPcopy Index your code
hub / github.com/assaultcube/AC / writemapmodelattributes

Function writemapmodelattributes

source/src/rendermodel.cpp:494–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void writemapmodelattributes()
495{
496 stream *f = openfile("config" PATHDIVS "mapmodelattributes.cfg", "w");
497 if(f)
498 {
499 vector<mapmodelattributes *> mmas;
500 enumerate(mdlregistry, mapmodelattributes *, m, mmas.add(m));
501 mmas.sort(mmasort);
502 f->printf("// automatically written on exit. this is cached information extracted from model configs. no point in editing it.\n// [path %s]\n", conc(mdlattrnames, MMA_NUM, true)); // memory leak, but w/e
503 loopv(mmas)
504 {
505 f->printf("\nmapmodelregister %s", mmas[i]->name);
506 loopj(MMA_NUM) f->printf(" %s", escapestring(mmas[i]->n[j])); // escapestring can handle NULL
507 }
508 f->printf("\n\n");
509 delete f;
510 }
511}
512
513void listallmapmodelattributes(char **args, int numargs) // create a list of mapmodel paths and selected attributes
514{

Callers 1

quitFunction · 0.85

Calls 4

openfileFunction · 0.85
concFunction · 0.85
sortMethod · 0.80
printfMethod · 0.45

Tested by

no test coverage detected