summaryrefslogtreecommitdiff
path: root/engine/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/renderer')
-rw-r--r--engine/src/renderer/mod.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs
index e32f308..2035a3c 100644
--- a/engine/src/renderer/mod.rs
+++ b/engine/src/renderer/mod.rs
@@ -149,7 +149,7 @@ fn render(
&camera,
);
- for texture in material.textures() {
+ for texture in &material.textures {
let gl_texture = gl_textures
.entry(texture.id())
.or_insert_with(|| create_gl_texture(texture));
@@ -388,39 +388,37 @@ fn apply_light(
gl_shader_program.set_uniform_vec_3fv(
cstr!("material.ambient"),
- &(material.ambient().clone() + global_light.ambient_offset.clone()).into(),
+ &(material.ambient.clone() + global_light.ambient_offset.clone()).into(),
);
- gl_shader_program.set_uniform_vec_3fv(
- cstr!("material.diffuse"),
- &material.diffuse().clone().into(),
- );
+ gl_shader_program
+ .set_uniform_vec_3fv(cstr!("material.diffuse"), &material.diffuse.clone().into());
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_vec_3fv(
cstr!("material.specular"),
- &material.specular().clone().into(),
+ &material.specular.clone().into(),
);
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_1i(
cstr!("material.ambient_map"),
- material.ambient_map().into_inner() as i32,
+ material.ambient_map.into_inner() as i32,
);
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_1i(
cstr!("material.diffuse_map"),
- material.diffuse_map().into_inner() as i32,
+ material.diffuse_map.into_inner() as i32,
);
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_1i(
cstr!("material.specular_map"),
- material.specular_map().into_inner() as i32,
+ material.specular_map.into_inner() as i32,
);
- gl_shader_program.set_uniform_1fv(cstr!("material.shininess"), material.shininess());
+ gl_shader_program.set_uniform_1fv(cstr!("material.shininess"), material.shininess);
gl_shader_program.set_uniform_vec_3fv(cstr!("view_pos"), &camera.position);
}