Skip to content

Commit

Permalink
Remove defunct feature checks
Browse files Browse the repository at this point in the history
Now that the modules are separated, the feature check is enforced on
that level and not on individual items.
  • Loading branch information
redstrate committed May 26, 2024
1 parent 6fe09e2 commit a11b865
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 25 deletions.
2 changes: 0 additions & 2 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::ffi_from_c_string;

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_IndexEntries {
num_entries: u32,
dir_entries: *const u32,
Expand All @@ -28,7 +27,6 @@ impl Default for physis_IndexEntries {
}
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_index_parse(path: *const c_char) -> physis_IndexEntries {
let Some(r_path) = ffi_from_c_string(path) else {
Expand Down
1 change: 0 additions & 1 deletion src/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use physis::installer::install_game;

use crate::ffi_from_c_string;

#[cfg(feature = "game_install")]
#[no_mangle]
pub extern "C" fn physis_install_game(
installer_path: *const c_char,
Expand Down
8 changes: 0 additions & 8 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use physis::model::{SubMesh, Vertex, MDL};
use crate::{ffi_to_c_string, physis_Buffer};

#[repr(C)]
#[cfg(feature = "visual_data")]
pub struct physis_Part {
num_vertices: u32,
vertices: *const Vertex,
Expand All @@ -30,21 +29,18 @@ pub struct physis_Part {
}

#[repr(C)]
#[cfg(feature = "visual_data")]
pub struct physis_Shape {
name: *const c_char,
morphed_vertices: *const Vertex,
}

#[repr(C)]
#[cfg(feature = "visual_data")]
pub struct physis_LOD {
num_parts: u32,
parts: *const physis_Part,
}

#[repr(C)]
#[cfg(feature = "visual_data")]
pub struct physis_MDL {
p_ptr: *mut MDL,
num_lod: u32,
Expand All @@ -69,7 +65,6 @@ impl Default for physis_MDL {
}
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_mdl_parse(buffer: physis_Buffer) -> physis_MDL {
let data = unsafe { slice::from_raw_parts(buffer.data, buffer.size as usize) };
Expand Down Expand Up @@ -111,7 +106,6 @@ pub extern "C" fn physis_mdl_parse(buffer: physis_Buffer) -> physis_MDL {
mdl
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_mdl_write(mdl: &physis_MDL) -> physis_Buffer {
unsafe {
Expand All @@ -128,7 +122,6 @@ pub extern "C" fn physis_mdl_write(mdl: &physis_MDL) -> physis_Buffer {
}
}

#[cfg(feature = "visual_data")]
fn physis_mdl_update_vertices(mdl: &MDL) -> Vec<physis_LOD> {
let mut c_lods: Vec<physis_LOD> = Vec::new();

Expand Down Expand Up @@ -181,7 +174,6 @@ fn physis_mdl_update_vertices(mdl: &MDL) -> Vec<physis_LOD> {
c_lods
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_mdl_replace_vertices(
mdl: *mut physis_MDL,
Expand Down
5 changes: 0 additions & 5 deletions src/pbd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::{mem, slice};

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_PBD {
p_ptr: *mut PreBoneDeformer,
}
Expand All @@ -20,7 +19,6 @@ impl Default for physis_PBD {
}
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_parse_pbd(buffer: physis_Buffer) -> physis_PBD {
let data = unsafe { slice::from_raw_parts(buffer.data, buffer.size as usize) };
Expand All @@ -36,15 +34,13 @@ pub extern "C" fn physis_parse_pbd(buffer: physis_Buffer) -> physis_PBD {

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_PreBoneDeformBone {
name: *const c_char,
deform: [f32; 12],
}

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_PreBoneDeformMatrices {
num_bones: i32,
bones: *mut physis_PreBoneDeformBone,
Expand All @@ -59,7 +55,6 @@ impl Default for physis_PreBoneDeformMatrices {
}
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_pbd_get_deform_matrix(
pbd: physis_PBD,
Expand Down
4 changes: 0 additions & 4 deletions src/skeleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::ptr::null_mut;
use std::{mem, slice};

#[repr(C)]
#[cfg(feature = "visual_data")]
pub struct physis_Bone {
pub index: u32,
pub name: *const c_char,
Expand All @@ -22,7 +21,6 @@ pub struct physis_Bone {

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_Skeleton {
num_bones: u32,
bones: *mut physis_Bone,
Expand All @@ -39,7 +37,6 @@ impl Default for physis_Skeleton {
}
}

#[cfg(feature = "visual_data")]
fn convert_skeleton(skeleton: &Skeleton) -> physis_Skeleton {
let mut c_bones = vec![];

Expand Down Expand Up @@ -72,7 +69,6 @@ fn convert_skeleton(skeleton: &Skeleton) -> physis_Skeleton {
skel
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_parse_skeleton(buffer: physis_Buffer) -> physis_Skeleton {
let data = unsafe { slice::from_raw_parts(buffer.data, buffer.size as usize) };
Expand Down
3 changes: 0 additions & 3 deletions src/tera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ use std::{mem, slice};

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_PlateModel {
position: [f32; 2],
filename: *const c_char,
}

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_Terrain {
num_plates: i32,
plates: *mut physis_PlateModel,
Expand All @@ -32,7 +30,6 @@ impl Default for physis_Terrain {
}
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_parse_tera(buffer: physis_Buffer) -> physis_Terrain {
let data = unsafe { slice::from_raw_parts(buffer.data, buffer.size as usize) };
Expand Down
2 changes: 0 additions & 2 deletions src/tex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::{mem, slice};

#[repr(C)]
#[derive(Clone, Copy)]
#[cfg(feature = "visual_data")]
pub struct physis_Texture {
texture_type: TextureType,
width: u32,
Expand All @@ -32,7 +31,6 @@ impl Default for physis_Texture {
}
}

#[cfg(feature = "visual_data")]
#[no_mangle]
pub extern "C" fn physis_texture_parse(buffer: physis_Buffer) -> physis_Texture {
let data = unsafe { slice::from_raw_parts(buffer.data, buffer.size as usize) };
Expand Down

0 comments on commit a11b865

Please sign in to comment.