From bc982b84ec3e1085c440e4d5ea1de597aee63565 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 23 Aug 2017 20:44:42 +0100 Subject: Applied more fixes on headers. Passed all headers through clang-tidy and modernize rules. --- include/YAGE/Math/matrix.hpp | 4 ++-- include/YAGE/Physics/particlebody.hpp | 4 ++-- include/YAGE/Physics/rectanglecollider.hpp | 4 ++-- include/YAGE/vertex.hpp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/YAGE/Math/matrix.hpp b/include/YAGE/Math/matrix.hpp index 52536c17..999d4274 100644 --- a/include/YAGE/Math/matrix.hpp +++ b/include/YAGE/Math/matrix.hpp @@ -273,7 +273,7 @@ public: const Type& operator[](int col) const { return this->data_[col]; } - virtual std::string toString() const { + std::string toString() const override override override { std::stringstream ss; ss << "["; for (std::size_t i = 0; i < this->data_.size() - 1; ++i) { @@ -311,7 +311,7 @@ public: }; /// Definition of a 2D vector. -typedef Vector2 Vector2d; +using Vector2d = Vector2; /** Namespace containing functions that operate on matrices. */ namespace matrix { diff --git a/include/YAGE/Physics/particlebody.hpp b/include/YAGE/Physics/particlebody.hpp index ff8b3b85..7894e301 100644 --- a/include/YAGE/Physics/particlebody.hpp +++ b/include/YAGE/Physics/particlebody.hpp @@ -22,8 +22,8 @@ public: bool gravity = true); // apply a force to the rigid body - virtual void applyForce(const Vector2d& force); - virtual void update(); + void applyForce(const Vector2d& force) override override; + void update() override override; }; } // yage diff --git a/include/YAGE/Physics/rectanglecollider.hpp b/include/YAGE/Physics/rectanglecollider.hpp index 7f9dd7f7..b66664a0 100644 --- a/include/YAGE/Physics/rectanglecollider.hpp +++ b/include/YAGE/Physics/rectanglecollider.hpp @@ -19,8 +19,8 @@ class RectangleCollider : public Collider { public: RectangleCollider(const glm::vec2& position, const glm::vec2& size); - virtual bool collides(const Collider& collider) const; - virtual bool inside(const glm::vec2& point) const; + bool collides(const Collider& collider) const override; + bool inside(const glm::vec2& point) const override; }; } // yage diff --git a/include/YAGE/vertex.hpp b/include/YAGE/vertex.hpp index d3355b11..1026253e 100644 --- a/include/YAGE/vertex.hpp +++ b/include/YAGE/vertex.hpp @@ -17,7 +17,7 @@ struct Position { float x; float y; - Position() {} + Position() = default; Position(float x_, float y_) : x(x_), y(y_) {} }; @@ -28,7 +28,7 @@ struct Color { GLubyte b; GLubyte a; - Color() {} + Color() = default; Color(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_) : r(r_), g(g_), b(b_), a(a_) {} @@ -38,7 +38,7 @@ struct UV { float u; float v; - UV() {} + UV() = default; UV(float u_, float v_) : u(u_), v(v_) {} }; @@ -48,7 +48,7 @@ struct Vertex { Color color; UV uv; - Vertex() {} + Vertex() = default; Vertex(const Position& position_, const Color& color_, const UV& uv_) : position(position_), color(color_), uv(uv_) {} -- cgit