diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-08 02:12:15 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-08 02:12:15 +0100 |
commit | 18a47eebb5cd9a0a4847f48255a982b3c422e573 (patch) | |
tree | 4dd9dd878917360df47548ef879c8322ce750a02 /world | |
parent | 605add9df358a14a6c34db2068fa648ec3c8c984 (diff) | |
download | weareserver-18a47eebb5cd9a0a4847f48255a982b3c422e573.tar weareserver-18a47eebb5cd9a0a4847f48255a982b3c422e573.tar.bz2 weareserver-18a47eebb5cd9a0a4847f48255a982b3c422e573.tar.zst |
add skybox option
Diffstat (limited to 'world')
-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)?; |