diff options
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index c10f0b0..c8ef8c6 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -36,7 +36,7 @@ use weareshared::{ Vec3A, helper::ReadWrite, packets::{Data, Object, Packet, Resource}, - resources::{Image, LightPart, Prefab}, + resources::{EnvironmentPart, Image, LightPart, Prefab}, store::ResourceStore, vec3a, }; @@ -64,6 +64,9 @@ struct Args { /// Register to the prefab index #[arg(short, long)] name: Option<String>, + /// Add skybox + #[arg(short, long)] + skybox: Option<PathBuf>, } fn main() -> Result<()> { @@ -111,6 +114,14 @@ fn main() -> Result<()> { radius: Some(0.2), })?, )); + if let Some(skybox) = args.skybox { + let mut buf = Vec::new(); + File::open(skybox)?.read_to_end(&mut buf)?; + prefab.environment = Some(store.set(&EnvironmentPart { + skybox: Some(store.set(&Image(buf))?), + ..Default::default() + })?); + } let pres = store.set(&prefab)?; |