aboutsummaryrefslogtreecommitdiffstats
path: root/src/sprite.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-08-23 20:33:34 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-08-23 20:33:34 +0100
commit56b5466f014d9f7c3662544713bd53670cd8e32f (patch)
tree479658b1424c53d3e1ceaadb16b095bb34531520 /src/sprite.cpp
parent34f910351863163438c419dd07045f1442321293 (diff)
downloadYAGE-56b5466f014d9f7c3662544713bd53670cd8e32f.tar.gz
YAGE-56b5466f014d9f7c3662544713bd53670cd8e32f.zip
Applied modernize rules and fixed build.
Applied clang-tidy modernize rules and fixed the CMakeLists.txt file so that it also linked against the SDL2 library.
Diffstat (limited to 'src/sprite.cpp')
-rw-r--r--src/sprite.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sprite.cpp b/src/sprite.cpp
index e3d74982..4cdd2ecf 100644
--- a/src/sprite.cpp
+++ b/src/sprite.cpp
@@ -14,7 +14,7 @@
namespace yage {
-Sprite::Sprite() {}
+Sprite::Sprite() = default;
Sprite::~Sprite() {
if (vbo_id_ != 0) glDeleteBuffers(1, &vbo_id_);
@@ -50,7 +50,7 @@ void Sprite::init(float x, float y, float width, float height,
vertex_data[5].setPosition(x + width, y);
vertex_data[5].setUv(1.f, 0.f);
- for (int i = 0; i < 6; ++i) vertex_data[i].setColor(255, 0, 255, 255);
+ for (auto & i : vertex_data) i.setColor(255, 0, 255, 255);
vertex_data[1].setColor(0, 255, 255, 255);
vertex_data[4].setColor(255, 0, 0, 255);