mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Fix example games
This commit is contained in:
parent
5513c8566f
commit
39b37e7506
|
@ -7,7 +7,8 @@ use agb::{
|
||||||
display::{
|
display::{
|
||||||
object::{Graphics, Object, ObjectController, Tag, TagMap},
|
object::{Graphics, Object, ObjectController, Tag, TagMap},
|
||||||
tiled::{
|
tiled::{
|
||||||
InfiniteScrolledMap, PartialUpdateStatus, TileFormat, TileSet, TileSetting, VRamManager,
|
InfiniteScrolledMap, PartialUpdateStatus, RegularBackgroundSize, TileFormat, TileSet,
|
||||||
|
TileSetting, VRamManager,
|
||||||
},
|
},
|
||||||
Priority, HEIGHT, WIDTH,
|
Priority, HEIGHT, WIDTH,
|
||||||
},
|
},
|
||||||
|
@ -777,8 +778,8 @@ impl<'a, 'b, 'c> PlayingLevel<'a, 'b> {
|
||||||
fn main(mut agb: agb::Gba) -> ! {
|
fn main(mut agb: agb::Gba) -> ! {
|
||||||
let (tiled, mut vram) = agb.display.video.tiled0();
|
let (tiled, mut vram) = agb.display.video.tiled0();
|
||||||
vram.set_background_palettes(tile_sheet::background.palettes);
|
vram.set_background_palettes(tile_sheet::background.palettes);
|
||||||
let mut splash_screen = tiled.background(Priority::P0);
|
let mut splash_screen = tiled.background(Priority::P0, RegularBackgroundSize::Background32x32);
|
||||||
let mut world_display = tiled.background(Priority::P0);
|
let mut world_display = tiled.background(Priority::P0, RegularBackgroundSize::Background32x32);
|
||||||
|
|
||||||
let tileset = TileSet::new(tile_sheet::background.tiles, TileFormat::FourBpp);
|
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 map_current_level = current_level;
|
||||||
let mut background = InfiniteScrolledMap::new(
|
let mut background = InfiniteScrolledMap::new(
|
||||||
tiled.background(Priority::P2),
|
tiled.background(Priority::P2, RegularBackgroundSize::Background32x32),
|
||||||
Box::new(|pos: Vector2D<i32>| {
|
Box::new(|pos: Vector2D<i32>| {
|
||||||
let level = &map_tiles::LEVELS[map_current_level as usize];
|
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(
|
let mut foreground = InfiniteScrolledMap::new(
|
||||||
tiled.background(Priority::P0),
|
tiled.background(Priority::P0, RegularBackgroundSize::Background32x32),
|
||||||
Box::new(|pos: Vector2D<i32>| {
|
Box::new(|pos: Vector2D<i32>| {
|
||||||
let level = &map_tiles::LEVELS[map_current_level as usize];
|
let level = &map_tiles::LEVELS[map_current_level as usize];
|
||||||
(
|
(
|
||||||
|
|
|
@ -12,7 +12,10 @@ use alloc::{boxed::Box, vec::Vec};
|
||||||
use agb::{
|
use agb::{
|
||||||
display::{
|
display::{
|
||||||
object::{Graphics, Object, ObjectController, Sprite, Tag, TagMap},
|
object::{Graphics, Object, ObjectController, Sprite, Tag, TagMap},
|
||||||
tiled::{InfiniteScrolledMap, TileFormat, TileSet, TileSetting, VRamManager},
|
tiled::{
|
||||||
|
InfiniteScrolledMap, RegularBackgroundSize, TileFormat, TileSet, TileSetting,
|
||||||
|
VRamManager,
|
||||||
|
},
|
||||||
Priority, HEIGHT, WIDTH,
|
Priority, HEIGHT, WIDTH,
|
||||||
},
|
},
|
||||||
fixnum::{FixedNum, Rect, Vector2D},
|
fixnum::{FixedNum, Rect, Vector2D},
|
||||||
|
@ -2221,7 +2224,7 @@ fn game_with_level(gba: &mut agb::Gba) {
|
||||||
let object = gba.display.object.get();
|
let object = gba.display.object.get();
|
||||||
|
|
||||||
let backdrop = InfiniteScrolledMap::new(
|
let backdrop = InfiniteScrolledMap::new(
|
||||||
background.background(Priority::P2),
|
background.background(Priority::P2, RegularBackgroundSize::Background32x32),
|
||||||
Box::new(|pos| {
|
Box::new(|pos| {
|
||||||
(
|
(
|
||||||
&tileset,
|
&tileset,
|
||||||
|
@ -2235,7 +2238,7 @@ fn game_with_level(gba: &mut agb::Gba) {
|
||||||
);
|
);
|
||||||
|
|
||||||
let foreground = InfiniteScrolledMap::new(
|
let foreground = InfiniteScrolledMap::new(
|
||||||
background.background(Priority::P0),
|
background.background(Priority::P0, RegularBackgroundSize::Background32x32),
|
||||||
Box::new(|pos| {
|
Box::new(|pos| {
|
||||||
(
|
(
|
||||||
&tileset,
|
&tileset,
|
||||||
|
@ -2249,7 +2252,7 @@ fn game_with_level(gba: &mut agb::Gba) {
|
||||||
);
|
);
|
||||||
|
|
||||||
let clouds = InfiniteScrolledMap::new(
|
let clouds = InfiniteScrolledMap::new(
|
||||||
background.background(Priority::P3),
|
background.background(Priority::P3, RegularBackgroundSize::Background32x32),
|
||||||
Box::new(|pos| {
|
Box::new(|pos| {
|
||||||
(
|
(
|
||||||
&tileset,
|
&tileset,
|
||||||
|
|
Loading…
Reference in a new issue