update to servicepoint 0.5.0

This commit is contained in:
Vinzenz Schroeter 2024-05-26 15:24:44 +02:00
parent 5fff78506a
commit f32e83dffc
6 changed files with 14 additions and 14 deletions

View file

@ -1,7 +1,7 @@
use std::sync::{RwLock, RwLockWriteGuard};
use log::{debug, error, info, warn};
use servicepoint2::{
use servicepoint::{
ByteGrid, Command, Grid, Origin, PIXEL_COUNT, PIXEL_WIDTH, PixelGrid,
TILE_SIZE,
};
@ -44,7 +44,7 @@ pub(crate) fn execute_command(
let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() {
let (x, y) =
get_coordinates_for_index(offset as usize, bitmap_index);
get_coordinates_for_index(offset, bitmap_index);
display.set(x, y, vec.get(bitmap_index));
}
}
@ -55,7 +55,7 @@ pub(crate) fn execute_command(
let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() {
let (x, y) =
get_coordinates_for_index(offset as usize, bitmap_index);
get_coordinates_for_index(offset, bitmap_index);
let old_value = display.get(x, y);
display.set(x, y, old_value && vec.get(bitmap_index));
}
@ -67,7 +67,7 @@ pub(crate) fn execute_command(
let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() {
let (x, y) =
get_coordinates_for_index(offset as usize, bitmap_index);
get_coordinates_for_index(offset, bitmap_index);
let old_value = display.get(x, y);
display.set(x, y, old_value || vec.get(bitmap_index));
}
@ -79,7 +79,7 @@ pub(crate) fn execute_command(
let mut display = display_ref.write().unwrap();
for bitmap_index in 0..vec.len() {
let (x, y) =
get_coordinates_for_index(offset as usize, bitmap_index);
get_coordinates_for_index(offset, bitmap_index);
let old_value = display.get(x, y);
display.set(x, y, old_value ^ vec.get(bitmap_index));
}

View file

@ -5,7 +5,7 @@ use font_kit::font::Font;
use font_kit::hinting::HintingOptions;
use pathfinder_geometry::transform2d::Transform2F;
use pathfinder_geometry::vector::{vec2f, vec2i};
use servicepoint2::{Grid, PixelGrid, TILE_SIZE};
use servicepoint::{Grid, PixelGrid, TILE_SIZE};
const DEFAULT_FONT_FILE: &[u8] = include_bytes!("../Web437_IBM_BIOS.woff");

View file

@ -4,7 +4,7 @@ use std::sync::RwLock;
use log::{info, warn};
use pixels::wgpu::TextureFormat;
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
use servicepoint2::{ByteGrid, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH, TILE_SIZE, Grid};
use servicepoint::{ByteGrid, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH, TILE_SIZE, Grid};
use winit::application::ApplicationHandler;
use winit::dpi::LogicalSize;
use winit::event::WindowEvent;

View file

@ -7,7 +7,7 @@ use std::time::Duration;
use clap::Parser;
use log::{info, warn, LevelFilter};
use servicepoint2::{ByteGrid, Command, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH, TILE_HEIGHT, TILE_WIDTH, Grid};
use servicepoint::{ByteGrid, Command, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH, TILE_HEIGHT, TILE_WIDTH, Grid};
use winit::event_loop::{ControlFlow, EventLoop};
use crate::execute_command::execute_command;
@ -100,7 +100,7 @@ fn run(
);
}
let package = match servicepoint2::Packet::try_from(&buf[..amount]) {
let package = match servicepoint::Packet::try_from(&buf[..amount]) {
Err(_) => {
warn!("could not load packet with length {amount} into header");
continue;