summary refs log tree commit diff
path: root/src/World/BlockType.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-21 02:17:03 +0200
committerMel <einebeere@gmail.com>2023-07-21 02:17:03 +0200
commit23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a (patch)
treed2979c12a9675885b7ed969d5f51dbd69d969286 /src/World/BlockType.hpp
parentc0556f76fc5c8271c2eaa7ca91ad1c92c691d8bc (diff)
downloadmeowcraft-23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a.tar.zst
meowcraft-23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a.zip
Extremely simple chunk-limited lighting
Diffstat (limited to 'src/World/BlockType.hpp')
-rw-r--r--src/World/BlockType.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/World/BlockType.hpp b/src/World/BlockType.hpp
index edca3d7..a63d96a 100644
--- a/src/World/BlockType.hpp
+++ b/src/World/BlockType.hpp
@@ -26,14 +26,18 @@ public:
 
     operator Value() const { return m_block; }
 
-    Bool is_transparent() const {
+    Bool is_translucent() const { return opacity() != 1.0; }
+
+    Real opacity() const {
         switch (m_block) {
         case Air:
-        case Leaves:
+            return 0.0;
         case Water:
-            return true;
+            return 0.05;
+        case Leaves:
+            return 0.2;
         default:
-            return false;
+            return 1.0;
         }
     }