From: Daniel Karbach Date: Tue, 28 Nov 2017 16:10:23 +0000 (+0100) Subject: load resource colors X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=commitdiff_plain;h=f59ca070e1146a3afc5ae11df327dc4cdea1fc8c load resource colors --- diff --git a/assets b/assets index 7703c13..51cf5cf 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 7703c130c0be3b33f4f267d2662f36b999826f33 +Subproject commit 51cf5cf9b1bda806e44dd77fb31041f90d06ce2b diff --git a/src/app/app.cpp b/src/app/app.cpp index fb72801..f2d0e59 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -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 + "'"); } diff --git a/src/world/Resource.hpp b/src/world/Resource.hpp index 492a7f8..3abe8f3 100644 --- a/src/world/Resource.hpp +++ b/src/world/Resource.hpp @@ -1,6 +1,8 @@ #ifndef BLOBS_WORLD_RESOURCE_HPP_ #define BLOBS_WORLD_RESOURCE_HPP_ +#include "../math/glm.hpp" + #include @@ -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); + }; }