Skip to content

Commit

Permalink
Merge branch 'master' into egui
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzart committed Oct 24, 2023
2 parents ad3a23b + 3fe3504 commit 644650b
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 50 deletions.
74 changes: 34 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ BigFile Friend
[![Release Nightly](https://img.shields.io/badge/release-nightly-5e025f?labelColor=301934)](https://nightly.link/widberg/bff/workflows/build/master)
[![Join the chat at https://discord.gg/CQgMNbYeUR](https://img.shields.io/badge/chat-on_discord-7389D8.svg?logo=discord&logoColor=ffffff&labelColor=6A7EC2)](https://discord.gg/CQgMNbYeUR)

A GUI/CLI utility to work with Zouna BigFiles.
The Zouna Swiss Army knife. Originally names BigFile Friend for Zouna's resource archives, now it supports far more than just BigFiles.

<sup>This repository is a relative of the main [FMTK repository](https://github.com/widberg/fmtk).</sup>

## Support

A ✔ indicates that the game has been tested and is working. An ❌ indicates that the game has not been tested or is not working.
A ✔ indicates that the format has been tested and is working. An ❌ indicates that the format has not been tested or is not working.

### BigFile

| Year | Game | Platform | Version | Format | Status |
|------|---------------------------------------------------------------------------------|----------|---------|---------|--------|
Expand Down Expand Up @@ -51,6 +53,28 @@ A ✔ indicates that the game has been tested and is working. An ❌ indicates t
| 2020 | Microsoft Flight Simulator - Asobo | | | Asobo5 ||
| 2022 | A Plague Tale: Requiem - Asobo | | | Asobo5 ||

### TSC

| Format | Status |
|--------|--------|
| csc ||
| psc ||

### Audio

| Format | Status |
|---------|--------|
| SoundBF ||
| AIF ||
| JOE ||
| VAI ||

### Archive

| Format | Status |
|---------|--------|
| FAT+LIN ||

## Patterns

The [ImZouna](https://github.com/widberg/ImZouna) and [zouna-templates-docs](https://github.com/SabeMP/zouna-templates-docs) repositories have binary patterns for Zouna data structures.
Expand Down
2 changes: 1 addition & 1 deletion bff/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl-trait-for-tuples = "0.2.2"
indexmap = { version = "2.0.0", features = ["serde"] }
itertools = { version = "0.11.0", features = [] }
lz4 = "1.24.0"
minilzo-rs = "0.6.0"
minilzo3 = "0.1.0"
num-traits = "0.2.15"
once_cell = { version = "1.18.0", features = [] }
rayon = { version = "1.8.0", features = [] }
Expand Down
2 changes: 1 addition & 1 deletion bff/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ pub enum Error {
UnimplementedClass(UnimplementedClassError),
UnimplementedVersionPlatform(UnimplementedVersionPlatformError),
Utf8(std::string::FromUtf8Error),
MiniLzo(minilzo_rs::Error),
MiniLzo3(minilzo3::Error),
}
12 changes: 6 additions & 6 deletions bff/src/lz/lzo.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
use std::io::{Read, Write};

use binrw::Endian;
use minilzo_rs::LZO;
use minilzo3::{compress, decompress};

use crate::BffResult;

pub fn lzo_compress<W: Write>(data: &[u8], writer: &mut W, _endian: Endian) -> BffResult<()> {
let mut lzo = LZO::init()?;
let compressed = lzo.compress(data)?;
let mut compressed = vec![0; 0x00105800];
compress(&data, &mut compressed, false)?;
writer.write_all(&compressed)?;
Ok(())
}

pub fn lzo_decompress<R: Read>(reader: &mut R, _endian: Endian) -> BffResult<Vec<u8>> {
let lzo = LZO::init()?;
let mut compressed: Vec<u8> = Vec::new();
let mut compressed = Vec::new();
reader.read_to_end(&mut compressed)?;
let decompressed = lzo.decompress_safe(&compressed, 0x1000000)?;
let mut decompressed = vec![0; 0x00105800];
let _decompressed_length = decompress(&compressed, &mut decompressed)?;
Ok(decompressed)
}

0 comments on commit 644650b

Please sign in to comment.