progress on terminal app
This commit is contained in:
@@ -52,6 +52,7 @@ pub enum RenderError {
|
||||
InvalidCharacter,
|
||||
InvalidColour,
|
||||
InvalidRenderMode,
|
||||
Other(&'static str),
|
||||
}
|
||||
|
||||
impl ScreenChar {
|
||||
@@ -111,19 +112,16 @@ lazy_static! {
|
||||
|
||||
impl Renderer {
|
||||
// EXTERNAL API : for use by standard library and other parts of the kernel
|
||||
pub fn render_frame(&mut self, frame: [[ScreenChar; BUFFER_WIDTH]; BUFFER_HEIGHT]) { // renders the given frame to the app buffer
|
||||
let mut processed_frame: [[ScreenChar; BUFFER_WIDTH]; BUFFER_HEIGHT] = [[ScreenChar::null(); BUFFER_WIDTH]; BUFFER_HEIGHT];
|
||||
|
||||
for (i, row) in frame.iter().enumerate() {
|
||||
for (j, col) in row.iter().enumerate() {
|
||||
processed_frame[i][j] = match special_char(col.character as char) {
|
||||
Some(c) => ScreenChar::new(c as u8, col.colour),
|
||||
None => *col,
|
||||
};
|
||||
pub fn render_frame(&mut self, mut frame: [[ScreenChar; BUFFER_WIDTH]; BUFFER_HEIGHT]) { // renders the given frame to the app buffer
|
||||
for (i, row) in frame.iter_mut().enumerate() {
|
||||
for (j, col) in row.iter_mut().enumerate() {
|
||||
if let Some(c) = special_char(col.character as char) {
|
||||
col.character = c as u8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.app_buffer = processed_frame;
|
||||
self.app_buffer = frame;
|
||||
self.internal_render();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user