change name to "get"

This commit is contained in:
Corwin Kuiper 2021-07-03 18:57:17 +01:00
parent 37c29b7ec3
commit 7b46bc9703
9 changed files with 10 additions and 10 deletions

View file

@ -14,7 +14,7 @@ struct Vector2D {
pub fn main() -> ! {
let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3();
let vblank = agb::interrupt::VBlank::new();
let vblank = agb::interrupt::VBlank::get();
let mut input = agb::input::ButtonController::new();
let mut pos = Vector2D {

View file

@ -9,7 +9,7 @@ use agb::display;
pub fn main() -> ! {
let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap4();
let vblank = agb::interrupt::VBlank::new();
let vblank = agb::interrupt::VBlank::get();
bitmap.set_palette_entry(1, 0x001F);
bitmap.set_palette_entry(2, 0x03E0);

View file

@ -45,7 +45,7 @@ pub fn main() -> ! {
let mut gba = agb::Gba::new();
let mut gfx = gba.display.video.tiled0();
let vblank = agb::interrupt::VBlank::new();
let vblank = agb::interrupt::VBlank::get();
let mut input = agb::input::ButtonController::new();
gfx.set_sprite_palette_raw(&CHICKEN_PALETTE);

View file

@ -15,7 +15,7 @@ const I_WILL_NOT_LET_YOU_LET_ME_DOWN: &[u8] = include_bytes!("i-will-not-let-you
pub fn main() -> ! {
let mut gba = Gba::new();
let mut input = ButtonController::new();
let vblank_provider = agb::interrupt::VBlank::new();
let vblank_provider = agb::interrupt::VBlank::get();
let mut mixer = gba.mixer.mixer();
mixer.enable();

View file

@ -13,7 +13,7 @@ struct Vector2D {
#[no_mangle]
pub fn main() -> ! {
let mut gba = agb::Gba::new();
let vblank = agb::interrupt::VBlank::new();
let vblank = agb::interrupt::VBlank::get();
let mut input = agb::input::ButtonController::new();
loop {

View file

@ -4,7 +4,7 @@
extern crate agb;
#[no_mangle]
pub fn main() -> ! {
let vblank = agb::interrupt::VBlank::new();
let vblank = agb::interrupt::VBlank::get();
let mut count = 0;
loop {

View file

@ -45,7 +45,7 @@ pub fn main() -> ! {
backc.row += 1;
});
let vblank = agb::interrupt::VBlank::new();
let vblank = agb::interrupt::VBlank::get();
loop {
vblank.wait_for_vblank();

View file

@ -257,7 +257,7 @@ fn test_vblank_interrupt_handler(_gba: &mut crate::Gba) {
add_interrupt_handler!(Interrupt::VBlank, || *counter.lock() += 1);
add_interrupt_handler!(Interrupt::VBlank, || *counter_2.lock() += 1);
let vblank = VBlank::new();
let vblank = VBlank::get();
while *counter.lock() < 100 || *counter_2.lock() < 100 {
vblank.wait_for_vblank();
@ -353,7 +353,7 @@ impl<'a, T> DerefMut for MutexRef<'a, T> {
pub struct VBlank {}
impl VBlank {
pub fn new() -> Self {
pub fn get() -> Self {
interrupt_to_root(Interrupt::VBlank).add();
VBlank {}
}

View file

@ -164,7 +164,7 @@ mod test {
#[test_case]
fn wait_30_frames(_gba: &mut Gba) {
let vblank = crate::interrupt::VBlank::new();
let vblank = crate::interrupt::VBlank::get();
let mut counter = 0;
loop {
if counter > 30 {