aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crepe/Collider.cpp1
-rw-r--r--src/crepe/Collider.h3
-rw-r--r--src/crepe/Component.cpp1
-rw-r--r--src/crepe/Component.h1
-rw-r--r--src/crepe/ComponentManager.h1
-rw-r--r--src/crepe/GameObject.h1
-rw-r--r--src/crepe/Rigidbody.cpp1
-rw-r--r--src/crepe/Rigidbody.h2
-rw-r--r--src/crepe/Sprite.cpp1
-rw-r--r--src/crepe/Sprite.h3
-rw-r--r--src/example/components_internal.cpp47
11 files changed, 27 insertions, 35 deletions
diff --git a/src/crepe/Collider.cpp b/src/crepe/Collider.cpp
index b7040eb..3f12afd 100644
--- a/src/crepe/Collider.cpp
+++ b/src/crepe/Collider.cpp
@@ -3,4 +3,3 @@
using namespace crepe;
Collider::Collider(int size) : size(size) {}
-
diff --git a/src/crepe/Collider.h b/src/crepe/Collider.h
index 666386d..120da05 100644
--- a/src/crepe/Collider.h
+++ b/src/crepe/Collider.h
@@ -11,5 +11,4 @@ public:
int size;
};
-}
-
+} // namespace crepe
diff --git a/src/crepe/Component.cpp b/src/crepe/Component.cpp
index 9a7731a..d14159c 100644
--- a/src/crepe/Component.cpp
+++ b/src/crepe/Component.cpp
@@ -3,4 +3,3 @@
using namespace crepe;
Component::Component() : active(true) {}
-
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index 6e23d93..16a4ce5 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -12,4 +12,3 @@ public:
};
} // namespace crepe
-
diff --git a/src/crepe/ComponentManager.h b/src/crepe/ComponentManager.h
index 9463558..2ab9dc8 100644
--- a/src/crepe/ComponentManager.h
+++ b/src/crepe/ComponentManager.h
@@ -60,4 +60,3 @@ private:
} // namespace crepe
#include "ComponentManager.hpp"
-
diff --git a/src/crepe/GameObject.h b/src/crepe/GameObject.h
index d5a7c36..3588d9a 100644
--- a/src/crepe/GameObject.h
+++ b/src/crepe/GameObject.h
@@ -22,4 +22,3 @@ public:
} // namespace crepe
#include "GameObject.hpp"
-
diff --git a/src/crepe/Rigidbody.cpp b/src/crepe/Rigidbody.cpp
index 1518d28..495d908 100644
--- a/src/crepe/Rigidbody.cpp
+++ b/src/crepe/Rigidbody.cpp
@@ -4,4 +4,3 @@ using namespace crepe;
Rigidbody::Rigidbody(int mass, int gravityScale, int bodyType)
: mass(mass), gravity_scale(gravityScale), body_type(bodyType) {}
-
diff --git a/src/crepe/Rigidbody.h b/src/crepe/Rigidbody.h
index 67edb03..63a8877 100644
--- a/src/crepe/Rigidbody.h
+++ b/src/crepe/Rigidbody.h
@@ -13,4 +13,4 @@ public:
int body_type;
};
-}
+} // namespace crepe
diff --git a/src/crepe/Sprite.cpp b/src/crepe/Sprite.cpp
index c835d83..a5a5e68 100644
--- a/src/crepe/Sprite.cpp
+++ b/src/crepe/Sprite.cpp
@@ -6,4 +6,3 @@ using namespace crepe;
using namespace std;
Sprite::Sprite(string path) : path(path) {}
-
diff --git a/src/crepe/Sprite.h b/src/crepe/Sprite.h
index 029064b..143e702 100644
--- a/src/crepe/Sprite.h
+++ b/src/crepe/Sprite.h
@@ -13,5 +13,4 @@ public:
std::string path;
};
-}
-
+} // namespace crepe
diff --git a/src/example/components_internal.cpp b/src/example/components_internal.cpp
index 4246dd7..54ce295 100644
--- a/src/example/components_internal.cpp
+++ b/src/example/components_internal.cpp
@@ -6,13 +6,13 @@
#include <cassert>
#include <chrono>
-#include <crepe/util/log.h>
+#include <crepe/Collider.h>
+#include <crepe/Component.h>
#include <crepe/ComponentManager.h>
#include <crepe/GameObject.h>
-#include <crepe/Component.h>
-#include <crepe/Sprite.h>
#include <crepe/Rigidbody.h>
-#include <crepe/Collider.h>
+#include <crepe/Sprite.h>
+#include <crepe/util/log.h>
using namespace crepe;
using namespace std;
@@ -24,36 +24,37 @@ int main() {
auto & mgr = ComponentManager::get_instance();
- auto start_adding = chrono::high_resolution_clock::now();
+ auto start_adding = chrono::high_resolution_clock::now();
- GameObject * game_object[OBJ_COUNT];
+ GameObject * game_object[OBJ_COUNT];
- for (int i = 0; i < OBJ_COUNT; ++i) {
- game_object[i] = new GameObject(i, "Name", "Tag", 0);
+ for (int i = 0; i < OBJ_COUNT; ++i) {
+ game_object[i] = new GameObject(i, "Name", "Tag", 0);
- game_object[i]->add_component<Sprite>("test");
- game_object[i]->add_component<Rigidbody>(0, 0, i);
- game_object[i]->add_component<Collider>(i);
- }
+ game_object[i]->add_component<Sprite>("test");
+ game_object[i]->add_component<Rigidbody>(0, 0, i);
+ game_object[i]->add_component<Collider>(i);
+ }
- auto stop_adding = chrono::high_resolution_clock::now();
+ auto stop_adding = chrono::high_resolution_clock::now();
- auto sprites = mgr.get_components_by_type<Sprite>();
- for (auto sprite : sprites) {
+ auto sprites = mgr.get_components_by_type<Sprite>();
+ for (auto sprite : sprites) {
assert(sprite.get().path == "test");
- }
+ }
- auto stop_looping = chrono::high_resolution_clock::now();
+ auto stop_looping = chrono::high_resolution_clock::now();
- for (int i = 0; i < OBJ_COUNT; ++i) {
- delete game_object[i];
- }
+ for (int i = 0; i < OBJ_COUNT; ++i) {
+ delete game_object[i];
+ }
- auto add_time = chrono::duration_cast<chrono::microseconds>(stop_adding - start_adding);
- auto loop_time = chrono::duration_cast<chrono::microseconds>(stop_looping - stop_adding);
+ auto add_time = chrono::duration_cast<chrono::microseconds>(stop_adding
+ - start_adding);
+ auto loop_time = chrono::duration_cast<chrono::microseconds>(stop_looping
+ - stop_adding);
printf("add time: %ldus\n", add_time.count());
printf("loop time: %ldus\n", loop_time.count());
return 0;
}
-