From 972ce010ac65e3f703650cb1fa083caaf017cb98 Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 19 Sep 2024 20:56:08 +0200 Subject: [PATCH] feat: simplified Internal_OnShaderLoaded --- src/core/render.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/render.c b/src/core/render.c index 9f3d9b6..a74a6e5 100644 --- a/src/core/render.c +++ b/src/core/render.c @@ -63,14 +63,12 @@ void RenderNextFrame() { void Internal_OnShaderLoaded(ShaderResource resource) { list_add(&g_shaders, &resource); - int light_direction_loc = GetShaderLocation(*resource.resource, "lightDirection"); - int ambient_level_loc = GetShaderLocation(*resource.resource, "ambientLight"); - Vector3 lightdir = MATRIX_FORWARD(g_light_direction); - Vector4 ambient_color = {0.07, 0.08, 0.12, 1.0}; + int const light_direction_loc = GetShaderLocation(*resource.resource, "lightDirection"); + int const ambient_level_loc = GetShaderLocation(*resource.resource, "ambientLight"); if(light_direction_loc != -1) SetShaderValue(*resource.resource, light_direction_loc, &MATRIX_FORWARD(g_light_direction), SHADER_UNIFORM_VEC3); if(ambient_level_loc != -1) - SetShaderValue(*resource.resource, ambient_level_loc, &ambient_color, SHADER_UNIFORM_VEC4); + SetShaderValue(*resource.resource, ambient_level_loc, &(Vector4){0.07, 0.08, 0.12, 1.0}, SHADER_UNIFORM_VEC4); } void Internal_OnShaderUnloaded(ShaderResource resource) {