From acee6a3c51120e4602d5ae5372b4a4bb9fa0bf2d Mon Sep 17 00:00:00 2001 From: GBA bot Date: Sun, 2 Jan 2022 00:21:59 +0000 Subject: [PATCH] Import the sprites in the pong code --- book/games/pong/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/book/games/pong/src/main.rs b/book/games/pong/src/main.rs index 9cc6f4f9..121f2950 100644 --- a/book/games/pong/src/main.rs +++ b/book/games/pong/src/main.rs @@ -14,6 +14,10 @@ // up correctly. extern crate agb; +mod gfx { + agb::include_gfx!("gfx/sprites.toml"); +} + // The main function must take 0 arguments and never return. The agb::entry decorator // ensures that everything is in order. `agb` will call this after setting up the stack // and interrupt handlers correctly. @@ -21,5 +25,9 @@ extern crate agb; fn main() -> ! { let mut gba = agb::Gba::new(); + let mut object = gba.display.object.get(); + object.set_sprite_palettes(gfx::sprites::sprites.palettes); + object.set_sprite_tilemap(gfx::sprites::sprites.tiles); + loop {} }