Fix example games

This commit is contained in:
Gwilym Kuiper 2022-05-03 22:51:01 +01:00
parent 5513c8566f
commit 39b37e7506
2 changed files with 13 additions and 9 deletions

View file

@ -7,7 +7,8 @@ use agb::{
display::{
object::{Graphics, Object, ObjectController, Tag, TagMap},
tiled::{
InfiniteScrolledMap, PartialUpdateStatus, TileFormat, TileSet, TileSetting, VRamManager,
InfiniteScrolledMap, PartialUpdateStatus, RegularBackgroundSize, TileFormat, TileSet,
TileSetting, VRamManager,
},
Priority, HEIGHT, WIDTH,
},
@ -777,8 +778,8 @@ impl<'a, 'b, 'c> PlayingLevel<'a, 'b> {
fn main(mut agb: agb::Gba) -> ! {
let (tiled, mut vram) = agb.display.video.tiled0();
vram.set_background_palettes(tile_sheet::background.palettes);
let mut splash_screen = tiled.background(Priority::P0);
let mut world_display = tiled.background(Priority::P0);
let mut splash_screen = tiled.background(Priority::P0, RegularBackgroundSize::Background32x32);
let mut world_display = tiled.background(Priority::P0, RegularBackgroundSize::Background32x32);
let tileset = TileSet::new(tile_sheet::background.tiles, TileFormat::FourBpp);
@ -845,7 +846,7 @@ fn main(mut agb: agb::Gba) -> ! {
let map_current_level = current_level;
let mut background = InfiniteScrolledMap::new(
tiled.background(Priority::P2),
tiled.background(Priority::P2, RegularBackgroundSize::Background32x32),
Box::new(|pos: Vector2D<i32>| {
let level = &map_tiles::LEVELS[map_current_level as usize];
(
@ -860,7 +861,7 @@ fn main(mut agb: agb::Gba) -> ! {
}),
);
let mut foreground = InfiniteScrolledMap::new(
tiled.background(Priority::P0),
tiled.background(Priority::P0, RegularBackgroundSize::Background32x32),
Box::new(|pos: Vector2D<i32>| {
let level = &map_tiles::LEVELS[map_current_level as usize];
(

View file

@ -12,7 +12,10 @@ use alloc::{boxed::Box, vec::Vec};
use agb::{
display::{
object::{Graphics, Object, ObjectController, Sprite, Tag, TagMap},
tiled::{InfiniteScrolledMap, TileFormat, TileSet, TileSetting, VRamManager},
tiled::{
InfiniteScrolledMap, RegularBackgroundSize, TileFormat, TileSet, TileSetting,
VRamManager,
},
Priority, HEIGHT, WIDTH,
},
fixnum::{FixedNum, Rect, Vector2D},
@ -2221,7 +2224,7 @@ fn game_with_level(gba: &mut agb::Gba) {
let object = gba.display.object.get();
let backdrop = InfiniteScrolledMap::new(
background.background(Priority::P2),
background.background(Priority::P2, RegularBackgroundSize::Background32x32),
Box::new(|pos| {
(
&tileset,
@ -2235,7 +2238,7 @@ fn game_with_level(gba: &mut agb::Gba) {
);
let foreground = InfiniteScrolledMap::new(
background.background(Priority::P0),
background.background(Priority::P0, RegularBackgroundSize::Background32x32),
Box::new(|pos| {
(
&tileset,
@ -2249,7 +2252,7 @@ fn game_with_level(gba: &mut agb::Gba) {
);
let clouds = InfiniteScrolledMap::new(
background.background(Priority::P3),
background.background(Priority::P3, RegularBackgroundSize::Background32x32),
Box::new(|pos| {
(
&tileset,