From f32e83dffc7cbeb4beaabc396a50e226d982b8ae Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 May 2024 15:24:44 +0200 Subject: [PATCH] update to servicepoint 0.5.0 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/execute_command.rs | 10 +++++----- src/font.rs | 2 +- src/gui.rs | 2 +- src/main.rs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1d5db7c..448f3b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1338,7 +1338,7 @@ dependencies = [ "log", "pathfinder_geometry", "pixels", - "servicepoint2", + "servicepoint", "winit", ] @@ -1621,10 +1621,10 @@ dependencies = [ ] [[package]] -name = "servicepoint2" -version = "0.4.2" +name = "servicepoint" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d9aecc4d31a71578481de6c6d64383d374126c38469c9689067579c1d910fd" +checksum = "85be013633ecfdf39be44b39f2417d3d8a58d3ca387cdfc03372c5840748f227" dependencies = [ "bzip2", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 74bfa8f..6825a7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0-or-later" [dependencies] # packet parsing -servicepoint2 = { version = "0.4.2", features = ["all_compressions"] } +servicepoint = { version = "0.5.0", features = ["all_compressions"] } # gui winit = { version = "0.30", features = ["rwh_05"] } # for creating a window diff --git a/src/execute_command.rs b/src/execute_command.rs index 4f7f364..65f5ea8 100644 --- a/src/execute_command.rs +++ b/src/execute_command.rs @@ -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)); } diff --git a/src/font.rs b/src/font.rs index b56ed59..cc7657d 100644 --- a/src/font.rs +++ b/src/font.rs @@ -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"); diff --git a/src/gui.rs b/src/gui.rs index cedd361..91991e3 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -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; diff --git a/src/main.rs b/src/main.rs index d6d07b1..3740481 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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;