Skip to main content

tile_count_2d

Function tile_count_2d 

Source
pub fn tile_count_2d(
    width: usize,
    height: usize,
    tw: usize,
    th: usize,
) -> (usize, usize)
Expand description

Divides a 2-D problem of (width × height) into tiles of (tw × th) and returns (tiles_x, tiles_y).

Each dimension is rounded up so the full problem is covered.