From 9530d22cf5369ceba369487fff1b85376da64657 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 25 Apr 2024 20:48:39 +0200 Subject: feat(engine): add basic Wavefront obj file parsing --- engine/src/util.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 engine/src/util.rs (limited to 'engine/src/util.rs') diff --git a/engine/src/util.rs b/engine/src/util.rs new file mode 100644 index 0000000..021b2fe --- /dev/null +++ b/engine/src/util.rs @@ -0,0 +1,24 @@ +macro_rules! try_option { + ($expr: expr) => { + match $expr { + Ok(value) => value, + Err(err) => { + return Some(Err(err)); + } + } + }; +} + +pub(crate) use try_option; + +macro_rules! or { + (($($tt: tt)+) else ($($else_tt: tt)*)) => { + $($tt)+ + }; + + (() else ($($else_tt: tt)*)) => { + $($else_tt)* + }; +} + +pub(crate) use or; -- cgit v1.2.3-18-g5258