diff --git a/Cargo.toml b/Cargo.toml index eb74fc0..d537ecf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,13 @@ icy_engine_egui = { git ="https://github.com/mkrueger/icy_engine_egui" } github_release_check = "0.2.1" semver = "1.0.20" +[profile.release] +opt-level = 'z' # Optimize for size +lto = true # Enable link-time optimization +codegen-units = 1 # Reduce number of codegen units to increase optimizations +panic = 'abort' # Abort on panic +strip = true # Strip symbols from binary* + [build-dependencies] winres = "0.1" diff --git a/view_library/src/ui/mod.rs b/view_library/src/ui/mod.rs index 33465b3..898f6c4 100644 --- a/view_library/src/ui/mod.rs +++ b/view_library/src/ui/mod.rs @@ -5,7 +5,7 @@ use eframe::{ }; use i18n_embed_fl::fl; -use icy_engine::{ansi, parse_with_parser, rip, Buffer}; +use icy_engine::{parse_with_parser, rip, Buffer}; use icy_engine_egui::{animations::Animator, BufferView, MonitorSettings}; use std::{ @@ -516,15 +516,17 @@ impl<'a> MainWindow<'a> { } if ext == "rip" { + match entry.get_data(|_path, data| { - let mut rip_parser = rip::Parser::new(Box::new(ansi::Parser::default()), PathBuf::new()); - + let mut rip_parser = rip::Parser::new(Box::default(), PathBuf::new()); let mut result: Buffer = Buffer::new((80, 25)); result.is_terminal_buffer = false; + let (text, is_unicode) = icy_engine::convert_ansi_to_utf8(data); if is_unicode { result.buffer_type = icy_engine::BufferType::Unicode; } + match parse_with_parser(&mut result, &mut rip_parser, &text, true) { Ok(_) => rip_parser, Err(err) => {