Fix docs for real this time

This commit is contained in:
Gwilym Inzani 2023-08-30 17:02:06 +01:00
parent dc04785669
commit 2c556f9ce8

View file

@ -40,7 +40,7 @@ use crate::{
/// use agb::display::Priority; /// use agb::display::Priority;
/// ///
/// mod tilemap { /// mod tilemap {
/// pub const BACKGROUND_MAP: &[u16] = &[ // Probably load this from a file /// pub const BACKGROUND_MAP: &[usize] = &[ // Probably load this from a file
/// # 0, 1, 2]; /// # 0, 1, 2];
/// pub const WIDTH: i32 = // set it to some width /// pub const WIDTH: i32 = // set it to some width
/// # 12; /// # 12;
@ -51,14 +51,14 @@ use crate::{
/// # fn foo(mut gba: agb::Gba) { /// # fn foo(mut gba: agb::Gba) {
/// let (gfx, mut vram) = gba.display.video.tiled0(); /// let (gfx, mut vram) = gba.display.video.tiled0();
/// ///
/// let tileset = water_tiles::tiles.tiles; /// let tile_data = water_tiles::tiles;
/// ///
/// let mut backdrop = InfiniteScrolledMap::new( /// let mut backdrop = InfiniteScrolledMap::new(
/// gfx.background(Priority::P2, RegularBackgroundSize::Background32x32, TileFormat::FourBpp), /// gfx.background(Priority::P2, RegularBackgroundSize::Background32x32, TileFormat::FourBpp),
/// Box::new(|pos| { /// Box::new(|pos| {
/// ( /// (
/// &tileset, /// &tile_data.tiles,
/// water_tiles.tile_settings[*tilemap::BACKGROUND_MAP /// tile_data.tile_settings[*tilemap::BACKGROUND_MAP
/// .get((pos.x + tilemap::WIDTH * pos.y) as usize) /// .get((pos.x + tilemap::WIDTH * pos.y) as usize)
/// .unwrap_or(&0)] /// .unwrap_or(&0)]
/// ) /// )
@ -133,7 +133,7 @@ impl<'a> InfiniteScrolledMap<'a> {
/// # use agb::display::Priority; /// # use agb::display::Priority;
/// # /// #
/// # mod tilemap { /// # mod tilemap {
/// # pub const BACKGROUND_MAP: &[u16] = &[0, 1, 2]; /// # pub const BACKGROUND_MAP: &[usize] = &[0, 1, 2];
/// # pub const WIDTH: i32 = 12; /// # pub const WIDTH: i32 = 12;
/// # pub const MAP_TILES: &[u8] = &[0]; /// # pub const MAP_TILES: &[u8] = &[0];
/// # } /// # }
@ -143,14 +143,14 @@ impl<'a> InfiniteScrolledMap<'a> {
/// # fn foo(mut gba: agb::Gba) { /// # fn foo(mut gba: agb::Gba) {
/// # let (gfx, mut vram) = gba.display.video.tiled0(); /// # let (gfx, mut vram) = gba.display.video.tiled0();
/// # /// #
/// # let tileset = water_tiles.tiles; /// # let tile_data = water_tiles::tiles;
/// # /// #
/// # let mut backdrop = InfiniteScrolledMap::new( /// # let mut backdrop = InfiniteScrolledMap::new(
/// # gfx.background(Priority::P2, RegularBackgroundSize::Background32x32, TileFormat::FourBpp), /// # gfx.background(Priority::P2, RegularBackgroundSize::Background32x32, TileFormat::FourBpp),
/// # Box::new(|pos| { /// # Box::new(|pos| {
/// # ( /// # (
/// # &tileset, /// # &tile_data.tiles,
/// # tileset.tile_settings[ /// # tile_data.tile_settings[
/// # *tilemap::BACKGROUND_MAP /// # *tilemap::BACKGROUND_MAP
/// # .get((pos.x + tilemap::WIDTH * pos.y) as usize) /// # .get((pos.x + tilemap::WIDTH * pos.y) as usize)
/// # .unwrap_or(&0)] /// # .unwrap_or(&0)]
@ -209,7 +209,7 @@ impl<'a> InfiniteScrolledMap<'a> {
/// # use agb::display::Priority; /// # use agb::display::Priority;
/// # /// #
/// # mod tilemap { /// # mod tilemap {
/// # pub const BACKGROUND_MAP: &[u16] = &[0, 1, 2]; /// # pub const BACKGROUND_MAP: &[usize] = &[0, 1, 2];
/// # pub const WIDTH: i32 = 12; /// # pub const WIDTH: i32 = 12;
/// # pub const MAP_TILES: &[u8] = &[0]; /// # pub const MAP_TILES: &[u8] = &[0];
/// # } /// # }
@ -219,14 +219,14 @@ impl<'a> InfiniteScrolledMap<'a> {
/// # fn foo(mut gba: agb::Gba) { /// # fn foo(mut gba: agb::Gba) {
/// # let (gfx, mut vram) = gba.display.video.tiled0(); /// # let (gfx, mut vram) = gba.display.video.tiled0();
/// # /// #
/// # let tileset = water_tiles.tiles; /// # let tile_data = water_tiles::tiles;
/// # /// #
/// # let mut backdrop = InfiniteScrolledMap::new( /// # let mut backdrop = InfiniteScrolledMap::new(
/// # gfx.background(Priority::P2, RegularBackgroundSize::Background32x32, TileFormat::FourBpp), /// # gfx.background(Priority::P2, RegularBackgroundSize::Background32x32, TileFormat::FourBpp),
/// # Box::new(|pos| { /// # Box::new(|pos| {
/// # ( /// # (
/// # &tileset, /// # &tile_data.tiles,
/// # tileset.tile_settings[ /// # tile_data.tile_settings[
/// # *tilemap::BACKGROUND_MAP /// # *tilemap::BACKGROUND_MAP
/// # .get((pos.x + tilemap::WIDTH * pos.y) as usize) /// # .get((pos.x + tilemap::WIDTH * pos.y) as usize)
/// # .unwrap_or(&0)] /// # .unwrap_or(&0)]