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

Function calclightsource

source/src/worldlight.cpp:118–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void calclightsource(const persistent_entity &l, float fade = 1, bool flicker = true)
119{
120 int reach = l.attr1;
121 int sx = l.x-reach;
122 int ex = l.x+reach;
123 int sy = l.y-reach;
124 int ey = l.y+reach;
125
126 const float s = 0.8f;
127
128 for(float sx2 = (float)sx; sx2<=ex; sx2+=s*2) { lightray(sx2, (float)sy, l, fade, flicker); lightray(sx2, (float)ey, l, fade, flicker); }
129 for(float sy2 = sy+s; sy2<=ey-s; sy2+=s*2) { lightray((float)sx, sy2, l, fade, flicker); lightray((float)ex, sy2, l, fade, flicker); }
130}
131
132void postlightarealine(sqr *s, int len)
133{

Callers 1

loopvFunction · 0.85

Calls 1

lightrayFunction · 0.85

Tested by

no test coverage detected