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

Function loopv

source/src/editing.cpp:326–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324 {
325 const int xo[] = { 0, 0, 1, 1, 0 }, yo[] = {0, 1, 1, 0, 0 };
326 loopv(tagclipcubes) // all non-solid & have clips
327 {
328 int x = tagclipcubes[i] & 0xFFFF, y = tagclipcubes[i] >> 16;
329 ASSERT(!OUTBORD(x, y));
330 sqr *s = S(x,y), *o[9];
331 if(s->tag & TAGCLIP) linestyle(tagcliplinewidth, 0xFF, 0xFF, 0); // yello
332 else linestyle(tagcliplinewidth, 0xFF, 0, 0xFF); // magenta
333 o[8] = SWS(s,-1,-1,sfactor);
334 o[3] = o[8] + 1; // 837
335 o[7] = o[3] + 1; // 0s2
336 o[0] = o[4] = SWS(s,-1,0,sfactor); // 516
337 o[2] = o[0] + 2;
338 o[5] = SWS(s,-1,1,sfactor);
339 o[1] = o[5] + 1;
340 o[6] = o[1] + 1;
341 bool clipped[9];
342 loopj(9) clipped[j] = !SOLID(o[j]) && (o[j]->tag & TAGANYCLIP) > 0;
343 int h = s->floor - (s->type == FHF ? (s->vdelta + 3) / 4 : 0), c = s->ceil + (s->type == CHF ? (s->vdelta + 3) / 4 : 0);
344 loopk(4) if((clipped[k] == clipped[k+1]) && !(clipped[k] && clipped[k + 5])) line(x + xo[k+1], y + yo[k+1], h, x + xo[k+1], y + yo[k+1], c);
345 for( ; h < c; h++)
346 {
347 int k = (h + x + y) & 3;
348 if(k < 2 && !clipped[k]) line(x + xo[k], y + yo[k], h + 1, x + xo[k+1], y + yo[k+1], h);
349 k = (h - x - y) & 3;
350 if(k > 1 && !clipped[k]) line(x + xo[k], y + yo[k], h + 1, x + xo[k+1], y + yo[k+1], h);
351 }
352 if(sparkletime && tagnumfull) particle_cube(s->tag & TAGCLIP ? PART_EPICKUP : PART_EMODEL, tagnumfull, 30, x, y);
353 }
354 }
355
356 glLineWidth(1);

Callers 5

checkselectionsFunction · 0.70
cursorupdateFunction · 0.70
resetcopybuffersFunction · 0.70
pasteFunction · 0.70
newentFunction · 0.70

Calls 15

linestyleFunction · 0.85
lineFunction · 0.85
particle_cubeFunction · 0.85
blockcopyFunction · 0.85
editheightxyFunction · 0.85
addmsgFunction · 0.85
edittexxyFunction · 0.85
edittypexyFunction · 0.85
editequalisexyFunction · 0.85
setvdeltaxyFunction · 0.85
archxyFunction · 0.85
slopexyFunction · 0.85

Tested by

no test coverage detected