mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Use the fact that tris turn into integers nicely
This commit is contained in:
parent
63b0fa63c6
commit
dd2030d354
|
@ -43,18 +43,8 @@ fn main(mut gba: agb::Gba) -> ! {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
input.update();
|
input.update();
|
||||||
|
scroll_x += input.x_tri() as i32;
|
||||||
match input.x_tri() {
|
scroll_y += input.y_tri() as i32;
|
||||||
Tri::Positive => scroll_x += 1,
|
|
||||||
Tri::Negative => scroll_x -= 1,
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
|
|
||||||
match input.y_tri() {
|
|
||||||
Tri::Positive => scroll_y += 1,
|
|
||||||
Tri::Negative => scroll_y -= 1,
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
|
|
||||||
let scroll_pos = (scroll_x as i16, scroll_y as i16);
|
let scroll_pos = (scroll_x as i16, scroll_y as i16);
|
||||||
bg.set_scroll_pos(scroll_pos.into());
|
bg.set_scroll_pos(scroll_pos.into());
|
||||||
|
|
Loading…
Reference in a new issue