mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-27 06:27:45 +00:00
Upgrade dependencies, including moving to binrw 0.11 which breaks stuff
The one exception is bitflags, because 2.0 has breaking changes I can't work around...
This commit is contained in:
parent
425f755850
commit
69c3ca3bf9
3 changed files with 16 additions and 26 deletions
|
@ -49,13 +49,13 @@ patch_testing = ["game_install"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# amazing binary parsing/writing library
|
# amazing binary parsing/writing library
|
||||||
binrw = "0.10"
|
binrw = "0.11.1"
|
||||||
|
|
||||||
# used for zlib compression in sqpack files
|
# used for zlib compression in sqpack files
|
||||||
libz-sys = { version = "1.1", default-features = false }
|
libz-sys = { version = "1.1", default-features = false }
|
||||||
|
|
||||||
# nice to have features rust is lacking at the moment
|
# nice to have features rust is lacking at the moment
|
||||||
bitfield-struct = "0.1"
|
bitfield-struct = "0.3.2"
|
||||||
paste = "1"
|
paste = "1"
|
||||||
|
|
||||||
# needed for half-float support which FFXIV uses in it's model data
|
# needed for half-float support which FFXIV uses in it's model data
|
||||||
|
@ -69,9 +69,10 @@ serde_json = { version = "1", optional = true }
|
||||||
serde = { version = "1", optional = true, features = ["derive"] }
|
serde = { version = "1", optional = true, features = ["derive"] }
|
||||||
|
|
||||||
# needed for deconstructing skeleton pose matrices
|
# needed for deconstructing skeleton pose matrices
|
||||||
glam = { version = "0.22", optional = true }
|
glam = { version = "0.23.0", optional = true }
|
||||||
|
|
||||||
# needed for c-style bitflags used in some formats (such as tex files)
|
# needed for c-style bitflags used in some formats (such as tex files)
|
||||||
|
# cannot upgrade to 2.0.0, breaking changes that aren't recoverable: https://github.com/bitflags/bitflags/issues/314
|
||||||
bitflags = { version = "1.3", optional = true }
|
bitflags = { version = "1.3", optional = true }
|
||||||
|
|
||||||
# needed for dxt/bc decompression
|
# needed for dxt/bc decompression
|
||||||
|
|
25
src/dat.rs
25
src/dat.rs
|
@ -39,15 +39,13 @@ struct TextureLodBlock {
|
||||||
block_count: u32,
|
block_count: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[binrw]
|
pub trait AnyNumberType<'a>: BinRead<Args<'a> = ()> + BinWrite<Args<'a> = ()> + std::ops::AddAssign + Copy + Default + 'static {}
|
||||||
pub struct ModelMemorySizes<
|
|
||||||
T: 'static
|
impl<'a, T> AnyNumberType<'a> for T where T: BinRead<Args<'a> = ()> + BinWrite<Args<'a> = ()> + std::ops::AddAssign + Copy + Default + 'static {}
|
||||||
+ binrw::BinRead<Args = ()>
|
|
||||||
+ binrw::BinWrite<Args = ()>
|
#[derive(BinRead, BinWrite)]
|
||||||
+ Default
|
pub struct ModelMemorySizes<T: for <'a> AnyNumberType<'a>>
|
||||||
+ std::ops::AddAssign
|
{
|
||||||
+ Copy,
|
|
||||||
> {
|
|
||||||
pub stack_size: T,
|
pub stack_size: T,
|
||||||
pub runtime_size: T,
|
pub runtime_size: T,
|
||||||
|
|
||||||
|
@ -56,14 +54,7 @@ pub struct ModelMemorySizes<
|
||||||
pub index_buffer_size: [T; 3],
|
pub index_buffer_size: [T; 3],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<T: for<'a> AnyNumberType<'a>> ModelMemorySizes<T>
|
||||||
T: 'static
|
|
||||||
+ binrw::BinRead<Args = ()>
|
|
||||||
+ binrw::BinWrite<Args = ()>
|
|
||||||
+ Default
|
|
||||||
+ std::ops::AddAssign
|
|
||||||
+ Copy,
|
|
||||||
> ModelMemorySizes<T>
|
|
||||||
{
|
{
|
||||||
pub fn total(&self) -> T {
|
pub fn total(&self) -> T {
|
||||||
let mut total: T = T::default();
|
let mut total: T = T::default();
|
||||||
|
|
10
src/exd.rs
10
src/exd.rs
|
@ -2,7 +2,7 @@ use crate::common::Language;
|
||||||
use crate::exh::{ColumnDataType, ExcelColumnDefinition, ExcelDataPagination, EXH};
|
use crate::exh::{ColumnDataType, ExcelColumnDefinition, ExcelDataPagination, EXH};
|
||||||
use crate::gamedata::MemoryBuffer;
|
use crate::gamedata::MemoryBuffer;
|
||||||
use binrw::binrw;
|
use binrw::binrw;
|
||||||
use binrw::{BinRead, Endian, ReadOptions};
|
use binrw::{BinRead, Endian};
|
||||||
use std::io::{Cursor, Seek, SeekFrom};
|
use std::io::{Cursor, Seek, SeekFrom};
|
||||||
|
|
||||||
#[binrw]
|
#[binrw]
|
||||||
|
@ -65,15 +65,13 @@ pub struct ExcelRow {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EXD {
|
impl EXD {
|
||||||
fn read_data_raw<Z: BinRead>(cursor: &mut Cursor<&MemoryBuffer>) -> Option<Z>
|
fn read_data_raw<Z: BinRead<Args<'static> = ()>>(cursor: &mut Cursor<&MemoryBuffer>) -> Option<Z>
|
||||||
where
|
|
||||||
<Z as BinRead>::Args: Default,
|
|
||||||
{
|
{
|
||||||
Some(
|
Some(
|
||||||
Z::read_options(
|
Z::read_options(
|
||||||
cursor,
|
cursor,
|
||||||
&ReadOptions::new(Endian::Big),
|
Endian::Big,
|
||||||
<Z as BinRead>::Args::default(),
|
(),
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue