diff --git a/Cargo.lock b/Cargo.lock index ca82124..1882050 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#300bb5d6474f0f6152ab04feed4478995fcb3ec8" +source = "git+https://git.berlin.ccc.de/servicepoint/servicepoint/?branch=next#114385868af03f8cba7c87a630b501bb0106d140" dependencies = [ "bitvec", "bzip2", diff --git a/Cargo.toml b/Cargo.toml index bcb3076..e6665d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,3 +31,8 @@ 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 8ddeaab..f24a5fe 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, BrightnessCommand, + BinaryOperation, BitVecCommand, Bitmap, BitmapCommand, GlobalBrightnessCommand, 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 BrightnessCommand { +impl CommandExecute for GlobalBrightnessCommand { 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 73a3d95..ac43508 100644 --- a/src/cp437_font.rs +++ b/src/cp437_font.rs @@ -16,8 +16,9 @@ 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 dd7f3e8..06e0b28 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 command_executor = CommandExecutionContext::new(&display, &luma, font_renderer); + let context = CommandExecutionContext::new(&display, &luma, font_renderer); let mut udp_server = UdpServer::new( cli.bind, stop_udp_rx, - command_executor, + context, event_loop.create_proxy(), ); let mut gui = Gui::new(&display, &luma, stop_udp_tx, cli.gui);