]> git.localhorst.tv Git - blobs.git/commitdiff
load resource colors
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 28 Nov 2017 16:10:23 +0000 (17:10 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 28 Nov 2017 16:10:23 +0000 (17:10 +0100)
assets
src/app/app.cpp
src/world/Resource.hpp

diff --git a/assets b/assets
index 7703c130c0be3b33f4f267d2662f36b999826f33..51cf5cf9b1bda806e44dd77fb31041f90d06ce2b 160000 (submodule)
--- a/assets
+++ b/assets
@@ -1 +1 @@
-Subproject commit 7703c130c0be3b33f4f267d2662f36b999826f33
+Subproject commit 51cf5cf9b1bda806e44dd77fb31041f90d06ce2b
index fb7280194a7f5ffda1b27ce89075899b74f8255e..f2d0e5904d209ccba1113692877974e36e884ac8 100644 (file)
@@ -267,6 +267,8 @@ void Assets::ReadResources(io::TokenStreamReader &in) {
                                } else {
                                        throw std::runtime_error("unknown resource state '" + name + "'");
                                }
+                       } else if (name == "base_color") {
+                               in.ReadVec(data.resources[id].base_color);
                        } else {
                                throw std::runtime_error("unknown resource property '" + name + "'");
                        }
index 492a7f81f1d21a5a4cb90cbf89cfefed02a2760f..3abe8f3b83c11f4b5fb57d2b8304bf46d83eab2c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef BLOBS_WORLD_RESOURCE_HPP_
 #define BLOBS_WORLD_RESOURCE_HPP_
 
+#include "../math/glm.hpp"
+
 #include <string>
 
 
@@ -9,8 +11,8 @@ namespace world {
 
 struct Resource {
 
-       std::string name;
-       std::string label;
+       std::string name = "";
+       std::string label = "";
 
        double density = 1.0;
 
@@ -26,6 +28,8 @@ struct Resource {
        // TODO: something about temperature and pressure and stuff
        int state = SOLID;
 
+       glm::dvec3 base_color = glm::dvec3(1.0);
+
 };
 
 }