diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-09-02 10:31:42 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-09-02 10:31:42 +0100 |
commit | a992108e5b6383450a147a0a0ef54576dca5bd95 (patch) | |
tree | 026f7f166b53ff54bfa3e3fc1e365e709766fd38 | |
parent | 0b1004135890380d2594b4aff3bb2fb17d64b6c4 (diff) | |
download | YAGE-a992108e5b6383450a147a0a0ef54576dca5bd95.tar.gz YAGE-a992108e5b6383450a147a0a0ef54576dca5bd95.zip |
Adding .h file extension to be more consistent.
-rw-r--r-- | CMakeLists.txt | 25 | ||||
-rw-r--r-- | include/YAGE/Math/math.h (renamed from include/YAGE/Math/math.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Math/matrix.h (renamed from include/YAGE/Math/matrix.hpp) | 3 | ||||
-rw-r--r-- | include/YAGE/Physics/body.h (renamed from include/YAGE/Physics/body.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Physics/collider.h (renamed from include/YAGE/Physics/collider.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Physics/collisionbody.h (renamed from include/YAGE/Physics/collisionbody.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Physics/particlebody.h (renamed from include/YAGE/Physics/particlebody.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Physics/physics.h (renamed from include/YAGE/Physics/physics.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Physics/rectanglecollider.h (renamed from include/YAGE/Physics/rectanglecollider.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/Physics/rigidbody.h (renamed from include/YAGE/Physics/rigidbody.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/camera2d.h (renamed from include/YAGE/camera2d.hpp) | 2 | ||||
-rw-r--r-- | include/YAGE/glslprogram.h (renamed from include/YAGE/glslprogram.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/imageloader.h (renamed from include/YAGE/imageloader.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/inputmanager.h (renamed from include/YAGE/inputmanager.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/iomanager.h (renamed from include/YAGE/iomanager.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/picopng.h (renamed from include/YAGE/picopng.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/resourcemanager.h (renamed from include/YAGE/resourcemanager.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/sprite.h (renamed from include/YAGE/sprite.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/spritebatch.h (renamed from include/YAGE/spritebatch.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/texture.h (renamed from include/YAGE/texture.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/texturecache.h (renamed from include/YAGE/texturecache.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/vertex.h (renamed from include/YAGE/vertex.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/window.h (renamed from include/YAGE/window.hpp) | 0 | ||||
-rw-r--r-- | include/YAGE/yage.h (renamed from include/YAGE/yage.hpp) | 0 | ||||
-rw-r--r-- | src/camera2d.cpp | 6 |
25 files changed, 16 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b512a59e..8c0f48ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,18 +84,13 @@ message("${YAGE_LIB_DEP_L}") enable_testing() set(SIMULATION_RUNS 1000) -add_executable(yagetest ${YAGE_TEST_DIR}/yagetest.cpp) -target_link_libraries(yagetest gtest_main ${YAGE_LIB_DEP_L}) -add_test(NAME YageTest COMMAND yagetest --gtest_repeat=10 --gtest_break_on_failure) - -add_executable(matrixtest ${YAGE_TEST_DIR}/matrixtest.cpp) -target_link_libraries(matrixtest gtest_main ${YAGE_LIB_DEP_L}) -add_test(NAME MatrixTest COMMAND matrixtest --gtest_repeat=${SIMULATION_RUNS} --gtest_break_on_failure) - -add_executable(particlebodytest ${YAGE_TEST_DIR}/particlebodytest.cpp) -target_link_libraries(particlebodytest gtest_main ${YAGE_LIB_DEP_L}) -add_test(NAME ParticleBodyTest COMMAND particlebodytest --gtest_repeat=${SIMULATION_RUNS} --gtest_break_on_failure) - -add_executable(windowtest ${YAGE_TEST_DIR}/windowtest.cpp) -target_link_libraries(windowtest gtest_main ${YAGE_LIB_DEP_L}) -add_test(NAME WindowTest COMMAND windowtest --gtest_repeat=${SIMULATION_RUNS} --gtest_break_on_failure) +function(make_test test_name cycles) + add_executable(${test_name} ${YAGE_TEST_DIR}/${test_name}.cpp) + target_link_libraries(${test_name} gtest_main ${YAGE_LIB_DEP_L}) + add_test(NAME ${test_name} COMMAND ${test_name} --gtest_repeat=${cycles} --gtest_break_on_failure) +endfunction(make_test) + +make_test(yagetest 10) +make_test(matrixtest ${SIMULATION_RUNS}) +make_test(particlebodytest ${SIMULATION_RUNS}) +make_test(windowtest ${SIMULATION_RUNS}) diff --git a/include/YAGE/Math/math.hpp b/include/YAGE/Math/math.h index b587cf9f..b587cf9f 100644 --- a/include/YAGE/Math/math.hpp +++ b/include/YAGE/Math/math.h diff --git a/include/YAGE/Math/matrix.hpp b/include/YAGE/Math/matrix.h index 5d9e5d0f..aa78954e 100644 --- a/include/YAGE/Math/matrix.hpp +++ b/include/YAGE/Math/matrix.h @@ -6,7 +6,8 @@ * ---------------------------------------------------------------------------- */ -/// @file +/** @file + */ #ifndef YAGE_MATH_MATRIX_HPP #define YAGE_MATH_MATRIX_HPP diff --git a/include/YAGE/Physics/body.hpp b/include/YAGE/Physics/body.h index c67d2b12..c67d2b12 100644 --- a/include/YAGE/Physics/body.hpp +++ b/include/YAGE/Physics/body.h diff --git a/include/YAGE/Physics/collider.hpp b/include/YAGE/Physics/collider.h index 7b4ff060..7b4ff060 100644 --- a/include/YAGE/Physics/collider.hpp +++ b/include/YAGE/Physics/collider.h diff --git a/include/YAGE/Physics/collisionbody.hpp b/include/YAGE/Physics/collisionbody.h index b7403e81..b7403e81 100644 --- a/include/YAGE/Physics/collisionbody.hpp +++ b/include/YAGE/Physics/collisionbody.h diff --git a/include/YAGE/Physics/particlebody.hpp b/include/YAGE/Physics/particlebody.h index 15f1ae5a..15f1ae5a 100644 --- a/include/YAGE/Physics/particlebody.hpp +++ b/include/YAGE/Physics/particlebody.h diff --git a/include/YAGE/Physics/physics.hpp b/include/YAGE/Physics/physics.h index 8146672a..8146672a 100644 --- a/include/YAGE/Physics/physics.hpp +++ b/include/YAGE/Physics/physics.h diff --git a/include/YAGE/Physics/rectanglecollider.hpp b/include/YAGE/Physics/rectanglecollider.h index f6f6c481..f6f6c481 100644 --- a/include/YAGE/Physics/rectanglecollider.hpp +++ b/include/YAGE/Physics/rectanglecollider.h diff --git a/include/YAGE/Physics/rigidbody.hpp b/include/YAGE/Physics/rigidbody.h index 48ca6761..48ca6761 100644 --- a/include/YAGE/Physics/rigidbody.hpp +++ b/include/YAGE/Physics/rigidbody.h diff --git a/include/YAGE/camera2d.hpp b/include/YAGE/camera2d.h index 354b3a17..ecf819b6 100644 --- a/include/YAGE/camera2d.hpp +++ b/include/YAGE/camera2d.h @@ -20,7 +20,7 @@ namespace yage class Camera2D { private: - bool matrix_needs_update_ = true; + bool update_matrix_ = true; float scale_ = 1; glm::vec2 position_; glm::mat4 camera_matrix_; diff --git a/include/YAGE/glslprogram.hpp b/include/YAGE/glslprogram.h index 154e2e57..154e2e57 100644 --- a/include/YAGE/glslprogram.hpp +++ b/include/YAGE/glslprogram.h diff --git a/include/YAGE/imageloader.hpp b/include/YAGE/imageloader.h index 770307d1..770307d1 100644 --- a/include/YAGE/imageloader.hpp +++ b/include/YAGE/imageloader.h diff --git a/include/YAGE/inputmanager.hpp b/include/YAGE/inputmanager.h index 61c5ce53..61c5ce53 100644 --- a/include/YAGE/inputmanager.hpp +++ b/include/YAGE/inputmanager.h diff --git a/include/YAGE/iomanager.hpp b/include/YAGE/iomanager.h index 4f30e51c..4f30e51c 100644 --- a/include/YAGE/iomanager.hpp +++ b/include/YAGE/iomanager.h diff --git a/include/YAGE/picopng.hpp b/include/YAGE/picopng.h index c0a42c28..c0a42c28 100644 --- a/include/YAGE/picopng.hpp +++ b/include/YAGE/picopng.h diff --git a/include/YAGE/resourcemanager.hpp b/include/YAGE/resourcemanager.h index ebd30476..ebd30476 100644 --- a/include/YAGE/resourcemanager.hpp +++ b/include/YAGE/resourcemanager.h diff --git a/include/YAGE/sprite.hpp b/include/YAGE/sprite.h index 28e13437..28e13437 100644 --- a/include/YAGE/sprite.hpp +++ b/include/YAGE/sprite.h diff --git a/include/YAGE/spritebatch.hpp b/include/YAGE/spritebatch.h index add58b43..add58b43 100644 --- a/include/YAGE/spritebatch.hpp +++ b/include/YAGE/spritebatch.h diff --git a/include/YAGE/texture.hpp b/include/YAGE/texture.h index d2cc3bdd..d2cc3bdd 100644 --- a/include/YAGE/texture.hpp +++ b/include/YAGE/texture.h diff --git a/include/YAGE/texturecache.hpp b/include/YAGE/texturecache.h index 1542ad79..1542ad79 100644 --- a/include/YAGE/texturecache.hpp +++ b/include/YAGE/texturecache.h diff --git a/include/YAGE/vertex.hpp b/include/YAGE/vertex.h index ef379888..ef379888 100644 --- a/include/YAGE/vertex.hpp +++ b/include/YAGE/vertex.h diff --git a/include/YAGE/window.hpp b/include/YAGE/window.h index 51b217f8..51b217f8 100644 --- a/include/YAGE/window.hpp +++ b/include/YAGE/window.h diff --git a/include/YAGE/yage.hpp b/include/YAGE/yage.h index 13d6d560..13d6d560 100644 --- a/include/YAGE/yage.hpp +++ b/include/YAGE/yage.h diff --git a/src/camera2d.cpp b/src/camera2d.cpp index 0ddd454e..7f2dd2d7 100644 --- a/src/camera2d.cpp +++ b/src/camera2d.cpp @@ -22,14 +22,14 @@ Camera2D::Camera2D(int screen_width, int screen_height) void Camera2D::update(GlslProgram &program) { - if (matrix_needs_update_) { + if (update_matrix_) { glm::vec3 translate(-position_.x, -position_.y, 0.f); glm::vec3 scale(scale_, scale_, 0.f); camera_matrix_ = glm::translate(ortho_matrix_, translate); camera_matrix_ = glm::scale(glm::mat4(1.f), scale) * camera_matrix_; - matrix_needs_update_ = false; + update_matrix_ = false; } GLint matrix_location = program.getUniformLocation("P"); @@ -39,7 +39,7 @@ void Camera2D::update(GlslProgram &program) void Camera2D::move(const glm::vec2 &direction) { position_ += direction; - matrix_needs_update_ = true; + update_matrix_ = true; } } // namespace yage |