]> git.localhorst.tv Git - blobs.git/blobdiff - src/world/Planet.hpp
fun with resources
[blobs.git] / src / world / Planet.hpp
index efc804dae6a88e91cbbacafcbfd2c3cd38798bab..af3b512aea6b058bc97b4dadb7435b0bc65d4347 100644 (file)
@@ -3,19 +3,20 @@
 
 #include "Body.hpp"
 
+#include "Set.hpp"
 #include "Tile.hpp"
 #include "../graphics/glm.hpp"
 #include "../graphics/SimpleVAO.hpp"
 
 #include <cassert>
-#include <memory>
+#include <vector>
 #include <GL/glew.h>
 
 
 namespace blobs {
 namespace world {
 
-struct Tile;
+class TileType;
 
 /// A planet has six surfaces, numbered 0 to 5, each filled with
 /// sidelength² tiles.
@@ -63,12 +64,12 @@ public:
 
        glm::dvec3 TileCenter(int surface, int x, int y) const noexcept;
 
-       void BuildVAOs();
+       void BuildVAO(const Set<TileType> &);
        void Draw(app::Assets &, graphics::Viewport &) override;
 
 private:
        int sidelength;
-       std::unique_ptr<Tile []> tiles;
+       std::vector<Tile> tiles;
 
        struct Attributes {
                glm::vec3 position;
@@ -78,8 +79,8 @@ private:
 
 };
 
-void GenerateEarthlike(Planet &) noexcept;
-void GenerateTest(Planet &) noexcept;
+void GenerateEarthlike(const Set<TileType> &, Planet &) noexcept;
+void GenerateTest(const Set<TileType> &, Planet &) noexcept;
 
 }
 }