1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-20 11:47:46 +00:00

Add fill argument for MDL::pad_slice

This commit is contained in:
Joshua Goins 2023-11-24 08:07:10 -05:00
parent 280ba9b292
commit 18bb4ac54c

View file

@ -719,8 +719,8 @@ impl MDL {
cursor.write_le::<[f32; 4]>(vec)
}
fn pad_slice<const N: usize>(small_slice: &[f32; N]) -> [f32; 4] {
let mut bigger_slice: [f32; 4] = [0.0, 0.0, 0.0, 0.0];
fn pad_slice<const N: usize>(small_slice: &[f32; N], fill: f32) -> [f32; 4] {
let mut bigger_slice: [f32; 4] = [fill, fill, fill, fill];
bigger_slice[..N].copy_from_slice(&small_slice[..N]);
bigger_slice
}