diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-14 01:10:55 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-14 01:10:55 -0400 |
commit | bccf02982941feaf93ba94a29644eb5559a11655 (patch) | |
tree | e8749edfb35e7907238feec513cf9b73ffc1aecb /src/world.hpp | |
parent | d4d9e0d35a1609c72ea65df95e9c3ce5706e221f (diff) |
World can now generate its own mesh
Diffstat (limited to 'src/world.hpp')
-rw-r--r-- | src/world.hpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/world.hpp b/src/world.hpp index 7a7461f..cea599b 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -28,6 +28,13 @@ #include "texture.hpp" +struct WorldMeshData +{ + float posX, posY, posZ; + float texX, texY; + float transparency; +}; + struct WorldMaterial { bool passable = false; @@ -59,12 +66,12 @@ private: unsigned int height; unsigned int width; - std::vector<std::vector<std::vector<unsigned int>>> data; + std::vector<std::vector<std::vector<int>>> data; - std::unordered_map<std::string, unsigned int> string_registry; + std::unordered_map<std::string, int> string_registry; std::vector<WorldMaterial> registry; - std::vector<float> mesh; + std::basic_string<WorldMeshData> mesh; public: /* VARS */ sol::function generate; @@ -79,10 +86,6 @@ public: data.clear(); } - /* SEED */ - unsigned int getSeed(); - unsigned int setSeed(unsigned int); - /* REGISTRY */ void registerMaterial(std::string, sol::object); @@ -97,6 +100,10 @@ public: /* RENDERING */ void generateMesh(); + + /* SEED */ + unsigned int getSeed(); + unsigned int setSeed(unsigned int); }; /** |