1786015900

This commit is contained in:
2026-08-06 13:31:40 +02:00
parent 587bef4b1a
commit 90d9905f74

View File

@@ -45,6 +45,9 @@ impl Platform for Trekstor {
let mut buffer1 = [Rgba::from((0, 0, 0, 0)); 614400];
let window_width = ctx.screen.width();
let window_height = ctx.screen.height();
loop {
ctx.input.handle_event();
@@ -70,19 +73,19 @@ impl Platform for Trekstor {
self.window.draw_if_needed(|renderer| {
dbg!("Rendering");
renderer.render(&mut buffer1, ctx.screen.width() as usize);
renderer.render(&mut buffer1, window_width as usize);
for (i, px) in buffer1.into_iter().enumerate() {
if i > (ctx.screen.width() as usize - 1) {
if i > (window_width as usize - 1) {
break;
}
let x = (i % ctx.screen.width() as usize) as u32;
let y = (i / ctx.screen.width() as usize) as u32;
let x = (i % window_width as usize) as u32;
let y = (i / window_width as usize) as u32;
if x >= ctx.screen.width() || y >= ctx.screen.height() {
println!("Out of bounds {} {}", x, y);
continue;
}
// if x >= window_width || y >= window_height {
// println!("Out of bounds {} {}", x, y);
// continue;
// }
dbg!(x, y, px);