From 8efb76ed360796b614cec5d7eaa28b159832dbdd Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 20 Apr 2024 14:30:57 +0200 Subject: refactor(engine): make LightSource fields public --- engine/src/renderer/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'engine/src/renderer/mod.rs') diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index 3052969..afed816 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -340,16 +340,14 @@ fn apply_light( { gl_shader_program.set_uniform_vec_3fv( cstr!("light.position"), - &light_source.map_or_else(Vec3::default, |light_source| { - light_source.position().clone() - }), + &light_source.map_or_else(Vec3::default, |light_source| light_source.position), ); gl_shader_program.set_uniform_vec_3fv( cstr!("light.ambient"), &light_source .map_or(Color::WHITE_F32, |light_source| { - light_source.ambient().clone() + light_source.ambient.clone() }) .into(), ); @@ -358,7 +356,7 @@ fn apply_light( cstr!("light.diffuse"), &light_source .map_or(Color::WHITE_F32, |light_source| { - light_source.diffuse().clone() + light_source.diffuse.clone() }) .into(), ); @@ -367,7 +365,7 @@ fn apply_light( cstr!("light.specular"), &light_source .map_or(Color::WHITE_F32, |light_source| { - light_source.specular().clone() + light_source.specular.clone() }) .into(), ); -- cgit v1.2.3-18-g5258