Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Optimize release output.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Mar 26, 2024
1 parent 351f98a commit 1e65f63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
8 changes: 5 additions & 3 deletions view_library/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 1e65f63

Please sign in to comment.