aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-12-23 01:42:15 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-12-23 01:42:15 +0000
commitcf4c73f2a75b470a4d4c4167105f92bc46f1926c (patch)
treea697de87564846e784fd1256d71c94270d8ec51d
parent278757a11e50e94e234f339d9d072a0d837dcb06 (diff)
parentddd26ed83d3ac0335562f762ced273a1d62bd959 (diff)
downloadYAGE-0.1.3.tar.gz
YAGE-0.1.3.zip
Merge branch 'develop'v0.1.3
-rw-r--r--tests/active/test.cpp2
-rw-r--r--tests/log/test.cpp2
-rw-r--r--tests/matrix/test.cpp2
-rw-r--r--tests/particlebody/test.cpp4
-rw-r--r--tests/spritesheet/test.cpp2
-rw-r--r--tests/struct/test.cpp2
-rw-r--r--tests/syncqueue/test.cpp2
-rw-r--r--tests/thread/test.cpp2
-rw-r--r--tests/vector3/test.cpp10
-rw-r--r--tests/vector4/test.cpp10
-rw-r--r--tests/window/test.cpp2
-rw-r--r--tests/yage/test.cpp2
-rw-r--r--yage/core/camera.cpp (renamed from yage/core/camera2d.cpp)5
-rw-r--r--yage/core/camera.h (renamed from yage/core/camera2d.h)5
-rw-r--r--yage/core/glslprogram.h10
-rw-r--r--yage/core/input.h8
-rw-r--r--yage/core/inputmanager.cpp33
-rw-r--r--yage/core/inputmanager.h30
-rw-r--r--yage/core/logger.cpp2
-rw-r--r--yage/core/logsink.cpp4
-rw-r--r--yage/core/logsink.h2
-rw-r--r--yage/core/sprite.cpp8
-rw-r--r--yage/core/sprite.h4
-rw-r--r--yage/core/spritebatch.h2
-rw-r--r--yage/core/spritesheet.cpp2
-rw-r--r--yage/core/window.h6
-rw-r--r--yage/physics/body.h2
-rw-r--r--yage/physics/particlebody.h2
-rw-r--r--yage/util/syncqueue.h2
-rw-r--r--yage/yage.h4
30 files changed, 59 insertions, 114 deletions
diff --git a/tests/active/test.cpp b/tests/active/test.cpp
index 3d561283..d907a1cc 100644
--- a/tests/active/test.cpp
+++ b/tests/active/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: activetest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/log/test.cpp b/tests/log/test.cpp
index e1010754..53c2894b 100644
--- a/tests/log/test.cpp
+++ b/tests/log/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: logtest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/matrix/test.cpp b/tests/matrix/test.cpp
index 1e316502..022775af 100644
--- a/tests/matrix/test.cpp
+++ b/tests/matrix/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: matrixtest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/particlebody/test.cpp b/tests/particlebody/test.cpp
index 09277826..65c26d5d 100644
--- a/tests/particlebody/test.cpp
+++ b/tests/particlebody/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: particlebodytest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -26,7 +26,7 @@ double gravityAcceleration(int iterations)
TEST(ParticleBody, Gravity)
{
- int randomItr = rand() % 10;
+ int randomItr = rand() % 10;
double idealPosition = 0.5 * -9.81 * std::pow(randomItr, 2);
ASSERT_GE(idealPosition * 0.95, gravityAcceleration(randomItr));
diff --git a/tests/spritesheet/test.cpp b/tests/spritesheet/test.cpp
index fcfc842c..4d4cc1a4 100644
--- a/tests/spritesheet/test.cpp
+++ b/tests/spritesheet/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: spritesheettest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/struct/test.cpp b/tests/struct/test.cpp
index 99752abb..0288f06b 100644
--- a/tests/struct/test.cpp
+++ b/tests/struct/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: structtest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/syncqueue/test.cpp b/tests/syncqueue/test.cpp
index 1d7d8037..f5c7d7c3 100644
--- a/tests/syncqueue/test.cpp
+++ b/tests/syncqueue/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: syncqueuetest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/thread/test.cpp b/tests/thread/test.cpp
index 0527665a..c9178abd 100644
--- a/tests/thread/test.cpp
+++ b/tests/thread/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: threadtest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/vector3/test.cpp b/tests/vector3/test.cpp
index 570a5c10..e65d29f1 100644
--- a/tests/vector3/test.cpp
+++ b/tests/vector3/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: vector3test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -7,7 +7,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector3test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -15,7 +15,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector3test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -23,7 +23,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector3test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -31,7 +31,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector3test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/vector4/test.cpp b/tests/vector4/test.cpp
index 53554a25..6ef5462d 100644
--- a/tests/vector4/test.cpp
+++ b/tests/vector4/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: vector4test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -7,7 +7,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector4test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -15,7 +15,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector4test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -23,7 +23,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector4test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -31,7 +31,7 @@
*/
/** ---------------------------------------------------------------------------
- * @file: vector4test.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/window/test.cpp b/tests/window/test.cpp
index 40b7e664..d9402d49 100644
--- a/tests/window/test.cpp
+++ b/tests/window/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: windowtest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/tests/yage/test.cpp b/tests/yage/test.cpp
index a599eba2..8129306b 100644
--- a/tests/yage/test.cpp
+++ b/tests/yage/test.cpp
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: yagetest.cpp
+ * @file: test.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
diff --git a/yage/core/camera2d.cpp b/yage/core/camera.cpp
index 463dd0d2..71938cbb 100644
--- a/yage/core/camera2d.cpp
+++ b/yage/core/camera.cpp
@@ -1,15 +1,16 @@
/** ---------------------------------------------------------------------------
- * @file: camera2d.cpp
+ * @file: camera.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
* ----------------------------------------------------------------------------
*/
-#include "camera2d.h"
+#include "camera.h"
#include "glslprogram.h"
#include <glad/glad.h>
+#include <glm/gtc/matrix_transform.hpp>
namespace yage
{
diff --git a/yage/core/camera2d.h b/yage/core/camera.h
index 109333d6..8ebe5d2a 100644
--- a/yage/core/camera2d.h
+++ b/yage/core/camera.h
@@ -1,5 +1,5 @@
/** ---------------------------------------------------------------------------
- * @file: camera2d.h
+ * @file: camera.h
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -10,7 +10,6 @@
#define YAGE_CAMERA2D_H
#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
namespace yage
{
@@ -21,7 +20,7 @@ class Camera
{
private:
bool update_matrix_ = true;
- float scale_ = 1;
+ float scale_ = 1;
glm::vec2 position_;
glm::mat4 camera_matrix_;
glm::mat4 ortho_matrix_;
diff --git a/yage/core/glslprogram.h b/yage/core/glslprogram.h
index 9e49d329..0617bc1e 100644
--- a/yage/core/glslprogram.h
+++ b/yage/core/glslprogram.h
@@ -19,9 +19,9 @@ namespace yage
class GlslProgram
{
public:
- GlslProgram() = default;
+ GlslProgram() = default;
GlslProgram(const GlslProgram &) = delete;
- GlslProgram(GlslProgram &&) = delete;
+ GlslProgram(GlslProgram &&) = delete;
~GlslProgram();
GlslProgram &operator=(const GlslProgram &) = delete;
@@ -42,10 +42,10 @@ public:
private:
/// compiled shader program id
- GLuint program_id_ = 0;
- GLuint vertex_shader_id_ = 0;
+ GLuint program_id_ = 0;
+ GLuint vertex_shader_id_ = 0;
GLuint fragment_shader_id_ = 0;
- int attribute_index_ = 0;
+ int attribute_index_ = 0;
/// compiles one shader
void compileShader(GLuint shader, const std::string &shaderContent);
diff --git a/yage/core/input.h b/yage/core/input.h
index 3882e11c..125f4296 100644
--- a/yage/core/input.h
+++ b/yage/core/input.h
@@ -1,3 +1,11 @@
+/** ---------------------------------------------------------------------------
+ * @file: input.h
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
+ * MIT License, see LICENSE file for more details.
+ * ----------------------------------------------------------------------------
+ */
+
#ifndef YAGE_CORE_INPUT_H
#define YAGE_CORE_INPUT_H
diff --git a/yage/core/inputmanager.cpp b/yage/core/inputmanager.cpp
deleted file mode 100644
index 1f324b9e..00000000
--- a/yage/core/inputmanager.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/** ---------------------------------------------------------------------------
- * @file: inputmanager.cpp
- *
- * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
- * MIT License, see LICENSE file for more details.
- * ----------------------------------------------------------------------------
- */
-
-#include <yage/core/inputmanager.h>
-
-namespace yage
-{
-
-void InputManager::keyPressed(unsigned key)
-{
- key_map_[key] = true;
-}
-
-void InputManager::keyReleased(unsigned key)
-{
- key_map_[key] = false;
-}
-
-bool InputManager::isKeyPressed(unsigned key) const
-{
- auto key_index = key_map_.find(key);
- if (key_index != key_map_.end()) {
- return key_index->second;
- }
- return false;
-}
-
-} // namespace yage
diff --git a/yage/core/inputmanager.h b/yage/core/inputmanager.h
deleted file mode 100644
index e8dd153a..00000000
--- a/yage/core/inputmanager.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/** ---------------------------------------------------------------------------
- * @file: inputmanager.h
- *
- * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
- * MIT License, see LICENSE file for more details.
- * ----------------------------------------------------------------------------
- */
-
-#ifndef INPUT_MANAGER_H
-#define INPUT_MANAGER_H
-
-#include <unordered_map>
-
-namespace yage
-{
-
-class InputManager
-{
-private:
- std::unordered_map<unsigned, bool> key_map_;
-
-public:
- void keyPressed(unsigned key);
- void keyReleased(unsigned key);
- bool isKeyPressed(unsigned key) const;
-};
-
-} // namespace yage
-
-#endif
diff --git a/yage/core/logger.cpp b/yage/core/logger.cpp
index 4690fadc..f661e826 100644
--- a/yage/core/logger.cpp
+++ b/yage/core/logger.cpp
@@ -35,7 +35,7 @@ void Logger::flush(const LogMessage *msg)
std::string asString(msg->buffer_.str());
auto &&sinks = sinks_;
- auto &&meta = msg->meta_;
+ auto &&meta = msg->meta_;
active_->send([=] {
for (auto &&sink : sinks) {
diff --git a/yage/core/logsink.cpp b/yage/core/logsink.cpp
index 36d7038b..6680c773 100644
--- a/yage/core/logsink.cpp
+++ b/yage/core/logsink.cpp
@@ -78,8 +78,8 @@ public:
{
using namespace std::chrono;
- auto now = system_clock::now();
- auto time_t = system_clock::to_time_t(now);
+ auto now = system_clock::now();
+ auto time_t = system_clock::to_time_t(now);
auto local_time = std::localtime(&time_t);
(*fileHandle_) << std::put_time(local_time, "[%H:%M:%S] ") << msg
diff --git a/yage/core/logsink.h b/yage/core/logsink.h
index 63f95655..16812b16 100644
--- a/yage/core/logsink.h
+++ b/yage/core/logsink.h
@@ -39,7 +39,7 @@ private:
struct Concept {
virtual ~Concept() = default;
- virtual Concept *clone() const = 0;
+ virtual Concept *clone() const = 0;
virtual void write(const LogMessage::Meta &meta,
const std::string &msg) const = 0;
};
diff --git a/yage/core/sprite.cpp b/yage/core/sprite.cpp
index a663c379..6862f910 100644
--- a/yage/core/sprite.cpp
+++ b/yage/core/sprite.cpp
@@ -25,10 +25,10 @@ Sprite::~Sprite()
void Sprite::init(float x, float y, float width, float height,
const std::string &texture_path)
{
- x_ = x;
- y_ = y;
- width_ = width;
- height_ = height;
+ x_ = x;
+ y_ = y;
+ width_ = width;
+ height_ = height;
texture_ = ResourceManager::getTexture(texture_path);
if (vbo_id_ == 0) {
diff --git a/yage/core/sprite.h b/yage/core/sprite.h
index 35997195..852f4f28 100644
--- a/yage/core/sprite.h
+++ b/yage/core/sprite.h
@@ -31,9 +31,9 @@ private:
Texture texture_;
public:
- Sprite() = default;
+ Sprite() = default;
Sprite(const Sprite &) = delete;
- Sprite(Sprite &&) = delete;
+ Sprite(Sprite &&) = delete;
~Sprite();
Sprite &operator=(const Sprite &) = delete;
diff --git a/yage/core/spritebatch.h b/yage/core/spritebatch.h
index fa93c5cb..c16b44f6 100644
--- a/yage/core/spritebatch.h
+++ b/yage/core/spritebatch.h
@@ -82,7 +82,7 @@ private:
public:
SpriteBatch();
SpriteBatch(const SpriteBatch &) = delete;
- SpriteBatch(SpriteBatch &&) = delete;
+ SpriteBatch(SpriteBatch &&) = delete;
~SpriteBatch();
SpriteBatch &operator=(const SpriteBatch &) = delete;
diff --git a/yage/core/spritesheet.cpp b/yage/core/spritesheet.cpp
index 7fbd19e9..4ecdcf71 100644
--- a/yage/core/spritesheet.cpp
+++ b/yage/core/spritesheet.cpp
@@ -55,7 +55,7 @@ SpriteMap SpriteSheet::parseJson(int &width, int &height,
Document jsonAtlas;
jsonAtlas.Parse(jsonContent.c_str());
- width = jsonAtlas["width"].GetInt();
+ width = jsonAtlas["width"].GetInt();
height = jsonAtlas["height"].GetInt();
for (auto &texture : jsonAtlas["sprites"].GetObject()) {
diff --git a/yage/core/window.h b/yage/core/window.h
index c350955e..5c16c172 100644
--- a/yage/core/window.h
+++ b/yage/core/window.h
@@ -23,8 +23,8 @@ namespace yage
// window flags that can change it's appearance
enum WindowFlags : unsigned {
- SHOWN = 0x1,
- HIDDEN = 0x2,
+ SHOWN = 0x1,
+ HIDDEN = 0x2,
FULLSCREEN = 0x4,
BORDERLESS = 0x8,
};
@@ -39,7 +39,7 @@ private:
public:
Window();
Window(const Window &) = delete;
- Window(Window &&) = delete;
+ Window(Window &&) = delete;
/// destroys the window handle
~Window();
diff --git a/yage/physics/body.h b/yage/physics/body.h
index 0a6bbe42..62173987 100644
--- a/yage/physics/body.h
+++ b/yage/physics/body.h
@@ -42,7 +42,7 @@ protected:
public:
// apply force to the object and update the velocity
virtual void applyForce(const Vector2d &force) = 0;
- virtual void update() = 0;
+ virtual void update() = 0;
double xPosition() const;
double yPosition() const;
diff --git a/yage/physics/particlebody.h b/yage/physics/particlebody.h
index 3978da77..d4380695 100644
--- a/yage/physics/particlebody.h
+++ b/yage/physics/particlebody.h
@@ -20,7 +20,7 @@ class ParticleBody : public Body
public:
ParticleBody(const Vector2d &position = Vector2d(0, 0), double mass = 1,
const Vector2d &velocity = Vector2d(0, 0),
- bool gravity = true);
+ bool gravity = true);
// apply a force to the rigid body
void applyForce(const Vector2d &force) override;
diff --git a/yage/util/syncqueue.h b/yage/util/syncqueue.h
index f1c7d65d..7b5e5680 100644
--- a/yage/util/syncqueue.h
+++ b/yage/util/syncqueue.h
@@ -20,7 +20,7 @@ template <typename T>
class SyncQueue
{
public:
- SyncQueue() = default;
+ SyncQueue() = default;
SyncQueue(const SyncQueue &) = delete;
SyncQueue &operator=(const SyncQueue &) = delete;
diff --git a/yage/yage.h b/yage/yage.h
index 3e8ac47b..de6864eb 100644
--- a/yage/yage.h
+++ b/yage/yage.h
@@ -9,10 +9,10 @@
#ifndef YAGE_YAGE_H
#define YAGE_YAGE_H
-#include "core/camera2d.h"
+#include "core/camera.h"
#include "core/glslprogram.h"
#include "core/imageloader.h"
-#include "core/inputmanager.h"
+#include "core/input.h"
#include "core/iomanager.h"
#include "core/logger.h"
#include "core/logmessage.h"