summaryrefslogtreecommitdiff
path: root/shared/src
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/resources.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/shared/src/resources.rs b/shared/src/resources.rs
index 40a9cad..5c207a9 100644
--- a/shared/src/resources.rs
+++ b/shared/src/resources.rs
@@ -35,6 +35,7 @@ pub struct Prefab {
#[derive(Debug, Default, Clone)]
pub struct LightPart {
+ pub name: Option<String>,
pub emission: Option<Vec3A>,
pub radius: Option<f32>,
}
@@ -186,6 +187,7 @@ impl ReadWrite for Prefab {
}
impl ReadWrite for LightPart {
fn write(&self, w: &mut dyn Write) -> Result<()> {
+ write_kv_opt(w, b"name", &self.name)?;
write_kv_opt(w, b"emission", &self.emission)?;
write_kv_opt(w, b"radius", &self.radius)?;
Ok(())
@@ -194,6 +196,7 @@ impl ReadWrite for LightPart {
fn read(r: &mut dyn Read) -> Result<Self> {
let mut s = Self::default();
read_kv_iter(r, |k, v| match k {
+ b"name" => Ok(s.name = Some(read_slice(v)?)),
b"emission" => Ok(s.emission = Some(read_slice(v)?)),
b"radius" => Ok(s.radius = Some(read_slice(v)?)),
x => Ok(warn!(