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

8
Cargo.lock generated
View file

@ -1338,7 +1338,7 @@ dependencies = [
"log", "log",
"pathfinder_geometry", "pathfinder_geometry",
"pixels", "pixels",
"servicepoint2", "servicepoint",
"winit", "winit",
] ]
@ -1621,10 +1621,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "servicepoint2" name = "servicepoint"
version = "0.4.2" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94d9aecc4d31a71578481de6c6d64383d374126c38469c9689067579c1d910fd" checksum = "85be013633ecfdf39be44b39f2417d3d8a58d3ca387cdfc03372c5840748f227"
dependencies = [ dependencies = [
"bzip2", "bzip2",
"flate2", "flate2",

View file

@ -7,7 +7,7 @@ license = "GPL-3.0-or-later"
[dependencies] [dependencies]
# packet parsing # packet parsing
servicepoint2 = { version = "0.4.2", features = ["all_compressions"] } servicepoint = { version = "0.5.0", features = ["all_compressions"] }
# gui # gui
winit = { version = "0.30", features = ["rwh_05"] } # for creating a window winit = { version = "0.30", features = ["rwh_05"] } # for creating a window

View file

@ -1,7 +1,7 @@
use std::sync::{RwLock, RwLockWriteGuard}; use std::sync::{RwLock, RwLockWriteGuard};
use log::{debug, error, info, warn}; use log::{debug, error, info, warn};
use servicepoint2::{ use servicepoint::{
ByteGrid, Command, Grid, Origin, PIXEL_COUNT, PIXEL_WIDTH, PixelGrid, ByteGrid, Command, Grid, Origin, PIXEL_COUNT, PIXEL_WIDTH, PixelGrid,
TILE_SIZE, TILE_SIZE,
}; };
@ -44,7 +44,7 @@ pub(crate) fn execute_command(
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 (x, y) = 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)); display.set(x, y, vec.get(bitmap_index));
} }
} }
@ -55,7 +55,7 @@ pub(crate) fn execute_command(
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 (x, y) = 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); 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));
} }
@ -67,7 +67,7 @@ pub(crate) fn execute_command(
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 (x, y) = 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); 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));
} }
@ -79,7 +79,7 @@ pub(crate) fn execute_command(
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 (x, y) = 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); 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));
} }

View file

@ -5,7 +5,7 @@ use font_kit::font::Font;
use font_kit::hinting::HintingOptions; use font_kit::hinting::HintingOptions;
use pathfinder_geometry::transform2d::Transform2F; use pathfinder_geometry::transform2d::Transform2F;
use pathfinder_geometry::vector::{vec2f, vec2i}; 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"); 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 log::{info, warn};
use pixels::wgpu::TextureFormat; use pixels::wgpu::TextureFormat;
use pixels::{Pixels, PixelsBuilder, SurfaceTexture}; 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::application::ApplicationHandler;
use winit::dpi::LogicalSize; use winit::dpi::LogicalSize;
use winit::event::WindowEvent; use winit::event::WindowEvent;

View file

@ -7,7 +7,7 @@ use std::time::Duration;
use clap::Parser; use clap::Parser;
use log::{info, warn, LevelFilter}; 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 winit::event_loop::{ControlFlow, EventLoop};
use crate::execute_command::execute_command; 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(_) => { Err(_) => {
warn!("could not load packet with length {amount} into header"); warn!("could not load packet with length {amount} into header");
continue; continue;