Remove trailing spaces

This commit is contained in:
raysan5
2021-10-19 14:57:12 +02:00
parent 719c1551cc
commit fec0ce34c5
80 changed files with 309 additions and 310 deletions

View File

@ -16,10 +16,10 @@ uniform float screenWidth; // Width of the screen
void main()
{
float alpha = 1.0;
// Get the position of the current fragment (screen coordinates!)
vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y);
// Find out which spotlight is nearest
float d = 65000.0; // some high value
int fi = -1; // found index
@ -29,18 +29,18 @@ void main()
for (int j = 0; j < MAX_SPOTS; j++)
{
float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius;
if (d > dj)
if (d > dj)
{
d = dj;
fi = i;
}
}
}
// d now equals distance to nearest spot...
// allowing for the different radii of all spotlights
if (fi == 0)
if (fi == 0)
{
if (d > spots[0].radius) alpha = 1.0;
else
@ -49,7 +49,7 @@ void main()
else alpha = (d - spots[0].inner)/(spots[0].radius - spots[0].inner);
}
}
else if (fi == 1)
else if (fi == 1)
{
if (d > spots[1].radius) alpha = 1.0;
else
@ -58,7 +58,7 @@ void main()
else alpha = (d - spots[1].inner)/(spots[1].radius - spots[1].inner);
}
}
else if (fi == 2)
else if (fi == 2)
{
if (d > spots[2].radius) alpha = 1.0;
else
@ -67,8 +67,8 @@ void main()
else alpha = (d - spots[2].inner)/(spots[2].radius - spots[2].inner);
}
}
// Right hand side of screen is dimly lit,
// Right hand side of screen is dimly lit,
// could make the threshold value user definable
if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9;