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

Function loopi

source/src/worldlight.cpp:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 b /= lightscale;
50 stepb /= lightscale;
51 loopi(steps)
52 {
53 sqr *s = S(x>>PRECBITS, y>>PRECBITS);
54 s->r = min((l>>PRECBITS)+s->r, 255);
55 s->g = min((g>>PRECBITS)+s->g, 255);
56 s->b = min((b>>PRECBITS)+s->b, 255);
57 if(SOLID(s)) return;
58 x += stepx;
59 y += stepy;
60 l -= stepl;
61 g -= stepg;
62 b -= stepb;
63 stepl -= 25;
64 stepg -= 25;
65 stepb -= 25;
66 }
67 }
68 else // white light, special optimized version
69 {

Callers 2

lightrayFunction · 0.70
fullbrightlightFunction · 0.70

Calls 1

minFunction · 0.85

Tested by

no test coverage detected