mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-21 20:27:46 +00:00
Revert "Switch from bitfield-struct to modular-bitfield"
This reverts commit 3615adac47
.
This commit is contained in:
parent
744ba364a1
commit
0edbcfdf34
3 changed files with 24 additions and 35 deletions
40
Cargo.lock
generated
40
Cargo.lock
generated
|
@ -55,6 +55,17 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitfield-struct"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0baacb7d5b6e94369201d5807e086d3f36e2bd35057ca2c5a680af3737e35fa"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
|
@ -404,27 +415,6 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "modular-bitfield"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74"
|
||||
dependencies = [
|
||||
"modular-bitfield-impl",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "modular-bitfield-impl"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.15"
|
||||
|
@ -479,6 +469,7 @@ name = "physis"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"binrw",
|
||||
"bitfield-struct",
|
||||
"bitflags",
|
||||
"crc",
|
||||
"criterion",
|
||||
|
@ -487,7 +478,6 @@ dependencies = [
|
|||
"hard-xml",
|
||||
"hmac-sha512",
|
||||
"libz-sys",
|
||||
"modular-bitfield",
|
||||
"paste",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -645,12 +635,6 @@ version = "1.0.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.102"
|
||||
|
|
|
@ -35,7 +35,7 @@ binrw = "0.10"
|
|||
libz-sys = { version = "1.1", default-features = false }
|
||||
|
||||
# nice to have features rust is lacking at the moment
|
||||
modular-bitfield = "0.11"
|
||||
bitfield-struct = "0.1"
|
||||
paste = "1"
|
||||
|
||||
# needed for half-float support which FFXIV uses in it's model data
|
||||
|
|
17
src/index.rs
17
src/index.rs
|
@ -1,6 +1,6 @@
|
|||
use binrw::binrw;
|
||||
use binrw::BinRead;
|
||||
use modular_bitfield::prelude::*;
|
||||
use bitfield_struct::bitfield;
|
||||
use std::io::SeekFrom;
|
||||
|
||||
#[binrw]
|
||||
|
@ -31,13 +31,18 @@ pub struct SqPackIndexHeader {
|
|||
index_data_size: u32,
|
||||
}
|
||||
|
||||
#[bitfield]
|
||||
#[bitfield(u32)]
|
||||
#[binrw]
|
||||
#[br(map = Self::from_bytes)]
|
||||
#[br(map = | x: u32 | Self::from(x))]
|
||||
pub struct IndexHashBitfield {
|
||||
pub size: B1,
|
||||
pub data_file_id: B3,
|
||||
pub offset: B28,
|
||||
#[bits(1)]
|
||||
pub size: u32,
|
||||
|
||||
#[bits(3)]
|
||||
pub data_file_id: u32,
|
||||
|
||||
#[bits(28)]
|
||||
pub offset: u32,
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
|
|
Loading…
Add table
Reference in a new issue