--- a/rust/hwphysics/src/common.rs Sat Aug 03 02:14:07 2019 +0300
+++ b/rust/hwphysics/src/common.rs Sat Aug 03 02:51:19 2019 +0300
@@ -114,7 +114,7 @@
impl<T: Default + Copy> GearDataLookup<T> {
pub fn new() -> Self {
Self {
- lookup: Vec::with_capacity(u16::max_value() as usize).into_boxed_slice()
+ lookup: vec![LookupEntry::default(); u16::max_value() as usize].into_boxed_slice(),
}
}
}
--- a/rust/lib-hedgewars-engine/src/render/gear.rs Sat Aug 03 02:14:07 2019 +0300
+++ b/rust/lib-hedgewars-engine/src/render/gear.rs Sat Aug 03 02:51:19 2019 +0300
@@ -48,7 +48,7 @@
let texture = Texture2D::new(max_size, gl::RGBA8, gl::LINEAR);
- let mut pixels = Vec::with_capacity(max_size.area()).into_boxed_slice();
+ let mut pixels = vec![0; max_size.area() * 4].into_boxed_slice();
for (path, sprite_index) in lookup.drain(..) {
if let Some((atlas_index, rect)) = atlas.get_rect(sprite_index) {
load_sprite_pixels(&path, &mut pixels[..]).expect("Unable to load Graphics");