+ i = 0;
+ for (y = 0; y < PARTICLE_LIGHT_HEIGHT; y++)
+ {
+ int yc = y - (PARTICLE_LIGHT_HEIGHT / 2);
+ for (x = 0; x < PARTICLE_LIGHT_WIDTH; x++)
+ {
+ int xc = x - (PARTICLE_LIGHT_WIDTH / 2);
+
+ float invDist = ((float)particleRadius - (float)sqrt(xc * xc + yc * yc)) / (float)particleRadius;
+ if (invDist < 0.0f) invDist = 0.0f;
+
+ c = (int)(pow(invDist, 0.75f) * 63);
+ particleLight[i++] = ((c >> 1) << 11) | (c << 5) | (c >> 1);
+ }
+ }
+