not working

This commit is contained in:
2025-02-27 01:16:07 +00:00
parent ac0b47a45c
commit 3b6e272fd2
22 changed files with 448 additions and 50 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ impl Writer {
}
// Get the character data from the font array. -- each byte is a row of pixels
let data: &[u8] = &self.font.0[c as usize];
let data: &[u8] = self.font.glyph_for(c as u16);
if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() {
for (row, line) in data.iter().enumerate().take(16) {
+9 -2
View File
@@ -61,9 +61,16 @@ impl FramebufferWriter {
}
}
pub fn render_frame(&self, buffer: &[Colour; 1280 * 800]) {
for (y, row) in buffer.chunks(1280).enumerate() {
pub fn render_frame(&self, buffer: &[&[Colour]]) {
// TODO: this should return errors
for (y, &row) in buffer.iter().enumerate() {
if y >= self.height() as usize {
break;
}
for (x, pixel) in row.iter().enumerate() {
if x >= self.width() as usize {
break;
}
self.write_pixel(x, y, *pixel);
}
}