Skip to content
Snippets Groups Projects
Verified Commit 933e504c authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: new buffer strategy

Allows WASM to run in a better way
parent ba093b1d
No related branches found
No related tags found
No related merge requests found
Pipeline #897 passed
......@@ -27,7 +27,7 @@ pub type Pixel = [u8; RGB_SIZE];
/// should contain the pixel buffer of the tile.
#[derive(Clone, Copy, PartialEq)]
pub struct Tile {
pub buffer: [u8; 64],
buffer: [u8; 64],
}
impl Tile {
......@@ -38,6 +38,10 @@ impl Tile {
pub fn set(&mut self, x: usize, y: usize, value: u8) {
self.buffer[y * 8 + x] = value;
}
pub fn buffer(&self) -> Vec<u8> {
self.buffer.to_vec()
}
}
impl Display for Tile {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment