fix BitmapLinear* Commands

This commit is contained in:
Vinzenz Schroeter 2024-05-11 17:53:23 +02:00
parent 69c07dd733
commit 8cf03c8f07

View file

@ -133,8 +133,8 @@ fn handle_package(
let mut display = display_ref.write().unwrap(); let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() { for bitmap_index in 0..vec.len() {
let pixel_index = offset as usize + bitmap_index; let pixel_index = offset as usize + bitmap_index;
let y = pixel_index / TILE_WIDTH as usize; let y = pixel_index / PIXEL_WIDTH as usize;
let x = pixel_index % TILE_SIZE as usize; let x = pixel_index % PIXEL_WIDTH as usize;
display.set(x, y, vec.get(bitmap_index)); display.set(x, y, vec.get(bitmap_index));
} }
} }
@ -142,8 +142,8 @@ fn handle_package(
let mut display = display_ref.write().unwrap(); let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() { for bitmap_index in 0..vec.len() {
let pixel_index = offset as usize + bitmap_index; let pixel_index = offset as usize + bitmap_index;
let y = pixel_index / TILE_WIDTH as usize; let y = pixel_index / PIXEL_WIDTH as usize;
let x = pixel_index % TILE_SIZE as usize; let x = pixel_index % PIXEL_WIDTH as usize;
let old_value = display.get(x, y); let old_value = display.get(x, y);
display.set(x, y, old_value && vec.get(bitmap_index)); display.set(x, y, old_value && vec.get(bitmap_index));
} }
@ -152,8 +152,8 @@ fn handle_package(
let mut display = display_ref.write().unwrap(); let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() { for bitmap_index in 0..vec.len() {
let pixel_index = offset as usize + bitmap_index; let pixel_index = offset as usize + bitmap_index;
let y = pixel_index / TILE_WIDTH as usize; let y = pixel_index / PIXEL_WIDTH as usize;
let x = pixel_index % TILE_SIZE as usize; let x = pixel_index % PIXEL_WIDTH as usize;
let old_value = display.get(x, y); let old_value = display.get(x, y);
display.set(x, y, old_value || vec.get(bitmap_index)); display.set(x, y, old_value || vec.get(bitmap_index));
} }
@ -162,8 +162,8 @@ fn handle_package(
let mut display = display_ref.write().unwrap(); let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() { for bitmap_index in 0..vec.len() {
let pixel_index = offset as usize + bitmap_index; let pixel_index = offset as usize + bitmap_index;
let y = pixel_index / TILE_WIDTH as usize; let y = pixel_index / PIXEL_WIDTH as usize;
let x = pixel_index % TILE_SIZE as usize; let x = pixel_index % PIXEL_WIDTH as usize;
let old_value = display.get(x, y); let old_value = display.get(x, y);
display.set(x, y, old_value ^ vec.get(bitmap_index)); display.set(x, y, old_value ^ vec.get(bitmap_index));
} }