1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-24 21:37:46 +00:00

Oops, apparently index and patch platform id sizes are different!

This commit is contained in:
Joshua Goins 2022-08-09 22:37:40 -04:00
parent 2784935409
commit 22569cf09d
3 changed files with 28 additions and 19 deletions

View file

@ -37,23 +37,6 @@ pub fn get_language_code(lang: &Language) -> &'static str {
}
}
#[binrw]
#[brw(repr = u16)]
#[derive(Debug, PartialEq)]
pub enum PlatformId {
Windows,
PS3,
PS4,
}
pub fn get_platform_string(id: &PlatformId) -> &'static str {
match &id {
PlatformId::Windows => "win32",
PlatformId::PS3 => "ps3", // TODO: lol are these even correct? i have no idea
PlatformId::PS4 => "ps4"
}
}
#[binrw]
#[brw(repr = i16)]
#[derive(Debug, PartialEq)]

View file

@ -2,7 +2,15 @@ use std::io::SeekFrom;
use binrw::binrw;
use binrw::BinRead;
use bitfield_struct::bitfield;
use crate::common::PlatformId;
#[binrw]
#[brw(repr = u8)]
#[derive(Debug, PartialEq)]
enum PlatformId {
Windows,
PS3,
PS4,
}
#[binrw]
#[br(magic = b"SqPack")]

View file

@ -3,10 +3,11 @@ use std::fs::{File, OpenOptions};
use std::io::{Seek, SeekFrom, Write};
use binrw::BinRead;
use binrw::binread;
use binrw::binrw;
use crate::sqpack::read_data_block_patch;
use core::cmp::min;
use std::path::PathBuf;
use crate::common::{get_platform_string, PlatformId, Region};
use crate::common::Region;
#[binread]
#[derive(Debug)]
@ -248,6 +249,23 @@ struct SqpkFileOperationData {
path: String,
}
#[binrw]
#[brw(repr = u16)]
#[derive(Debug, PartialEq)]
enum PlatformId {
Windows,
PS3,
PS4,
}
fn get_platform_string(id: &PlatformId) -> &'static str {
match &id {
PlatformId::Windows => "win32",
PlatformId::PS3 => "ps3", // TODO: lol are these even correct? i have no idea
PlatformId::PS4 => "ps4"
}
}
#[derive(BinRead, PartialEq, Debug)]
#[br(big)]
struct SqpkTargetInfo {