aboutsummaryrefslogtreecommitdiff
path: root/examples/render-bsp/src
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:20 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:20 +0100
commit58319f04f239ab4a81b4eb878ad987fe453fef9e (patch)
treeb3245686b548b3d5f51bd61be609c1bee239d155 /examples/render-bsp/src
parentac3870a05701933d85c4a8b440d3c7dbc4959d33 (diff)
feat(levels): coord system types and swizzling
the room is now the right way up! yay!
Diffstat (limited to 'examples/render-bsp/src')
-rw-r--r--examples/render-bsp/src/main.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/render-bsp/src/main.rs b/examples/render-bsp/src/main.rs
index f2310e6..ac1415e 100644
--- a/examples/render-bsp/src/main.rs
+++ b/examples/render-bsp/src/main.rs
@@ -25,6 +25,7 @@ extern crate image;
use image::load_from_memory;
use std::time::SystemTime;
+use stockton_levels::prelude::*;
use stockton_levels::q3::Q3BSPFile;
use stockton_types::{World, Vector3};
use stockton_render::Renderer;
@@ -91,7 +92,9 @@ fn main() {
let event_loop = EventLoop::new();
let window = WindowBuilder::new().build(&event_loop).unwrap();
let data = include_bytes!("../data/test.bsp").to_vec().into_boxed_slice();
- let bsp = Q3BSPFile::new(&data).unwrap();
+ let bsp: Result<Q3BSPFile<Q3System>, stockton_levels::types::ParseError> = Q3BSPFile::parse_file(&data);
+ let bsp: Q3BSPFile<Q3System> = bsp.unwrap();
+ let bsp: Q3BSPFile<VulkanSystem> = bsp.swizzle_to();
let world = World::new(bsp);
let mut renderer = Renderer::new(world, &window).unwrap();