From 89dcb96de9fababc535649c1c19a298e16ef2fa1 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 18 Jan 2021 11:16:04 -0800 Subject: [PATCH 1/2] gl: fix disembodied player model found in #141 Regression introduced in #262 by the glow port, correct the raw size to account for the matrix. See https://github.com/iceiix/stevenarella/issues/141#issuecomment-762417970 --- src/gl/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/mod.rs b/src/gl/mod.rs index 05bac147..97b8edc6 100644 --- a/src/gl/mod.rs +++ b/src/gl/mod.rs @@ -624,7 +624,7 @@ impl Uniform { #[allow(clippy::missing_safety_doc)] pub unsafe fn set_float_multi_raw(&self, data: *const f32, len: usize) { - glow_context().uniform_4_f32_slice(Some(&self.0), std::slice::from_raw_parts(data, len)); + glow_context().uniform_4_f32_slice(Some(&self.0), std::slice::from_raw_parts(data, len * 4 * 4)); } pub fn set_matrix4(&self, m: &::cgmath::Matrix4) { From 2b90340324a25b60bdb86cdea3f3321614565464 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 18 Jan 2021 11:47:53 -0800 Subject: [PATCH 2/2] Fix clippy::ptr_arg --- src/gl/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/mod.rs b/src/gl/mod.rs index 1d222738..af5da08f 100644 --- a/src/gl/mod.rs +++ b/src/gl/mod.rs @@ -588,7 +588,7 @@ impl Uniform { } } - pub fn set_float_multi(&self, v: &Vec<[f32; 4]>) { + pub fn set_float_multi(&self, v: &[[f32; 4]]) { unsafe { glow_context().uniform_4_f32_slice( Some(&self.0),