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

Function mapareacheck

source/src/world.cpp:1027–1054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025COMMANDF(mapmrproper, "", () { mapmrproper(true); });
1026
1027void mapareacheck(char *what) // "vdelta" | "steepest" | "total" | "pprest" | "pp"(default)
1028{
1029 mapareastats_s ms;
1030 mapdim_s md;
1031 stopwatch ti;
1032 ti.start();
1033 servsqr *sw = createservworld(world, cubicsize);
1034 calcmapdims(md, sw, ssize);
1035 calcmapareastats(ms, sw, ssize, md);
1036 delete[] sw;
1037 vector<char> res;
1038 if(!strcasecmp(what, "vdelta"))
1039 {
1040 loopi(MAS_VDELTA_TABSIZE) cvecprintf(res, "%d ", ms.vdd[i]);
1041 }
1042 else if(!strcasecmp(what, "steepest")) cvecprintf(res, "%d.5 %d.5 %d ", ms.steepest % ssize, ms.steepest / ssize, world[ms.steepest % cubicsize].floor);
1043 else if(!strcasecmp(what, "total")) cvecprintf(res, "%d ", ms.total);
1044 else if(!strcasecmp(what, "pprest")) cvecprintf(res, "%d ", ms.rest);
1045 else // default
1046 {
1047 loopi(MAS_GRID2)
1048 {
1049 int x = ms.ppp[i] % ssize, y = ms.ppp[i] / ssize, z = OUTBORD(x, y) ? 0 : S(x, y)->floor;
1050 cvecprintf(res, "%d %d %d %d %d %.5g\n", x, y, z, ms.ppa[i], ms.ppv[i], ms.ppa[i] ? float(ms.ppv[i]) / ms.ppa[i] : 0.0f);
1051 }
1052 }
1053 resultcharvector(res, -1);
1054}
1055
1056COMMAND(mapareacheck, "s");
1057

Callers

nothing calls this directly

Calls 7

createservworldFunction · 0.85
calcmapdimsFunction · 0.85
calcmapareastatsFunction · 0.85
cvecprintfFunction · 0.85
resultcharvectorFunction · 0.85
loopiFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected