mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Fix affine background matrix creation outside of the 1st quadrant
This commit is contained in:
parent
27ee9c7b85
commit
fde444e253
|
@ -43,8 +43,8 @@ fn main(mut gba: agb::Gba) -> ! {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
input.update();
|
input.update();
|
||||||
scroll_x += input.x_tri() as i32;
|
scroll_x += input.x_tri() as i16;
|
||||||
scroll_y += input.y_tri() as i32;
|
scroll_y += input.y_tri() as i16;
|
||||||
|
|
||||||
let scroll_pos = (scroll_x, scroll_y);
|
let scroll_pos = (scroll_x, scroll_y);
|
||||||
|
|
||||||
|
|
|
@ -298,11 +298,11 @@ impl AffineMatrixBackground {
|
||||||
transform_origin: impl Into<Vector2D<Num<i32, 8>>>,
|
transform_origin: impl Into<Vector2D<Num<i32, 8>>>,
|
||||||
scale: impl Into<Vector2D<Num<i32, 8>>>,
|
scale: impl Into<Vector2D<Num<i32, 8>>>,
|
||||||
rotation: Num<i32, 16>,
|
rotation: Num<i32, 16>,
|
||||||
position: impl Into<Vector2D<Num<i32, 8>>>,
|
position: impl Into<Vector2D<i16>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
crate::syscall::bg_affine_matrix(
|
crate::syscall::bg_affine_matrix(
|
||||||
transform_origin.into(),
|
transform_origin.into(),
|
||||||
position.into().try_change_base::<i16, 8>().unwrap().floor(),
|
position.into(),
|
||||||
scale.into().try_change_base().unwrap(),
|
scale.into().try_change_base().unwrap(),
|
||||||
rotation.rem_euclid(1.into()).try_change_base().unwrap(),
|
rotation.rem_euclid(1.into()).try_change_base().unwrap(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue