MCPcopy Create free account
hub / github.com/assaultcube/AC / getcurrentmapconfig

Function getcurrentmapconfig

source/src/worldio.cpp:427–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void getcurrentmapconfig(vector<char> &f, bool onlysounds)
428{
429 if(!onlysounds)
430 {
431 extern int fogcolour, shadowyaw;
432 extern char *loadsky;
433 if(fog != DEFAULT_FOG) cvecprintf(f, "fog %d\n", fog);
434 if(fogcolour != DEFAULT_FOGCOLOUR) cvecprintf(f, "fogcolour 0x%06x\n", fogcolour);
435 if(shadowyaw != DEFAULT_SHADOWYAW) cvecprintf(f, "shadowyaw %d\n", shadowyaw);
436 if(*mapconfigdata.notexturename) cvecprintf(f, "loadnotexture \"%s\"\n", mapconfigdata.notexturename);
437 if(*loadsky) cvecprintf(f, "loadsky \"%s\"\n", loadsky);
438 cvecprintf(f, "%smapmodelreset\n", f.length() ? "\n" : "");
439 loopi(256)
440 {
441 mapmodelinfo *mmi = getmminfo(i);
442 if(!mmi) break;
443 cvecprintf(f, "mapmodel %d %d %d %s \"%s\"", mmi->rad, mmi->h, mmi->zoff, mmi->scale == 1.0f ? "0" : floatstr(mmi->scale, true), mmshortname(mmi->name));
444 if(mmi->flags & MMF_CONFIGMASK) cvecprintf(f, " %d", mmi->flags & MMF_CONFIGMASK);
445 f.add('\n');
446 }
447 cvecprintf(f, "\ntexturereset\n");
448 loopi(256)
449 {
450 const char *t = gettextureslot(i);
451 if(!t) break;
452 cvecprintf(f, "%s\n", t);
453 }
454 cvecprintf(f, "\n");
455 }
456 cvecprintf(f, "mapsoundreset\n");
457 loopv(mapconfigdata.mapsoundlines)
458 {
459 mapsoundline &s = mapconfigdata.mapsoundlines[i];
460 cvecprintf(f, "mapsound \"ambience/%s\" %d\n", s.name, s.maxuses);
461 }
462 cvecprintf(f, "\n");
463 f.add('\0');
464}
465
466#ifdef _DEBUG
467COMMANDF(dumpmapconfig, "", ()

Callers 4

worldio.cppFile · 0.85
save_worldFunction · 0.85
xmapMethod · 0.85
reloadmapsoundconfigFunction · 0.85

Calls 9

cvecprintfFunction · 0.85
getmminfoFunction · 0.85
floatstrFunction · 0.85
mmshortnameFunction · 0.85
gettextureslotFunction · 0.85
loopiFunction · 0.70
loopvFunction · 0.70
lengthMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected