diff --git a/Cargo.lock b/Cargo.lock index 1882050..ca82124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1440,7 +1440,7 @@ dependencies = [ [[package]] name = "servicepoint" version = "0.13.2" -source = "git+https://git.berlin.ccc.de/servicepoint/servicepoint/?branch=next#114385868af03f8cba7c87a630b501bb0106d140" +source = "git+https://git.berlin.ccc.de/servicepoint/servicepoint/?branch=next#300bb5d6474f0f6152ab04feed4478995fcb3ec8" dependencies = [ "bitvec", "bzip2", diff --git a/Cargo.toml b/Cargo.toml index e6665d3..bcb3076 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,8 +31,3 @@ pathfinder_geometry = "0.5.1" winit = "0.30" # for drawing pixels onto the surface of the window softbuffer = "0.4.6" - -[profile.release] -lto = true # Enable link-time optimization -codegen-units = 1 # Reduce number of codegen units to increase optimizations -strip = true # Strip symbols from binary diff --git a/src/command_executor.rs b/src/command_executor.rs index f24a5fe..8ddeaab 100644 --- a/src/command_executor.rs +++ b/src/command_executor.rs @@ -5,7 +5,7 @@ use crate::{ }; use log::{debug, error, info, trace, warn}; use servicepoint::{ - BinaryOperation, BitVecCommand, Bitmap, BitmapCommand, GlobalBrightnessCommand, + BinaryOperation, BitVecCommand, Bitmap, BitmapCommand, BrightnessCommand, BrightnessGrid, BrightnessGridCommand, CharGridCommand, ClearCommand, CompressionCode, Cp437GridCommand, FadeOutCommand, Grid, HardResetCommand, Origin, TypedCommand, PIXEL_COUNT, PIXEL_WIDTH, TILE_SIZE, @@ -214,7 +214,7 @@ impl CommandExecute for CharGridCommand { } } -impl CommandExecute for GlobalBrightnessCommand { +impl CommandExecute for BrightnessCommand { fn execute(&self, context: &CommandExecutionContext) -> ExecutionResult { context.luma.write().unwrap().fill(self.brightness); Success diff --git a/src/cp437_font.rs b/src/cp437_font.rs index ac43508..73a3d95 100644 --- a/src/cp437_font.rs +++ b/src/cp437_font.rs @@ -16,9 +16,8 @@ impl Cp437Font { impl Default for Cp437Font { fn default() -> Self { - let mut bitmaps = core::array::from_fn(|_| { - Bitmap::new(TILE_SIZE, TILE_SIZE).unwrap() - }); + let mut bitmaps = + core::array::from_fn(|_| Bitmap::new(TILE_SIZE, TILE_SIZE).unwrap()); for (char_code, bitmap) in bitmaps.iter_mut().enumerate() { let bits = CP437_FONT_LINEAR[char_code]; diff --git a/src/main.rs b/src/main.rs index 06e0b28..dd7f3e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,11 +39,11 @@ fn main() { .font .map(FontRenderer8x8::from_name) .unwrap_or_else(FontRenderer8x8::default); - let context = CommandExecutionContext::new(&display, &luma, font_renderer); + let command_executor = CommandExecutionContext::new(&display, &luma, font_renderer); let mut udp_server = UdpServer::new( cli.bind, stop_udp_rx, - context, + command_executor, event_loop.create_proxy(), ); let mut gui = Gui::new(&display, &luma, stop_udp_tx, cli.gui); diff --git a/src/udp_server.rs b/src/udp_server.rs index 26c2510..b661067 100644 --- a/src/udp_server.rs +++ b/src/udp_server.rs @@ -10,7 +10,7 @@ use std::{ }; use winit::event_loop::EventLoopProxy; -const BUF_SIZE: usize = 8985 * 2; +const BUF_SIZE: usize = 8985; #[derive(Debug)] pub struct UdpServer<'t> {