mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/data/renderer.rs')
-rw-r--r--src/data/renderer.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/data/renderer.rs b/src/data/renderer.rs
index 93f1a7e..1731802 100644
--- a/src/data/renderer.rs
+++ b/src/data/renderer.rs
@@ -128,12 +128,13 @@ impl Renderable for Schematic<'_> {
let x = x as u32 - ((tile.block.get_size() - 1) / 2) as u32;
let y = self.height as u32 - y as u32 - ((tile.block.get_size() / 2) + 1) as u32;
canvas.as_mut().overlay_at(
- tile.image(
- ctx.as_ref(),
- tile.get_rotation().unwrap_or(Rotation::Up),
- Scale::Full,
- )
- .borrow(),
+ &tile
+ .image(
+ ctx.as_ref(),
+ tile.get_rotation().unwrap_or(Rotation::Up),
+ Scale::Full,
+ )
+ .borrow(),
(x + 1) * 32,
(y + 1) * 32,
);
@@ -176,13 +177,13 @@ impl Renderable for Map<'_> {
// draw the floor first.
// println!("draw {tile:?} ({x}, {y}) + {scale:?}");
floor.as_mut().overlay_at(
- tile.floor(scale).borrow(),
+ &tile.floor(scale).borrow(),
scale * x as u32,
scale * y as u32,
);
if tile.has_ore() {
floor.as_mut().overlay_at(
- tile.ore(scale).borrow(),
+ &tile.ore(scale).borrow(),
scale * x as u32,
scale * y as u32,
);
@@ -207,13 +208,13 @@ impl Renderable for Map<'_> {
None
};
top.as_mut().overlay_at(
- tile.build_image(ctx.as_ref(), scale).borrow(),
+ &tile.build_image(ctx.as_ref(), scale).borrow(),
scale * x as u32,
scale * y as u32,
);
}
}
- floor.as_mut().overlay_at(top.as_ref(), 0, 0);
+ floor.as_mut().overlay_at(&top.as_ref(), 0, 0);
floor
}
}