aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commit68a1447d5173115bda56b866130e49cf42003c4f (patch)
tree325a6822a769f60c3be19b3c0a3fbcb7cf50dd3b /examples
parent4510dc5c7516f7bcd70bb1f21fbc309592767cb5 (diff)
fix(render-bsp) dont use include_bytes
Diffstat (limited to 'examples')
-rw-r--r--examples/render-bsp/src/main.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/render-bsp/src/main.rs b/examples/render-bsp/src/main.rs
index fd8e1d5..16854f5 100644
--- a/examples/render-bsp/src/main.rs
+++ b/examples/render-bsp/src/main.rs
@@ -9,6 +9,9 @@ extern crate legion;
use anyhow::{Context, Result};
use log::warn;
use std::collections::BTreeMap;
+use std::fs::File;
+use std::io::Read;
+use std::path::Path;
use winit::{event::Event, event_loop::EventLoop, window::WindowBuilder};
use egui::{containers::CentralPanel, Frame};
@@ -89,11 +92,11 @@ fn try_main() -> Result<()> {
window.set_cursor_visible(false);
// Parse the map file and swizzle the co-ords
- let data = include_bytes!("../data/newtest.bsp")
- .to_vec()
- .into_boxed_slice();
+ let path = Path::new("./examples/render-bsp/data/newtest.bsp");
+ let mut data = Vec::new();
+ File::open(path)?.read_to_end(&mut data)?;
let bsp: Result<Q3BspFile<Q3System>, stockton_levels::types::ParseError> =
- Q3BspFile::parse_file(&data);
+ Q3BspFile::parse_file(data.as_slice());
let bsp: Q3BspFile<Q3System> = bsp.context("Error loading bsp")?;
let bsp: Q3BspFile<VulkanSystem> = bsp.swizzle_to();