pub fn write_pos(&self, tilemap: &HashMap<Tile, Vec<u32>>, pos: (usize, usize), buffer: &mut [u32]) {
        let (r, c) = pos;
        let tile = &self.tiles[r * self.width + c];
        let arr = &tilemap[tile];
        let base_r = r * self.size;
        let base_c = c * self.size;
        for rt in 0..self.size {
            for ct in 0..self.size {
                buffer[(base_r + rt) * self.width * self.size + base_c + ct] = arr[rt * self.size + ct];
            }
        }
    }
/// Writes a single tile to a buffer
Writes a single tile to a buffer
Writes a single tile to a buffer
pub fn write_pos(&self, tilemap: &HashMap<Tile, Vec<u32>>, pos: (usize, usize), buffer: &mut [u32]) {
        let (r, c) = pos;
        let tile = &self.tiles[r * self.width + c];
        let arr = &tilemap[tile];
        let base_r = r * self.size;
        let base_c = c * self.size;
        for rt in 0..self.size {
            for ct in 0..self.size {
                buffer[(base_r + rt) * self.width * self.size + base_c + ct] = arr[rt * self.size + ct];
            }
        }
    }
pub fn write_pos ( & self , tilemap : & HashMap < Tile , Vec < u32 > > , pos : ( usize , usize ) , buffer : & mut [ u32 ] ) { let ( r , c ) = pos ; let tile = & self . tiles [ r * self . width + c ] ; let arr = & tilemap [ tile ] ; let base_r = r * self . size ; let base_c = c * self . size ; for rt in 0 .. self . size { for ct in 0 .. self . size { buffer [ ( base_r + rt ) * self . width * self . size + base_c + ct ] = arr [ rt * self . size + ct ] ; } } }
Writes a single tile to a buffer
Writes a single tile to a buffer
&self
tilemap
&HashMap<Tile, Vec<u32>>
pos
(usize, usize)
buffer
&mut [u32]
&self
tilemap
&HashMap<Tile, Vec<u32>>
pos
(usize, usize)
buffer
&mut [u32]