Skip to content

Commit

Permalink
add convenience to font render
Browse files Browse the repository at this point in the history
  • Loading branch information
corwinkuiper committed Mar 8, 2024
1 parent 10d9cd8 commit 1434065
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions agb/src/display/object/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,14 @@ impl ObjectTextRender<'_> {
false
}

/// Immediately renders all the completed letter groups in the buffer.
pub fn render_all(&mut self) {
while !self.buffer.buffered_chars.is_empty() {
self.buffer.process();
}
self.number_of_objects = self.buffer.letters.letters.len();
}

fn at_least_n_letter_groups(&mut self, n: usize) {
while !self.buffer.buffered_chars.is_empty() && self.buffer.letters.letters.len() <= n {
self.buffer.process();
Expand Down

0 comments on commit 1434065

Please sign in to comment.