add read pixel method

This commit is contained in:
Corwin 2023-06-24 16:17:32 +01:00
parent dbf7715e67
commit aa38a03ac9
No known key found for this signature in database

View file

@ -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);
}
}
}
}