summaryrefslogtreecommitdiff
path: root/src/content/materials/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/materials/mod.rs')
-rw-r--r--src/content/materials/mod.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/content/materials/mod.rs b/src/content/materials/mod.rs
index 11c0cca..6338827 100644
--- a/src/content/materials/mod.rs
+++ b/src/content/materials/mod.rs
@@ -39,6 +39,10 @@ pub struct MaterialDef {
pub density: u8,
pub form: MaterialForm,
pub sim_update: Option<fn(ctx: &mut UpdateCtx) -> PostUpdateAction>,
+
+ // lighting
+ pub emission: (u8, u8, u8, u8),
+ pub opacity: u8,
}
static MATERIALS: [MaterialDef; 11] = [
@@ -49,6 +53,9 @@ static MATERIALS: [MaterialDef; 11] = [
// form usually but not always determines the update fn
form: MaterialForm::Void,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0x00,
},
MaterialDef {
name: "Sand",
@@ -56,6 +63,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 50,
form: MaterialForm::Powder,
sim_update: Some(powder::sim_update),
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xE0,
},
MaterialDef {
name: "Dirt",
@@ -63,6 +73,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 55,
form: MaterialForm::Solid,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xE0,
},
MaterialDef {
name: "Stone",
@@ -70,6 +83,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 115,
form: MaterialForm::Solid,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xFF,
},
MaterialDef {
name: "Wood",
@@ -77,6 +93,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 60,
form: MaterialForm::Solid,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xFF,
},
MaterialDef {
name: "Water",
@@ -84,6 +103,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 40,
form: MaterialForm::Liquid,
sim_update: Some(liquid::sim_update),
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0x70,
},
// TODO this is not a material
MaterialDef {
@@ -93,6 +115,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 50,
form: MaterialForm::Gas,
sim_update: Some(fire::sim_update),
+
+ emission: (0xFF, 0x00, 0x00, 0x00),
+ opacity: 0x00,
},
MaterialDef {
name: "Smoke",
@@ -100,6 +125,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 15,
form: MaterialForm::Gas,
sim_update: Some(gas::sim_update),
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0x10,
},
MaterialDef {
name: "Steel",
@@ -107,6 +135,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 150,
form: MaterialForm::Solid,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xE0,
},
MaterialDef {
name: "TNT",
@@ -114,6 +145,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 55,
form: MaterialForm::Solid,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xE0,
},
MaterialDef {
name: "Cloth",
@@ -121,6 +155,9 @@ static MATERIALS: [MaterialDef; 11] = [
density: 25,
form: MaterialForm::Solid,
sim_update: None,
+
+ emission: (0x00, 0x00, 0x00, 0x00),
+ opacity: 0xE0,
},
];