diff --git a/src/common.rs b/src/common.rs index 365246f..eb2af92 100755 --- a/src/common.rs +++ b/src/common.rs @@ -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)] diff --git a/src/index.rs b/src/index.rs index 71856e6..098d49a 100755 --- a/src/index.rs +++ b/src/index.rs @@ -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")] diff --git a/src/patch.rs b/src/patch.rs index 34d4540..c2d53e8 100755 --- a/src/patch.rs +++ b/src/patch.rs @@ -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 {