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 (#714)
- [x] Changelog updated
This commit is contained in:
commit
2de07342d7
|
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- Added `find_colour_index_16` and `find_colour_index_256` to the `VRamManager` to find where a colour is in a palette.
|
- Added `find_colour_index_16` and `find_colour_index_256` to the `VRamManager` to find where a colour is in a palette.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Affine background center position didn't work outside of the upper left quadrant of the gba's screen.
|
||||||
|
|
||||||
## [0.20.2] - 2024/05/25
|
## [0.20.2] - 2024/05/25
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -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