Fix all warnings
This commit is contained in:
parent
2bc5ec93fe
commit
ae4dc2c21a
26 changed files with 249 additions and 185 deletions
|
|
@ -1,12 +1,10 @@
|
|||
use crate::{
|
||||
scene::PbrtScene,
|
||||
shape::{Shape, ShapeAlpha, ShapeType},
|
||||
texture::Pbrt_2d_float_texture,
|
||||
tokenizer::Tokenizer,
|
||||
};
|
||||
use error::SourceFile;
|
||||
use material::PbrtMaterial;
|
||||
use miette::{Diagnostic, IntoDiagnostic, Result, SourceSpan, bail, miette};
|
||||
use miette::{IntoDiagnostic, Result, bail, miette};
|
||||
use ray_tracing_core::{
|
||||
affine_transform::AffineTransform,
|
||||
math::{Dir3, Pos3},
|
||||
|
|
@ -18,7 +16,6 @@ use std::{
|
|||
sync::Arc,
|
||||
};
|
||||
use texture::PbrtTexture;
|
||||
use thiserror::Error;
|
||||
|
||||
#[macro_use]
|
||||
mod tokenizer;
|
||||
|
|
@ -43,6 +40,7 @@ impl Lexer {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
enum CameraType {
|
||||
Orthographic {
|
||||
frame_aspect_ratio: Option<Float>,
|
||||
|
|
@ -60,6 +58,7 @@ enum CameraType {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
struct PbrtCamera {
|
||||
camera_type: CameraType,
|
||||
shutter_open: Float,
|
||||
|
|
@ -465,8 +464,8 @@ fn parse_transform(input: &mut Tokenizer) -> Result<AffineTransform> {
|
|||
|
||||
let mut v = [0.0; 16];
|
||||
|
||||
for i in 0..16 {
|
||||
v[i] = input
|
||||
for i in &mut v {
|
||||
*i = input
|
||||
.next()
|
||||
.ok_or(miette!("value expected"))??
|
||||
.parse::<Float>()
|
||||
|
|
@ -618,7 +617,8 @@ impl Pbrt {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct PbrtWorldSettings {
|
||||
#[allow(dead_code)]
|
||||
pub struct PbrtWorldSettings {
|
||||
camera: PbrtCamera,
|
||||
camera_ctm: AffineTransform,
|
||||
}
|
||||
|
|
@ -747,7 +747,7 @@ fn inner_parse_pbrt(path: impl AsRef<Path> + std::fmt::Debug) -> Result<Pbrt> {
|
|||
match p {
|
||||
Statement::AttributeBegin => context.push(),
|
||||
Statement::AttributeEnd => {
|
||||
context.pop();
|
||||
context.pop()?;
|
||||
}
|
||||
Statement::Include(_) => unreachable!(),
|
||||
Statement::ConcatTransform(affine_transform) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue