Upgraded dependencies, reduced binary sizes

This commit is contained in:
G2-Games 2024-11-14 02:11:39 -06:00
parent 2f881ce294
commit a7a486999d
9 changed files with 31 additions and 34 deletions

View file

@ -10,9 +10,9 @@ license = "MIT"
authors.workspace = true authors.workspace = true
[dependencies] [dependencies]
byteorder = "1.5.0" byteorder-lite = "0.1"
log = "0.4.22" log = "0.4"
thiserror = "1.0.61" thiserror = "2.0"
[lints] [lints]
workspace = true workspace = true

View file

@ -1,4 +1,4 @@
use byteorder::WriteBytesExt; use byteorder_lite::WriteBytesExt;
use std::io::{self, Write}; use std::io::{self, Write};
use crate::LE; use crate::LE;

View file

@ -1,7 +1,7 @@
pub mod entry; pub mod entry;
pub mod header; pub mod header;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use byteorder_lite::{LE, ReadBytesExt, WriteBytesExt};
use header::Header; use header::Header;
use log::{debug, info}; use log::{debug, info};
use std::{ use std::{
@ -12,8 +12,6 @@ use std::{
}; };
use thiserror::Error; use thiserror::Error;
type LE = LittleEndian;
use crate::{entry::Entry, header::PakFlags}; use crate::{entry::Entry, header::PakFlags};
/// An error associated with a PAK file /// An error associated with a PAK file

View file

@ -12,12 +12,12 @@ publish = false
[dependencies] [dependencies]
colog = "1.3.0" colog = "1.3.0"
cz = { path = "../cz/" } cz = { path = "../cz/" }
eframe = { version = "0.28.1", default-features = false, features = ["wayland", "x11", "accesskit", "default_fonts", "wgpu"] } eframe = { version = "0.29", default-features = false, features = ["wayland", "x11", "accesskit", "default_fonts", "wgpu"] }
egui_extras = "0.28.1" egui_extras = "0.29"
image = { version = "0.25.5", default-features = false, features = ["png"] } image = { version = "0.25", default-features = false, features = ["png"] }
log = "0.4.22" log = "0.4.22"
luca_pak = { path = "../luca_pak/" } luca_pak = { path = "../luca_pak/" }
rfd = "0.14.1" rfd = "0.15"
[lints] [lints]
workspace = true workspace = true

View file

@ -1,7 +1,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
use colog; use colog;
use eframe::egui::{self, ColorImage, Image, TextureFilter, TextureHandle, TextureOptions}; use eframe::egui::{self, ColorImage, Image, TextureFilter, TextureHandle, TextureOptions, ThemePreference};
use log::error; use log::error;
use luca_pak::{entry::EntryType, Pak}; use luca_pak::{entry::EntryType, Pak};
use std::fs; use std::fs;
@ -13,7 +13,6 @@ fn main() -> eframe::Result {
let options = eframe::NativeOptions { let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default().with_inner_size([1024.0, 800.0]), viewport: egui::ViewportBuilder::default().with_inner_size([1024.0, 800.0]),
follow_system_theme: true,
..Default::default() ..Default::default()
}; };
@ -31,7 +30,6 @@ fn main() -> eframe::Result {
struct PakExplorer { struct PakExplorer {
open_file: Option<Pak>, open_file: Option<Pak>,
selected_entry: Option<luca_pak::entry::Entry>, selected_entry: Option<luca_pak::entry::Entry>,
entry_text: String,
image_texture: Option<egui::TextureHandle>, image_texture: Option<egui::TextureHandle>,
hex_string: Option<Vec<String>>, hex_string: Option<Vec<String>>,
} }
@ -43,7 +41,6 @@ impl Default for PakExplorer {
selected_entry: None, selected_entry: None,
image_texture: None, image_texture: None,
hex_string: None, hex_string: None,
entry_text: String::new(),
} }
} }
} }
@ -52,6 +49,7 @@ impl eframe::App for PakExplorer {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| { egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("PAK File Explorer"); ui.heading("PAK File Explorer");
ctx.options_mut(|o| o.theme_preference = ThemePreference::System);
ui.horizontal(|ui| { ui.horizontal(|ui| {
if ui.button("Open file").clicked() { if ui.button("Open file").clicked() {

View file

@ -1,6 +1,6 @@
[package] [package]
name = "utils" name = "lbee-utils"
version = "0.2.0" version = "0.2.1"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
authors.workspace = true authors.workspace = true
@ -15,9 +15,9 @@ name = "pakutil"
[dependencies] [dependencies]
cz = { path = "../cz/" } cz = { path = "../cz/" }
luca_pak = { path = "../luca_pak/" } luca_pak = { path = "../luca_pak/" }
image = { version = "0.25", default-features = false, features = ["png"] } image = { version = "0.25", default-features = false, features = ["png"] }
clap = { version = "4.5", features = ["derive", "error-context"] } clap = { version = "4.5", features = ["derive", "error-context"] }
owo-colors = "4.1"
[build-dependencies] [build-dependencies]
vergen-gix = { version = "1.0", features = ["build", "cargo", "rustc", "si"] } vergen-gix = { version = "1.0", features = ["build", "cargo", "rustc", "si"] }

View file

@ -1,5 +1,6 @@
use clap::{error::ErrorKind, Error, Parser, Subcommand}; use clap::{error::ErrorKind, Error, Parser, Subcommand};
use image::ColorType; use image::ColorType;
use lbee_utils::version;
use std::{ use std::{
fs, fs,
path::{Path, PathBuf}, path::{Path, PathBuf},
@ -71,14 +72,7 @@ fn main() {
let cli = Cli::parse(); let cli = Cli::parse();
if cli.version { if cli.version {
println!( println!("{}", version(env!("CARGO_BIN_NAME")));
"{}, {} v{}-{} ({})",
env!("CARGO_BIN_NAME"),
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION"),
&env!("VERGEN_GIT_SHA")[0..=6],
env!("VERGEN_GIT_COMMIT_DATE"),
);
exit(0); exit(0);
} }

View file

@ -3,6 +3,7 @@ use clap::{
Parser, Subcommand, Parser, Subcommand,
}; };
use luca_pak::Pak; use luca_pak::Pak;
use lbee_utils::version;
use std::{fs, path::PathBuf, process::exit}; use std::{fs, path::PathBuf, process::exit};
/// Utility to maniuplate PAK archive files from the LUCA System game engine by /// Utility to maniuplate PAK archive files from the LUCA System game engine by
@ -10,6 +11,7 @@ use std::{fs, path::PathBuf, process::exit};
#[derive(Parser)] #[derive(Parser)]
#[command(name = "PAK Utility")] #[command(name = "PAK Utility")]
#[command(author, version, about, long_about = None, disable_version_flag = true)] #[command(author, version, about, long_about = None, disable_version_flag = true)]
#[command(arg_required_else_help(true))]
struct Cli { struct Cli {
/// Show program version information /// Show program version information
#[arg(short('V'), long)] #[arg(short('V'), long)]
@ -64,14 +66,7 @@ fn main() {
let cli = Cli::parse(); let cli = Cli::parse();
if cli.version { if cli.version {
println!( println!("{}", version(env!("CARGO_BIN_NAME")));
"{}, {} v{}-{} ({})",
env!("CARGO_BIN_NAME"),
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION"),
&env!("VERGEN_GIT_SHA")[0..=6],
env!("VERGEN_GIT_COMMIT_DATE"),
);
exit(0); exit(0);
} }

12
utils/src/lib.rs Normal file
View file

@ -0,0 +1,12 @@
use owo_colors::OwoColorize;
pub fn version(bin_name: &str) -> String {
format!(
"{}, {} v{} ({}, {})",
bin_name,
env!("CARGO_PKG_NAME").cyan(),
env!("CARGO_PKG_VERSION").blue(),
(&env!("VERGEN_GIT_SHA")[0..=6]).green(),
env!("VERGEN_GIT_COMMIT_DATE").green(),
)
}