Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,703 changes: 2,628 additions & 75 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions file-formats/archives/wow-mpq/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
5 changes: 4 additions & 1 deletion file-formats/archives/wow-mpq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ implode = "0.1.1"

# Data structures and utilities
bytes = "1.10"
rand = "0.9"
byteorder = "1.5"
rand = { workspace = true }
tempfile = { workspace = true }

# Parallel processing
Expand All @@ -50,6 +50,9 @@ directories = "5.0"
chrono = "0.4"
glob = "0.3"

[target.'cfg(feature = "target_wasm32")'.build-dependencies]
# remove os_rng feature for wasm32-unknown-unknown
rand = { version = "0.9", default-features = false, features = ["std", "std_rng", "small_rng", "thread_rng"] }

[dev-dependencies]
criterion = { workspace = true }
Expand Down
249 changes: 201 additions & 48 deletions file-formats/archives/wow-mpq/src/archive.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion file-formats/archives/wow-mpq/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub fn normalize_mpq_path(path: &str) -> String {
/// assert_eq!(mpq_path_to_system("dir\\file.txt"), "dir\\file.txt");
/// ```
pub fn mpq_path_to_system(path: &str) -> String {
#[cfg(unix)]
#[cfg(any(unix, target_arch = "wasm32"))]
{
path.replace('\\', "/")
}
Expand Down
1 change: 0 additions & 1 deletion file-formats/archives/wow-mpq/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//! The [`wow_data`] module provides utilities for locating World of Warcraft
//! game data directories across different versions and platforms, making
//! examples portable and independent of hardcoded paths.

pub mod data_generator;
pub mod mpq_builder;
pub mod wow_data;
Expand Down
96 changes: 96 additions & 0 deletions flake.lock

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

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "OpenSCBW";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
openssl
pkg-config
(
rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
targets = ["wasm32-unknown-unknown"];
extensions = [
"rust-src"
"rust-analyzer"
];
})
)
];
};
}
);
}