summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorRay <[email protected]>2016-09-07 23:14:16 +0200
committerRay <[email protected]>2016-09-07 23:14:16 +0200
commit10280c4b91871065ea2fc15a3f3e939820f3e0a0 (patch)
tree9cff04510d3ce37642f124ac9d603e0eec1f638e /src/rlgl.c
parent36f20376e67c8f281467df74b82759c9a05d7018 (diff)
downloadraylib-10280c4b91871065ea2fc15a3f3e939820f3e0a0.tar.gz
raylib-10280c4b91871065ea2fc15a3f3e939820f3e0a0.zip
Some code tweaks
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index 1b3d9898..518f2a66 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -337,7 +337,7 @@ static int screenHeight; // Default framebuffer height
// Lighting data
static Light lights[MAX_LIGHTS]; // Lights pool
static int lightsCount = 0; // Enabled lights counter
-static int lightsLocs[MAX_LIGHTS][8]; // 8 possible location points per light:
+static int lightsLocs[MAX_LIGHTS][8]; // Lights location points in shader: 8 possible points per light:
// enabled, type, position, target, radius, diffuse, intensity, coneAngle
//----------------------------------------------------------------------------------
@@ -3713,7 +3713,7 @@ static void SetShaderLightsValues(Shader shader)
} break;
case LIGHT_DIRECTIONAL:
{
- Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z };
+ Vector3 direction = VectorSubtract(lights[i]->target, lights[i]->position);
VectorNormalize(&direction);
glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z);
} break;
@@ -3721,7 +3721,7 @@ static void SetShaderLightsValues(Shader shader)
{
glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z);
- Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z };
+ Vector3 direction = VectorSubtract(lights[i]->target, lights[i]->position);
VectorNormalize(&direction);
glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z);