mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Accept more sensible arguments in affine_matrix
This commit is contained in:
parent
361e9c93e6
commit
e7edaa1a27
|
@ -1,4 +1,5 @@
|
|||
use crate::display::object::AffineMatrixAttributes;
|
||||
use crate::number::Num;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
||||
|
@ -105,7 +106,7 @@ pub fn arc_tan2(x: i16, y: i32) -> i16 {
|
|||
result
|
||||
}
|
||||
|
||||
pub fn affine_matrix(x_scale: i16, y_scale: i16, rotation: u16) -> AffineMatrixAttributes {
|
||||
pub fn affine_matrix(x_scale: Num<8>, y_scale: Num<8>, rotation: u8) -> AffineMatrixAttributes {
|
||||
let mut result = AffineMatrixAttributes {
|
||||
p_a: 0,
|
||||
p_b: 0,
|
||||
|
@ -120,10 +121,12 @@ pub fn affine_matrix(x_scale: i16, y_scale: i16, rotation: u16) -> AffineMatrixA
|
|||
rotation: u16,
|
||||
}
|
||||
|
||||
let rotation_for_input = (rotation as u16) << 8;
|
||||
|
||||
let input = Input {
|
||||
x_scale,
|
||||
y_scale,
|
||||
rotation,
|
||||
y_scale: x_scale.to_raw() as i16,
|
||||
x_scale: y_scale.to_raw() as i16,
|
||||
rotation: rotation_for_input,
|
||||
};
|
||||
|
||||
unsafe {
|
||||
|
|
Loading…
Reference in a new issue