mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 08:41:34 +11:00
Merge pull request #63 from corwinkuiper/split-object
move object out of tiled0
This commit is contained in:
commit
342aac005c
|
@ -58,7 +58,7 @@ pub fn main() -> ! {
|
||||||
background.set_map(&MAP_MAP, 32, 32);
|
background.set_map(&MAP_MAP, 32, 32);
|
||||||
background.show();
|
background.show();
|
||||||
|
|
||||||
let mut object = gfx.object;
|
let mut object = gba.display.object.get();
|
||||||
|
|
||||||
object.enable();
|
object.enable();
|
||||||
let mut chicken = Character {
|
let mut chicken = Character {
|
||||||
|
|
|
@ -4,6 +4,8 @@ use bitflags::bitflags;
|
||||||
use vblank::VBlankGiver;
|
use vblank::VBlankGiver;
|
||||||
use video::Video;
|
use video::Video;
|
||||||
|
|
||||||
|
use self::object::ObjectControl;
|
||||||
|
|
||||||
/// Graphics mode 3. Bitmap mode that provides a 16-bit colour framebuffer.
|
/// Graphics mode 3. Bitmap mode that provides a 16-bit colour framebuffer.
|
||||||
pub mod bitmap3;
|
pub mod bitmap3;
|
||||||
/// Graphics mode 4. Bitmap 4 provides two 8-bit paletted framebuffers with page switching.
|
/// Graphics mode 4. Bitmap 4 provides two 8-bit paletted framebuffers with page switching.
|
||||||
|
@ -62,6 +64,16 @@ enum DisplayMode {
|
||||||
pub struct Display {
|
pub struct Display {
|
||||||
pub video: Video,
|
pub video: Video,
|
||||||
pub vblank: VBlankGiver,
|
pub vblank: VBlankGiver,
|
||||||
|
pub object: ObjectDistribution,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
|
pub struct ObjectDistribution {}
|
||||||
|
|
||||||
|
impl ObjectDistribution {
|
||||||
|
pub fn get(&mut self) -> ObjectControl {
|
||||||
|
ObjectControl::new()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display {
|
impl Display {
|
||||||
|
@ -69,6 +81,7 @@ impl Display {
|
||||||
Display {
|
Display {
|
||||||
video: Video {},
|
video: Video {},
|
||||||
vblank: VBlankGiver {},
|
vblank: VBlankGiver {},
|
||||||
|
object: ObjectDistribution {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,8 +365,7 @@ impl ObjectControl {
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test_case]
|
#[test_case]
|
||||||
fn get_and_release_object(gba: &mut crate::Gba) {
|
fn get_and_release_object(gba: &mut crate::Gba) {
|
||||||
let gfx = gba.display.video.tiled0();
|
let objs = gba.display.object.get();
|
||||||
let objs = gfx.object;
|
|
||||||
|
|
||||||
let _o1 = {
|
let _o1 = {
|
||||||
let o0 = objs.get_object_standard();
|
let o0 = objs.get_object_standard();
|
||||||
|
@ -384,8 +383,7 @@ mod tests {
|
||||||
|
|
||||||
#[test_case]
|
#[test_case]
|
||||||
fn get_and_release_affine(gba: &mut crate::Gba) {
|
fn get_and_release_affine(gba: &mut crate::Gba) {
|
||||||
let gfx = gba.display.video.tiled0();
|
let objs = gba.display.object.get();
|
||||||
let objs = gfx.object;
|
|
||||||
|
|
||||||
let _a1 = {
|
let _a1 = {
|
||||||
let a0 = objs.get_affine();
|
let a0 = objs.get_affine();
|
||||||
|
|
|
@ -248,7 +248,6 @@ impl Background<'_> {
|
||||||
pub struct Tiled0 {
|
pub struct Tiled0 {
|
||||||
used_blocks: u32,
|
used_blocks: u32,
|
||||||
num_backgrounds: u8,
|
num_backgrounds: u8,
|
||||||
pub object: ObjectControl,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tiled0 {
|
impl Tiled0 {
|
||||||
|
@ -258,7 +257,6 @@ impl Tiled0 {
|
||||||
Tiled0 {
|
Tiled0 {
|
||||||
used_blocks: 0,
|
used_blocks: 0,
|
||||||
num_backgrounds: 0,
|
num_backgrounds: 0,
|
||||||
object: ObjectControl::new(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue