Fix mapgen transitional_engine
authorunC0Rr
Wed, 01 Feb 2023 11:19:45 +0100
branchtransitional_engine
changeset 15914 c571d4b8879c
parent 15913 c5684cc62de8
child 15915 8f093b1b18bc
Fix mapgen
rust/mapgen/src/lib.rs
rust/mapgen/src/theme.rs
--- a/rust/mapgen/src/lib.rs	Wed Feb 01 10:58:45 2023 +0100
+++ b/rust/mapgen/src/lib.rs	Wed Feb 01 11:19:45 2023 +0100
@@ -126,7 +126,7 @@
     where
         LandT: Copy + Default + PartialEq,
     {
-        let mut texture = Vec2D::new(land.size().size(), 0);
+        let mut texture = Vec2D::new(&land.size().size(), 0);
 
         if let Some(land_sprite) = theme.land_texture() {
             for (row_index, (land_row, tex_row)) in land.rows().zip(texture.rows_mut()).enumerate()
--- a/rust/mapgen/src/theme.rs	Wed Feb 01 10:58:45 2023 +0100
+++ b/rust/mapgen/src/theme.rs	Wed Feb 01 11:19:45 2023 +0100
@@ -47,7 +47,7 @@
 
     pub fn to_transposed(&self) -> ThemeSprite {
         let size = self.size().transpose();
-        let mut pixels = Vec2D::new(size, 0u32);
+        let mut pixels = Vec2D::new(&size, 0u32);
         for (y, row) in self.pixels.rows().enumerate() {
             for (x, v) in row.iter().enumerate() {
                 pixels[x][y] = *v;
@@ -179,7 +179,7 @@
     }
     let size = Size::new(info.width as usize, info.height as usize);
 
-    let mut pixels: Vec2D<u32> = Vec2D::new(size, 0);
+    let mut pixels: Vec2D<u32> = Vec2D::new(&size, 0);
     reader.next_frame(slice_u32_to_u8_mut(pixels.as_mut_slice()))?;
 
     Ok(ThemeSprite { pixels })