mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
fix tile ids
This commit is contained in:
parent
d0808cb7f2
commit
301e2c115a
|
@ -119,6 +119,10 @@ impl ObjectStandard<'_> {
|
|||
self.attributes.set_mode(Mode::Hidden)
|
||||
}
|
||||
|
||||
pub fn set_palette(&mut self, palette: u16) {
|
||||
self.attributes.set_palette(palette);
|
||||
}
|
||||
|
||||
/// Sets the x and y position of the object, performing casts as nessesary
|
||||
/// to fit within the bits allocated for this purpose.
|
||||
pub fn set_position(&mut self, position: Vector2D<i32>) {
|
||||
|
@ -231,6 +235,10 @@ impl ObjectAttribute {
|
|||
self.a1 = set_bits(self.a1, a1, 2, 0xE);
|
||||
}
|
||||
|
||||
fn set_palette(&mut self, palette: u16) {
|
||||
self.a2 = set_bits(self.a2, palette, 4, 0xC);
|
||||
}
|
||||
|
||||
fn set_x(&mut self, x: u16) {
|
||||
self.a1 = set_bits(self.a1, x, 9, 0);
|
||||
}
|
||||
|
@ -240,7 +248,7 @@ impl ObjectAttribute {
|
|||
}
|
||||
|
||||
fn set_tile_id(&mut self, id: u16) {
|
||||
self.a2 = set_bits(self.a2, id, 9, 0);
|
||||
self.a2 = set_bits(self.a2, id, 10, 0);
|
||||
}
|
||||
|
||||
fn set_mode(&mut self, mode: Mode) {
|
||||
|
|
Loading…
Reference in a new issue