use new material loading

This commit is contained in:
Robin Appelman 2023-12-19 17:21:12 +01:00
commit 585a485031
10 changed files with 266 additions and 491 deletions

29
examples/common/error.rs Normal file
View file

@ -0,0 +1,29 @@
use crate::loader::LoadError;
use miette::Diagnostic;
use std::string::FromUtf8Error;
use thiserror::Error;
use vmt_parser::VdfError;
#[allow(dead_code)]
#[derive(Debug, Error, Diagnostic)]
pub enum Error {
#[error(transparent)]
Three(#[from] Box<dyn std::error::Error>),
#[error(transparent)]
Mdl(#[from] vmdl::ModelError),
#[error(transparent)]
IO(#[from] std::io::Error),
#[error(transparent)]
Loader(#[from] LoadError),
#[error(transparent)]
Vtf(#[from] vtf::Error),
#[error(transparent)]
#[diagnostic(transparent)]
Vdf(#[from] VdfError),
#[error("{0}")]
Other(String),
#[error("Skin index out of bounds: {0}, model only has {1} skins")]
SkinOutOfBounds(u16, u16),
#[error(transparent)]
Utf8(#[from] FromUtf8Error),
}