update indev version

This commit is contained in:
Vinzenz Schroeter 2025-07-09 23:30:50 +02:00
commit 143ef1e285
7 changed files with 49 additions and 51 deletions

View file

@ -76,40 +76,44 @@ impl Game {
pub fn draw(
&self,
text_layer: WindowMut<char, CharGrid>,
pixel_layer: WindowMut<bool, Bitmap>,
mut text_layer: WindowMut<char, CharGrid>,
mut pixel_layer: WindowMut<bool, Bitmap>,
) {
let (text_layer, pixel_layer) = draw_border_panel(
text_layer,
pixel_layer,
let (mut text_layer, mut pixel_layer) = draw_border_panel(
&mut text_layer,
&mut pixel_layer,
" Discordia Boot Procedure ",
OUTER_BORDER,
);
let unlocks_height = 3 + 2;
let (unlocks_text, bars_text) = text_layer.split_vertical_mut(unlocks_height).unwrap();
let (unlocks_pixel, bars_pixel) = pixel_layer
let (mut unlocks_text, bars_text) = text_layer.split_vertical_mut(unlocks_height).unwrap();
let (mut unlocks_pixel, bars_pixel) = pixel_layer
.split_vertical_mut(unlocks_height * TILE_SIZE)
.unwrap();
self.unlocks.draw(unlocks_text, unlocks_pixel);
self.unlocks.draw(&mut unlocks_text, &mut unlocks_pixel);
self.draw_bars(bars_text, bars_pixel);
}
fn draw_bars(
&self,
text_layer: WindowMut<char, CharGrid>,
pixel_layer: WindowMut<bool, Bitmap>,
mut text_layer: WindowMut<char, CharGrid>,
mut pixel_layer: WindowMut<bool, Bitmap>,
) {
let (mut text_layer, mut pixel_layer) =
draw_border_panel(text_layer, pixel_layer, " Processes ", INNER_BORDER);
let (mut text_layer, mut pixel_layer) = draw_border_panel(
&mut text_layer,
&mut pixel_layer,
" Processes ",
INNER_BORDER,
);
for row in self.state.rows.iter() {
let bar_window;
(bar_window, pixel_layer) = pixel_layer.split_vertical_mut(TILE_SIZE).unwrap();
let label_window;
(label_window, text_layer) = text_layer.split_vertical_mut(1).unwrap();
row.draw(label_window, bar_window);
for (index, row) in self.state.rows.iter().enumerate() {
let mut bar_window = pixel_layer
.window_mut(.., index * TILE_SIZE..index * TILE_SIZE + TILE_SIZE)
.unwrap();
let mut label_window = text_layer.window_mut(.., index..index + 1).unwrap();
row.draw(&mut label_window, &mut bar_window);
}
}
}