1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-23 21:17:45 +00:00

Fix some warnings

This commit is contained in:
Joshua Goins 2024-06-28 06:10:37 -04:00
parent 926e7e2c78
commit c4e409c04a
5 changed files with 19 additions and 11 deletions

14
src/bin/main.rs Normal file
View file

@ -0,0 +1,14 @@
use std::fs::write;
use physis::common::Platform;
use physis::gamedata::GameData;
use physis::mtrl::Material;
fn main() {
let game_data = GameData::from_existing(Platform::Win32, "/home/josh/.local/share/astra/game/{2bdefc9d-3382-45d6-952f-ae9b918c4764}/game");
let p = "bg/ffxiv/fst_f1/fld/f1f3/material/f1f3_w1_mizu4a.mtrl";
let m_data = game_data.unwrap().extract(p).unwrap();
write("/home/josh/test.mtrl", &m_data);
let m = Material::from_existing(&m_data);
println!("{:#?}", m);
}

View file

@ -4,8 +4,7 @@
use std::env::home_dir; use std::env::home_dir;
use std::fs; use std::fs;
use std::fs::read_dir; use std::fs::read_dir;
use std::path::{Path, PathBuf}; use std::path::PathBuf;
use tracing::warn;
/// Where the existing installation came from /// Where the existing installation came from
#[derive(Clone, Copy)] #[derive(Clone, Copy)]

View file

@ -196,12 +196,7 @@ impl GameData {
/// Finds the offset inside of the DAT file for `path`. /// Finds the offset inside of the DAT file for `path`.
pub fn find_offset(&mut self, path: &str) -> Option<u64> { pub fn find_offset(&mut self, path: &str) -> Option<u64> {
let slice = self.find_entry(path); let slice = self.find_entry(path);
match slice { slice.map(|(entry, _)| entry.offset)
Some((entry, chunk)) => {
Some(entry.offset)
}
None => None,
}
} }
/// Parses a path structure and spits out the corresponding category and repository. /// Parses a path structure and spits out the corresponding category and repository.

View file

@ -752,8 +752,8 @@ impl MDL {
for shape_value in shape_values { for shape_value in shape_values {
let old_vertex = let old_vertex =
vertices[indices[shape_value.base_indices_index as usize] as usize]; vertices[indices[shape_value.base_indices_index as usize] as usize];
let new_vertex = vertices[(shape_value.replacing_vertex_index let new_vertex = vertices[shape_value.replacing_vertex_index
as usize)]; as usize];
let vertex = &mut morphed_vertices let vertex = &mut morphed_vertices
[indices[shape_value.base_indices_index as usize] as usize]; [indices[shape_value.base_indices_index as usize] as usize];

View file

@ -3,7 +3,6 @@
use std::io::{Cursor, Seek, SeekFrom}; use std::io::{Cursor, Seek, SeekFrom};
use crate::common_file_operations::{Half1, Half3};
use crate::ByteSpan; use crate::ByteSpan;
use binrw::BinRead; use binrw::BinRead;
use binrw::{binrw, BinReaderExt}; use binrw::{binrw, BinReaderExt};
@ -67,6 +66,7 @@ impl StainingTemplate {
Some(StainingTemplate {}) Some(StainingTemplate {})
} }
#[allow(unused)]
fn read_array<T: binrw::BinRead<Args<'static> = ()> + Default + Clone + Copy>( fn read_array<T: binrw::BinRead<Args<'static> = ()> + Default + Clone + Copy>(
cursor: &mut Cursor<ByteSpan>, cursor: &mut Cursor<ByteSpan>,
offset: u64, offset: u64,