pub fn draw_region(&self, frame: &mut [u8], region: &GameRegion, rect: &(usize, usize, usize, usize), offset: &(isize, isize), stride: usize, tile_size: usize, anim_counter: usize, asset: &Asset) {
        let left_offset = (rect.2 % tile_size) / 2;
        let top_offset = (rect.3 % tile_size) / 2;

        let x_tiles = (rect.2 / tile_size) as isize;
        let y_tiles = (rect.3 / tile_size) as isize;

        for y in 0..y_tiles {
            for x in 0..x_tiles {
                let values = region.get_value((x + offset.0, y + offset.1));
                for value in values {
                    let pos = (rect.0 + left_offset + (x as usize) * tile_size, rect.1 + top_offset + (y as usize) * tile_size);

                    let map = asset.get_map_of_id(value.0);
                    self.draw_animated_tile(frame, &pos, map, stride, &(value.1, value.2), anim_counter, tile_size);
                }
            }
        }
    }
/// Draws the given region with the given offset into the rectangle
Draws the given region with the given offset into the rectangle
Draws the given region with the given offset into the rectangle
pub fn draw_region(&self, frame: &mut [u8], region: &GameRegion, rect: &(usize, usize, usize, usize), offset: &(isize, isize), stride: usize, tile_size: usize, anim_counter: usize, asset: &Asset) {
        let left_offset = (rect.2 % tile_size) / 2;
        let top_offset = (rect.3 % tile_size) / 2;
        let x_tiles = (rect.2 / tile_size) as isize;
        let y_tiles = (rect.3 / tile_size) as isize;
        for y in 0..y_tiles {
            for x in 0..x_tiles {
                let values = region.get_value((x + offset.0, y + offset.1));
                for value in values {
                    let pos = (rect.0 + left_offset + (x as usize) * tile_size, rect.1 + top_offset + (y as usize) * tile_size);
                    let map = asset.get_map_of_id(value.0);
                    self.draw_animated_tile(frame, &pos, map, stride, &(value.1, value.2), anim_counter, tile_size);
                }
            }
        }
    }
pub fn draw_region ( & self , frame : & mut [ u8 ] , region : & GameRegion , rect : & ( usize , usize , usize , usize ) , offset : & ( isize , isize ) , stride : usize , tile_size : usize , anim_counter : usize , asset : & Asset ) { let left_offset = ( rect . 2 % tile_size ) / 2 ; let top_offset = ( rect . 3 % tile_size ) / 2 ; let x_tiles = ( rect . 2 / tile_size ) as isize ; let y_tiles = ( rect . 3 / tile_size ) as isize ; for y in 0 .. y_tiles { for x in 0 .. x_tiles { let values = region . get_value ( ( x + offset . 0 , y + offset . 1 ) ) ; for value in values { let pos = ( rect . 0 + left_offset + ( x as usize ) * tile_size , rect . 1 + top_offset + ( y as usize ) * tile_size ) ; let map = asset . get_map_of_id ( value . 0 ) ; self . draw_animated_tile ( frame , & pos , map , stride , & ( value . 1 , value . 2 ) , anim_counter , tile_size ) ; } } } }
Draws the given region with the given offset into the rectangle
Draws the given region with the given offset into the rectangle
&self
frame
&mut [u8]
region
&GameRegion
rect
&(usize, usize, usize, usize)
offset
&(isize, isize)
stride
usize
tile_size
usize
anim_counter
usize
asset
&Asset
&self
frame
&mut [u8]
region
&GameRegion
rect
&(usize, usize, usize, usize)
offset
&(isize, isize)
stride
usize
tile_size
usize
anim_counter
usize
asset
&Asset