]> git.localhorst.tv Git - blank.git/blobdiff - src/model.hpp
block place/remove timers
[blank.git] / src / model.hpp
index 7b9fc3d1b09cf702109111ae51568e694f45736a..096e1cfd3aff2738f6288a6909c557d227ed3909 100644 (file)
@@ -29,7 +29,7 @@ public:
                Normals normals;
                Indices indices;
 
-               void Clear() {
+               void Clear() noexcept {
                        vertices.clear();
                        colors.clear();
                        normals.clear();
@@ -46,18 +46,18 @@ public:
        };
 
 public:
-       Model();
-       ~Model();
+       Model() noexcept;
+       ~Model() noexcept;
 
        Model(const Model &) = delete;
        Model &operator =(const Model &) = delete;
 
-       Model(Model &&);
-       Model &operator =(Model &&);
+       Model(Model &&) noexcept;
+       Model &operator =(Model &&) noexcept;
 
-       void Update(const Buffer &);
+       void Update(const Buffer &) noexcept;
 
-       void Draw() const;
+       void Draw() const noexcept;
 
 private:
        enum Attribute {
@@ -80,13 +80,11 @@ class BlockModel {
 public:
        using Position = glm::vec3;
        using Color = glm::vec3;
-       using Normal = glm::vec3;
        using Light = float;
        using Index = unsigned int;
 
        using Positions = std::vector<Position>;
        using Colors = std::vector<Color>;
-       using Normals = std::vector<Normal>;
        using Lights = std::vector<Light>;
        using Indices = std::vector<Index>;
 
@@ -95,14 +93,12 @@ public:
 
                Positions vertices;
                Colors colors;
-               Normals normals;
                Lights lights;
                Indices indices;
 
-               void Clear() {
+               void Clear() noexcept {
                        vertices.clear();
                        colors.clear();
-                       normals.clear();
                        lights.clear();
                        indices.clear();
                }
@@ -110,7 +106,6 @@ public:
                void Reserve(size_t p, size_t i) {
                        vertices.reserve(p);
                        colors.reserve(p);
-                       normals.reserve(p);
                        lights.reserve(p);
                        indices.reserve(i);
                }
@@ -118,24 +113,23 @@ public:
        };
 
 public:
-       BlockModel();
-       ~BlockModel();
+       BlockModel() noexcept;
+       ~BlockModel() noexcept;
 
        BlockModel(const BlockModel &) = delete;
        BlockModel &operator =(const Model &) = delete;
 
-       BlockModel(BlockModel &&);
-       BlockModel &operator =(BlockModel &&);
+       BlockModel(BlockModel &&) noexcept;
+       BlockModel &operator =(BlockModel &&) noexcept;
 
-       void Update(const Buffer &);
+       void Update(const Buffer &) noexcept;
 
-       void Draw() const;
+       void Draw() const noexcept;
 
 private:
        enum Attribute {
                ATTRIB_VERTEX,
                ATTRIB_COLOR,
-               ATTRIB_NORMAL,
                ATTRIB_LIGHT,
                ATTRIB_INDEX,
                ATTRIB_COUNT,
@@ -165,21 +159,21 @@ public:
        Indices indices;
 
 public:
-       OutlineModel();
-       ~OutlineModel();
+       OutlineModel() noexcept;
+       ~OutlineModel() noexcept;
 
        OutlineModel(const OutlineModel &) = delete;
        OutlineModel &operator =(const OutlineModel &) = delete;
 
-       void Invalidate() { dirty = true; }
+       void Invalidate() noexcept { dirty = true; }
 
-       void Clear();
+       void Clear() noexcept;
        void Reserve(int vtx_count, int idx_count);
 
-       void Draw();
+       void Draw() noexcept;
 
 private:
-       void Update();
+       void Update() noexcept;
 
 private:
        enum Attribute {