mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 00:01:34 +11:00
add read pixel method
This commit is contained in:
parent
dbf7715e67
commit
aa38a03ac9
|
@ -30,4 +30,19 @@ impl Bitmap3<'_> {
|
|||
let y = y.try_into().unwrap();
|
||||
BITMAP_MODE_3.set(x, y, colour);
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn read_point(&self, x: i32, y: i32) -> u16 {
|
||||
let x = x.try_into().unwrap();
|
||||
let y = y.try_into().unwrap();
|
||||
BITMAP_MODE_3.get(x, y)
|
||||
}
|
||||
|
||||
pub fn clear(&mut self, colour: u16) {
|
||||
for y in 0..(HEIGHT as usize) {
|
||||
for x in 0..(WIDTH as usize) {
|
||||
BITMAP_MODE_3.set(x, y, colour);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue