1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-26 14:17: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:
Joshua Goins 2023-03-31 17:29:53 -04:00
parent 425f755850
commit 69c3ca3bf9
3 changed files with 16 additions and 26 deletions

View file

@ -49,13 +49,13 @@ patch_testing = ["game_install"]
[dependencies]
# amazing binary parsing/writing library
binrw = "0.10"
binrw = "0.11.1"
# used for zlib compression in sqpack files
libz-sys = { version = "1.1", default-features = false }
# nice to have features rust is lacking at the moment
bitfield-struct = "0.1"
bitfield-struct = "0.3.2"
paste = "1"
# 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"] }
# 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)
# 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 }
# needed for dxt/bc decompression

View file

@ -39,15 +39,13 @@ struct TextureLodBlock {
block_count: u32,
}
#[binrw]
pub struct ModelMemorySizes<
T: 'static
+ binrw::BinRead<Args = ()>
+ binrw::BinWrite<Args = ()>
+ Default
+ std::ops::AddAssign
+ Copy,
> {
pub trait AnyNumberType<'a>: BinRead<Args<'a> = ()> + BinWrite<Args<'a> = ()> + std::ops::AddAssign + Copy + Default + 'static {}
impl<'a, T> AnyNumberType<'a> for T where T: BinRead<Args<'a> = ()> + BinWrite<Args<'a> = ()> + std::ops::AddAssign + Copy + Default + 'static {}
#[derive(BinRead, BinWrite)]
pub struct ModelMemorySizes<T: for <'a> AnyNumberType<'a>>
{
pub stack_size: T,
pub runtime_size: T,
@ -56,14 +54,7 @@ pub struct ModelMemorySizes<
pub index_buffer_size: [T; 3],
}
impl<
T: 'static
+ binrw::BinRead<Args = ()>
+ binrw::BinWrite<Args = ()>
+ Default
+ std::ops::AddAssign
+ Copy,
> ModelMemorySizes<T>
impl<T: for<'a> AnyNumberType<'a>> ModelMemorySizes<T>
{
pub fn total(&self) -> T {
let mut total: T = T::default();

View file

@ -2,7 +2,7 @@ use crate::common::Language;
use crate::exh::{ColumnDataType, ExcelColumnDefinition, ExcelDataPagination, EXH};
use crate::gamedata::MemoryBuffer;
use binrw::binrw;
use binrw::{BinRead, Endian, ReadOptions};
use binrw::{BinRead, Endian};
use std::io::{Cursor, Seek, SeekFrom};
#[binrw]
@ -65,15 +65,13 @@ pub struct ExcelRow {
}
impl EXD {
fn read_data_raw<Z: BinRead>(cursor: &mut Cursor<&MemoryBuffer>) -> Option<Z>
where
<Z as BinRead>::Args: Default,
fn read_data_raw<Z: BinRead<Args<'static> = ()>>(cursor: &mut Cursor<&MemoryBuffer>) -> Option<Z>
{
Some(
Z::read_options(
cursor,
&ReadOptions::new(Endian::Big),
<Z as BinRead>::Args::default(),
Endian::Big,
(),
)
.unwrap(),
)