mirror of
https://github.com/kaesaecracker/servicepoint-simulator.git
synced 2025-01-18 02:20:14 +01:00
fix BitmapLinear* Commands
This commit is contained in:
parent
69c07dd733
commit
8cf03c8f07
16
src/main.rs
16
src/main.rs
|
@ -133,8 +133,8 @@ fn handle_package(
|
|||
let mut display = display_ref.write().unwrap();
|
||||
for bitmap_index in 0..vec.len() {
|
||||
let pixel_index = offset as usize + bitmap_index;
|
||||
let y = pixel_index / TILE_WIDTH as usize;
|
||||
let x = pixel_index % TILE_SIZE as usize;
|
||||
let y = pixel_index / PIXEL_WIDTH as usize;
|
||||
let x = pixel_index % PIXEL_WIDTH as usize;
|
||||
display.set(x, y, vec.get(bitmap_index));
|
||||
}
|
||||
}
|
||||
|
@ -142,8 +142,8 @@ fn handle_package(
|
|||
let mut display = display_ref.write().unwrap();
|
||||
for bitmap_index in 0..vec.len() {
|
||||
let pixel_index = offset as usize + bitmap_index;
|
||||
let y = pixel_index / TILE_WIDTH as usize;
|
||||
let x = pixel_index % TILE_SIZE as usize;
|
||||
let y = pixel_index / PIXEL_WIDTH as usize;
|
||||
let x = pixel_index % PIXEL_WIDTH as usize;
|
||||
let old_value = display.get(x, y);
|
||||
display.set(x, y, old_value && vec.get(bitmap_index));
|
||||
}
|
||||
|
@ -152,8 +152,8 @@ fn handle_package(
|
|||
let mut display = display_ref.write().unwrap();
|
||||
for bitmap_index in 0..vec.len() {
|
||||
let pixel_index = offset as usize + bitmap_index;
|
||||
let y = pixel_index / TILE_WIDTH as usize;
|
||||
let x = pixel_index % TILE_SIZE as usize;
|
||||
let y = pixel_index / PIXEL_WIDTH as usize;
|
||||
let x = pixel_index % PIXEL_WIDTH as usize;
|
||||
let old_value = display.get(x, y);
|
||||
display.set(x, y, old_value || vec.get(bitmap_index));
|
||||
}
|
||||
|
@ -162,8 +162,8 @@ fn handle_package(
|
|||
let mut display = display_ref.write().unwrap();
|
||||
for bitmap_index in 0..vec.len() {
|
||||
let pixel_index = offset as usize + bitmap_index;
|
||||
let y = pixel_index / TILE_WIDTH as usize;
|
||||
let x = pixel_index % TILE_SIZE as usize;
|
||||
let y = pixel_index / PIXEL_WIDTH as usize;
|
||||
let x = pixel_index % PIXEL_WIDTH as usize;
|
||||
let old_value = display.get(x, y);
|
||||
display.set(x, y, old_value ^ vec.get(bitmap_index));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue