Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lukts30 committed Nov 9, 2020
1 parent d405425 commit 5cb3033
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rdm4lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ features = ["extras", "names"]

[dependencies.half]
version = "1.6.0"
features = ["use-intrinsics"]
features = []
8 changes: 4 additions & 4 deletions rdm4lib/src/gltf_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ impl RDGltfBuilder {
}

fn rdm_vertex_to_gltf(rdm: &RDModell) -> (Vec<Vertex>, Vec<f32>, Vec<f32>) {
let mut out: Vec<Vertex> = Vec::with_capacity(3*4*rdm.vertex.vertex_count as usize);
let mut out: Vec<Vertex> = Vec::with_capacity(3 * 4 * rdm.vertex.vertex_count as usize);

//TODO FIXME arbitrarily chosen
let mut min: Vec<f32> = vec![100.0, 100.0, 100.0];
Expand Down Expand Up @@ -892,7 +892,7 @@ impl RDGltfBuilder {

fn put_tex(&mut self) {
if let Some(iter) = self.rdm.vertex.iter::<T2h>(0) {
let mut buff = BytesMut::with_capacity(2*4*self.rdm.vertex.vertex_count as usize);
let mut buff = BytesMut::with_capacity(2 * 4 * self.rdm.vertex.vertex_count as usize);

for t2h in iter {
buff.put_f32_le(t2h.tex[0].to_f32());
Expand Down Expand Up @@ -1024,7 +1024,7 @@ impl RDGltfBuilder {

#[allow(dead_code)]
fn put_normal(&mut self) {
let mut buff = BytesMut::with_capacity(4*1*self.rdm.vertex.vertex_count as usize);
let mut buff = BytesMut::with_capacity(4 * self.rdm.vertex.vertex_count as usize);

if let Some(iter) = self.rdm.vertex.iter::<N4b>(0) {
for n4b in iter {
Expand Down Expand Up @@ -1113,7 +1113,7 @@ impl RDGltfBuilder {

#[allow(dead_code)]
fn put_tangent(&mut self) {
let mut buff = BytesMut::with_capacity(4*1*self.rdm.vertex.vertex_count as usize);
let mut buff = BytesMut::with_capacity(4 * self.rdm.vertex.vertex_count as usize);

if let Some(iter) = self.rdm.vertex.iter::<G4b>(0) {
for g4b in iter {
Expand Down
2 changes: 1 addition & 1 deletion rdm4lib/src/rdm_anim_writer.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bytes::{BufMut, BytesMut};

use byteorder::ByteOrder;
use std::{fs::OpenOptions, io::Write};
use std::{fs, path::PathBuf};
use std::{fs::OpenOptions, io::Write};

use crate::*;

Expand Down
2 changes: 1 addition & 1 deletion rdm4lib/src/rdm_writer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::{BufMut, BytesMut};

use std::{fs::OpenOptions, io::Write};
use std::{fs, path::PathBuf};
use std::{fs::OpenOptions, io::Write};

use crate::*;
use byteorder::ByteOrder;
Expand Down
2 changes: 1 addition & 1 deletion rdm4lib/src/vertex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl VertexFormat2 {
let mut vbuffer = self.vertex_buffer.clone();
assert_eq!(vbuffer.len() as u32 % self.size, 0);
let n = vbuffer.len() as u32 / self.size;
assert_eq!(self.vertex_count,n);
assert_eq!(self.vertex_count, n);

vbuffer.advance(offset);
let it = std::iter::from_fn(move || {
Expand Down
14 changes: 10 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct Opts {
out: Option<PathBuf>,

/// Sets output to input file name
#[clap(long = "in_is_out_filename", display_order(2),short = 'n')]
#[clap(long = "in_is_out_filename", display_order(2), short = 'n')]
in_is_out_filename: bool,

/// Batch process recursively
Expand Down Expand Up @@ -149,7 +149,11 @@ fn main() {
}

fn entry_do_work(mut opts: Opts) {
assert_eq!(opts.input.is_file(), true, "Input must be a file! Missing --batch / -b ?");
assert_eq!(
opts.input.is_file(),
true,
"Input must be a file! Missing --batch / -b ?"
);
if let Some(ref mut out) = opts.out {
if opts.in_is_out_filename {
let k = opts.input.file_stem().unwrap();
Expand Down Expand Up @@ -273,11 +277,13 @@ fn batch(defopt: Opts) -> std::result::Result<(), Box<dyn std::error::Error + 's
if ext.eq(rext) || ext.eq(rext2) {
let parent = path.parent().unwrap();

if (!parent.ends_with(anim) && !parent.ends_with(anims)) || defopt.gltf.is_some() {
if (!parent.ends_with(anim) && !parent.ends_with(anims))
|| defopt.gltf.is_some()
{
let base = input.parent().unwrap();
dst.push(path.strip_prefix(base).unwrap());

if defopt.gltf.is_some() && (defopt.in_is_out_filename || !ext.eq("glb")){
if defopt.gltf.is_some() && (defopt.in_is_out_filename || !ext.eq("glb")) {
dbg!(&dst);
dst.pop();
dbg!(&dst);
Expand Down

0 comments on commit 5cb3033

Please sign in to comment.