1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-25 13:57:45 +00:00

Suppress some warnings

This commit is contained in:
Joshua Goins 2022-09-15 16:26:31 -04:00
parent 02dd211964
commit 9819f87fcc
14 changed files with 48 additions and 14 deletions

View file

@ -39,7 +39,7 @@ pub fn get_language_code(lang: &Language) -> &'static str {
#[binrw] #[binrw]
#[brw(repr = i16)] #[brw(repr = i16)]
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq)]
pub enum Region { pub enum Region {
Global = -1, // TODO: find patch codes for other regions :-) Global = -1, // TODO: find patch codes for other regions :-)
} }

View file

@ -9,7 +9,7 @@ use std::io::{Cursor, Read, Seek, SeekFrom};
#[binrw] #[binrw]
#[brw(repr = i32)] #[brw(repr = i32)]
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq)]
/// The file type of the data entry. /// The file type of the data entry.
pub enum FileType { pub enum FileType {
/// Empty entry, usually invalid. /// Empty entry, usually invalid.
@ -29,6 +29,7 @@ struct StandardFileBlock {
} }
#[derive(BinRead, Debug)] #[derive(BinRead, Debug)]
#[allow(dead_code)]
struct TextureLodBlock { struct TextureLodBlock {
compressed_offset: u32, compressed_offset: u32,
compressed_size: u32, compressed_size: u32,

View file

@ -1,7 +1,7 @@
use crate::race::{get_race_id, Gender, Race, Subrace}; use crate::race::{get_race_id, Gender, Race, Subrace};
#[repr(u8)] #[repr(u8)]
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq)]
/// The slot the item is for. /// The slot the item is for.
pub enum Slot { pub enum Slot {
/// The head slot. Shorthand is "met". /// The head slot. Shorthand is "met".

View file

@ -8,6 +8,7 @@ use std::io::{Cursor, Seek, SeekFrom};
#[binread] #[binread]
#[br(magic = b"EXDF")] #[br(magic = b"EXDF")]
#[br(big)] #[br(big)]
#[allow(dead_code)]
struct EXDHeader { struct EXDHeader {
version: u16, version: u16,
@ -25,6 +26,7 @@ struct ExcelDataOffset {
#[binread] #[binread]
#[br(big)] #[br(big)]
#[allow(dead_code)]
struct ExcelDataRowHeader { struct ExcelDataRowHeader {
data_size: u32, data_size: u32,
row_count: u16, row_count: u16,
@ -32,6 +34,7 @@ struct ExcelDataRowHeader {
#[binread] #[binread]
#[br(big)] #[br(big)]
#[allow(dead_code)]
pub struct EXD { pub struct EXD {
header: EXDHeader, header: EXDHeader,
@ -198,13 +201,13 @@ impl EXD {
) -> String { ) -> String {
use crate::common::get_language_code; use crate::common::get_language_code;
return match language { match language {
Language::None => { Language::None => {
format!("{name}_{}.exd", page.start_id) format!("{name}_{}.exd", page.start_id)
} }
lang => { lang => {
format!("{name}_{}_{}.exd", page.start_id, get_language_code(&lang)) format!("{name}_{}_{}.exd", page.start_id, get_language_code(&lang))
} }
}; }
} }
} }

View file

@ -7,6 +7,7 @@ use std::io::Cursor;
#[binread] #[binread]
#[br(magic = b"EXHF")] #[br(magic = b"EXHF")]
#[br(big)] #[br(big)]
#[allow(dead_code)]
pub struct EXHHeader { pub struct EXHHeader {
version: u16, version: u16,
@ -54,6 +55,7 @@ pub struct ExcelColumnDefinition {
#[binread] #[binread]
#[br(big)] #[br(big)]
#[allow(dead_code)]
pub struct ExcelDataPagination { pub struct ExcelDataPagination {
pub start_id: u32, pub start_id: u32,
row_count: u32, row_count: u32,
@ -61,6 +63,7 @@ pub struct ExcelDataPagination {
#[binread] #[binread]
#[br(big)] #[br(big)]
#[allow(dead_code)]
pub struct EXH { pub struct EXH {
pub header: EXHHeader, pub header: EXHHeader,

View file

@ -4,6 +4,7 @@ use binrw::BinRead;
use std::io::{Cursor, Seek, SeekFrom}; use std::io::{Cursor, Seek, SeekFrom};
#[binread] #[binread]
#[allow(dead_code)]
pub struct ChatLogHeader { pub struct ChatLogHeader {
content_size: u32, content_size: u32,
file_size: u32, file_size: u32,
@ -44,6 +45,7 @@ enum EventChannel {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub struct ChatLogEntry { pub struct ChatLogEntry {
timestamp: u32, timestamp: u32,
filter: EventFilter, filter: EventFilter,
@ -57,6 +59,7 @@ pub struct ChatLogEntry {
} }
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub struct ChatLog { pub struct ChatLog {
entries: Vec<ChatLogEntry>, entries: Vec<ChatLogEntry>,
} }

View file

@ -9,7 +9,7 @@ macro_rules! define_race_enum {
} }
) => { ) => {
paste! { paste! {
#[derive(PartialEq, Debug)] #[derive(PartialEq, Eq, Debug)]
pub enum $name { pub enum $name {
$( $(

View file

@ -63,6 +63,7 @@ enum ModelFlags2 {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub struct ModelHeader { pub struct ModelHeader {
#[br(pad_after = 2)] #[br(pad_after = 2)]
string_count: u16, string_count: u16,
@ -107,6 +108,7 @@ pub struct ModelHeader {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct MeshLod { struct MeshLod {
mesh_index: u16, mesh_index: u16,
mesh_count: u16, mesh_count: u16,
@ -141,6 +143,7 @@ struct MeshLod {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct Mesh { struct Mesh {
#[br(pad_after = 2)] #[br(pad_after = 2)]
vertex_count: u16, vertex_count: u16,
@ -161,6 +164,7 @@ struct Mesh {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct Submesh { struct Submesh {
index_offset: i32, index_offset: i32,
index_count: i32, index_count: i32,
@ -173,6 +177,7 @@ struct Submesh {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct BoneTable { struct BoneTable {
bone_indices: [u16; 64], bone_indices: [u16; 64],
@ -182,6 +187,7 @@ struct BoneTable {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct BoundingBox { struct BoundingBox {
min: [f32; 4], min: [f32; 4],
max: [f32; 4], max: [f32; 4],
@ -189,6 +195,7 @@ struct BoundingBox {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ModelData { struct ModelData {
header: ModelHeader, header: ModelHeader,
@ -240,6 +247,7 @@ struct ModelData {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ElementId { struct ElementId {
element_id: u32, element_id: u32,
parent_bone_name: u32, parent_bone_name: u32,
@ -276,6 +284,7 @@ enum VertexUsage {
#[binread] #[binread]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
struct VertexElement { struct VertexElement {
stream: u8, stream: u8,
offset: u8, offset: u8,

View file

@ -4,6 +4,7 @@ use std::io::Cursor;
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct MaterialFileHeader { struct MaterialFileHeader {
version: u32, version: u32,
file_size: u16, file_size: u16,
@ -28,6 +29,7 @@ struct MaterialHeader {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ColorSet { struct ColorSet {
name_offset: u16, name_offset: u16,
#[br(pad_after = 1)] #[br(pad_after = 1)]
@ -36,6 +38,7 @@ struct ColorSet {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ColorSetInfo { struct ColorSetInfo {
#[br(count = 256)] #[br(count = 256)]
data: Vec<u16>, data: Vec<u16>,
@ -43,6 +46,7 @@ struct ColorSetInfo {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ColorSetDyeInfo { struct ColorSetDyeInfo {
#[br(count = 16)] #[br(count = 16)]
data: Vec<u16>, data: Vec<u16>,
@ -50,6 +54,7 @@ struct ColorSetDyeInfo {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ShaderKey { struct ShaderKey {
category: u32, category: u32,
value: u32, value: u32,
@ -57,6 +62,7 @@ struct ShaderKey {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct Constant { struct Constant {
constant_id: u32, constant_id: u32,
value_offset: u16, value_offset: u16,
@ -65,6 +71,7 @@ struct Constant {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct Sampler { struct Sampler {
sampler_id: u32, sampler_id: u32,
flags: u32, // TODO: unknown flags: u32, // TODO: unknown
@ -74,6 +81,7 @@ struct Sampler {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct MaterialData { struct MaterialData {
file_header: MaterialFileHeader, file_header: MaterialFileHeader,

View file

@ -21,6 +21,7 @@ struct PatchHeader {
} }
#[derive(BinRead, Debug)] #[derive(BinRead, Debug)]
#[allow(dead_code)]
struct PatchChunk { struct PatchChunk {
#[br(big)] #[br(big)]
size: u32, size: u32,
@ -567,7 +568,7 @@ pub(crate) fn apply_patch(data_dir: &str, patch_path: &str) -> Result<(), PatchE
SqpkOperation::IndexAddDelete(_) => { SqpkOperation::IndexAddDelete(_) => {
println!("PATCH: NOP IndexAddDelete"); println!("PATCH: NOP IndexAddDelete");
}, },
SqpkOperation::PatchInfo(patch_info) => { SqpkOperation::PatchInfo(_) => {
println!("PATCH: NOP PatchInfo"); println!("PATCH: NOP PatchInfo");
} }
SqpkOperation::TargetInfo(new_target_info) => { SqpkOperation::TargetInfo(new_target_info) => {
@ -575,10 +576,10 @@ pub(crate) fn apply_patch(data_dir: &str, patch_path: &str) -> Result<(), PatchE
} }
} }
} }
ChunkType::FileHeader(header) => { ChunkType::FileHeader(_) => {
println!("PATCH: NOP FileHeader"); println!("PATCH: NOP FileHeader");
} }
ChunkType::ApplyOption(option) => { ChunkType::ApplyOption(_) => {
println!("PATCH: NOP ApplyOption"); println!("PATCH: NOP ApplyOption");
} }
ChunkType::AddDirectory(_) => { ChunkType::AddDirectory(_) => {

View file

@ -1,4 +1,4 @@
#[derive(PartialEq)] #[derive(PartialEq, Eq)]
#[repr(u8)] #[repr(u8)]
/// Gender of the character. /// Gender of the character.
pub enum Gender { pub enum Gender {
@ -6,7 +6,7 @@ pub enum Gender {
Female, Female,
} }
#[derive(PartialEq)] #[derive(PartialEq, Eq)]
#[repr(u8)] #[repr(u8)]
/// The race's "subrace". Each race has two subraces, which are actually identical (even down to the ids!) /// The race's "subrace". Each race has two subraces, which are actually identical (even down to the ids!)
/// with the exception of Hyurs, which have two unique subraces that are really two separate races. /// with the exception of Hyurs, which have two unique subraces that are really two separate races.
@ -29,7 +29,7 @@ pub enum Subrace {
Veena, Veena,
} }
#[derive(PartialEq)] #[derive(PartialEq, Eq)]
#[repr(u8)] #[repr(u8)]
/// The major races of Eorzea. /// The major races of Eorzea.
pub enum Race { pub enum Race {

View file

@ -5,7 +5,7 @@ use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
/// The type of repository, discerning game data from expansion data. /// The type of repository, discerning game data from expansion data.
#[derive(Debug, PartialEq, Copy, Clone)] #[derive(Debug, PartialEq, Eq, Copy, Clone)]
#[repr(C)] #[repr(C)]
pub enum RepositoryType { pub enum RepositoryType {
/// The base game directory, like "ffxiv". /// The base game directory, like "ffxiv".
@ -65,7 +65,7 @@ fn read_version(p: &Path) -> Option<String> {
/// This refers to the specific root directory a file is located in. /// This refers to the specific root directory a file is located in.
/// This is a fixed list of directories, and all of them are known. /// This is a fixed list of directories, and all of them are known.
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq, Eq)]
pub enum Category { pub enum Category {
/// Common files such as game fonts, and other data that doesn't really fit anywhere else. /// Common files such as game fonts, and other data that doesn't really fit anywhere else.
Common, Common,

View file

@ -31,6 +31,7 @@ impl Skeleton {
#[derive(XmlRead, Debug)] #[derive(XmlRead, Debug)]
#[xml(tag = "hksection")] #[xml(tag = "hksection")]
#[allow(dead_code)]
struct HkSection { struct HkSection {
#[xml(attr = "name")] #[xml(attr = "name")]
name: String, name: String,
@ -41,6 +42,7 @@ impl Skeleton {
#[derive(XmlRead, Debug)] #[derive(XmlRead, Debug)]
#[xml(tag = "hkobject")] #[xml(tag = "hkobject")]
#[allow(dead_code)]
struct HkObject { struct HkObject {
#[xml(attr = "name")] #[xml(attr = "name")]
name: Option<String>, name: Option<String>,
@ -54,6 +56,7 @@ impl Skeleton {
#[derive(XmlRead, Debug)] #[derive(XmlRead, Debug)]
#[xml(tag = "hkparam")] #[xml(tag = "hkparam")]
#[allow(dead_code)]
struct HkParam { struct HkParam {
#[xml(attr = "name")] #[xml(attr = "name")]
name: String, name: String,
@ -105,6 +108,7 @@ impl Skeleton {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")] #[serde(rename_all = "PascalCase")]
#[allow(dead_code)]
struct BoneObject { struct BoneObject {
bone_name: String, bone_name: String,
bone_number: i32, bone_number: i32,

View file

@ -9,6 +9,7 @@ use texpresso::Format;
// Attributes and Format are adapted from Lumina (https://github.com/NotAdam/Lumina/blob/master/src/Lumina/Data/Files/TexFile.cs) // Attributes and Format are adapted from Lumina (https://github.com/NotAdam/Lumina/blob/master/src/Lumina/Data/Files/TexFile.cs)
bitflags! { bitflags! {
#[binread] #[binread]
#[allow(non_upper_case_globals)]
struct TextureAttribute : u32 { struct TextureAttribute : u32 {
const DiscardPerFrame = 0x1; const DiscardPerFrame = 0x1;
const DiscardPerMap = 0x2; const DiscardPerMap = 0x2;
@ -48,6 +49,7 @@ enum TextureFormat {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct TexHeader { struct TexHeader {
attribute: TextureAttribute, attribute: TextureAttribute,
format: TextureFormat, format: TextureFormat,