From 68a1447d5173115bda56b866130e49cf42003c4f Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:23 +0100 Subject: fix(render-bsp) dont use include_bytes --- examples/render-bsp/src/main.rs | 11 +++++++---- 1 file 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, stockton_levels::types::ParseError> = - Q3BspFile::parse_file(&data); + Q3BspFile::parse_file(data.as_slice()); let bsp: Q3BspFile = bsp.context("Error loading bsp")?; let bsp: Q3BspFile = bsp.swizzle_to(); -- cgit v1.2.3