summaryrefslogtreecommitdiff
path: root/engine/src/file_format/wavefront/mtl.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-07-17 03:06:04 +0200
committerHampusM <hampus@hampusmat.com>2026-07-17 03:06:04 +0200
commit65e24308babb2ed4f33fb6f1d7b531df676bd70d (patch)
treedf9477d4b805cc6866a086833d6118505804dd3a /engine/src/file_format/wavefront/mtl.rs
parent649d4d4ab2f54ca12f75d2cba50e1adef2350dbe (diff)
refactor(engine): change Color struct into a enum
Diffstat (limited to 'engine/src/file_format/wavefront/mtl.rs')
-rw-r--r--engine/src/file_format/wavefront/mtl.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/src/file_format/wavefront/mtl.rs b/engine/src/file_format/wavefront/mtl.rs
index f3c7a64..24387b9 100644
--- a/engine/src/file_format/wavefront/mtl.rs
+++ b/engine/src/file_format/wavefront/mtl.rs
@@ -4,7 +4,7 @@
use std::path::{Path, PathBuf};
-use crate::color::Color;
+use crate::color::{Color, Rgb};
use crate::file_format::wavefront::common::{
keyword,
parse_statement_line,
@@ -67,9 +67,9 @@ impl Default for NamedMaterial
{
Self {
name: String::new(),
- ambient: Color::WHITE_F32,
- diffuse: Color::WHITE_F32,
- specular: Color::WHITE_F32,
+ ambient: Color::Rgb(Rgb::<f32>::white()),
+ diffuse: Color::Rgb(Rgb::<f32>::white()),
+ specular: Color::Rgb(Rgb::<f32>::white()),
ambient_map: None,
diffuse_map: None,
specular_map: None,
@@ -276,7 +276,7 @@ fn get_color_from_statement(
let green = statement.get_float_arg(1, line_no)?;
let blue = statement.get_float_arg(2, line_no)?;
- Ok(Color { red, green, blue })
+ Ok(Color::Rgb(Rgb { r: red, g: green, b: blue }))
}
keyword! {