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