aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crepe/ComponentManager.hpp3
-rw-r--r--src/crepe/Script.cpp5
-rw-r--r--src/crepe/Script.h3
-rw-r--r--src/crepe/ScriptSystem.cpp13
-rw-r--r--src/crepe/ScriptSystem.h3
-rw-r--r--src/crepe/System.h7
-rw-r--r--src/crepe/api/BehaviorScript.cpp5
-rw-r--r--src/crepe/api/BehaviorScript.h5
-rw-r--r--src/example/script.cpp9
-rw-r--r--src/readme.md31
10 files changed, 46 insertions, 38 deletions
diff --git a/src/crepe/ComponentManager.hpp b/src/crepe/ComponentManager.hpp
index 084cd33..2ea0c70 100644
--- a/src/crepe/ComponentManager.hpp
+++ b/src/crepe/ComponentManager.hpp
@@ -10,7 +10,8 @@ template <class T, typename... Args>
void ComponentManager::add_component(uint32_t id, Args &&... args) {
using namespace std;
- static_assert(is_base_of<Component, T>::value, "add_component must recieve a derivative class of Component");
+ static_assert(is_base_of<Component, T>::value,
+ "add_component must recieve a derivative class of Component");
// Determine the type of T (this is used as the key of the unordered_map<>)
type_index type = typeid(T);
diff --git a/src/crepe/Script.cpp b/src/crepe/Script.cpp
index 42e3666..3b83b7c 100644
--- a/src/crepe/Script.cpp
+++ b/src/crepe/Script.cpp
@@ -2,6 +2,5 @@
using namespace crepe;
-void Script::init() { }
-void Script::update() { }
-
+void Script::init() {}
+void Script::update() {}
diff --git a/src/crepe/Script.h b/src/crepe/Script.h
index ba4073a..cdd6814 100644
--- a/src/crepe/Script.h
+++ b/src/crepe/Script.h
@@ -12,5 +12,4 @@ protected:
// added event.
};
-}
-
+} // namespace crepe
diff --git a/src/crepe/ScriptSystem.cpp b/src/crepe/ScriptSystem.cpp
index e301c71..988bb71 100644
--- a/src/crepe/ScriptSystem.cpp
+++ b/src/crepe/ScriptSystem.cpp
@@ -4,19 +4,12 @@
using namespace crepe;
-ScriptSystem::ScriptSystem() {
- dbg_trace();
-}
-ScriptSystem::~ScriptSystem() {
- dbg_trace();
-}
+ScriptSystem::ScriptSystem() { dbg_trace(); }
+ScriptSystem::~ScriptSystem() { dbg_trace(); }
ScriptSystem & ScriptSystem::get_instance() {
static ScriptSystem instance;
return instance;
}
-void ScriptSystem::update() {
- dbg_trace();
-}
-
+void ScriptSystem::update() { dbg_trace(); }
diff --git a/src/crepe/ScriptSystem.h b/src/crepe/ScriptSystem.h
index e1ed290..72e360b 100644
--- a/src/crepe/ScriptSystem.h
+++ b/src/crepe/ScriptSystem.h
@@ -14,5 +14,4 @@ private:
~ScriptSystem();
};
-}
-
+} // namespace crepe
diff --git a/src/crepe/System.h b/src/crepe/System.h
index 3fe3d66..ecbb7f5 100644
--- a/src/crepe/System.h
+++ b/src/crepe/System.h
@@ -8,8 +8,8 @@ public:
virtual void update() = 0;
protected:
- System() { };
- virtual ~System() { };
+ System() {};
+ virtual ~System() {};
private:
// singleton
@@ -19,5 +19,4 @@ private:
System & operator=(System &&) = delete;
};
-}
-
+} // namespace crepe
diff --git a/src/crepe/api/BehaviorScript.cpp b/src/crepe/api/BehaviorScript.cpp
index 2dd933e..84bfd4c 100644
--- a/src/crepe/api/BehaviorScript.cpp
+++ b/src/crepe/api/BehaviorScript.cpp
@@ -4,7 +4,4 @@
using namespace crepe::api;
-BehaviorScript::BehaviorScript() {
- dbg_trace();
-}
-
+BehaviorScript::BehaviorScript() { dbg_trace(); }
diff --git a/src/crepe/api/BehaviorScript.h b/src/crepe/api/BehaviorScript.h
index e9542c1..1d05a75 100644
--- a/src/crepe/api/BehaviorScript.h
+++ b/src/crepe/api/BehaviorScript.h
@@ -1,7 +1,7 @@
#pragma once
-#include "../Script.h"
#include "../Component.h"
+#include "../Script.h"
namespace crepe::api {
@@ -13,5 +13,4 @@ protected:
BehaviorScript();
};
-}
-
+} // namespace crepe::api
diff --git a/src/example/script.cpp b/src/example/script.cpp
index 28605c7..a610b83 100644
--- a/src/example/script.cpp
+++ b/src/example/script.cpp
@@ -3,10 +3,10 @@
* Standalone example for usage of the script component and system
*/
-#include <crepe/util/log.h>
-#include <crepe/ScriptSystem.h>
#include <crepe/ComponentManager.h>
#include <crepe/GameObject.h>
+#include <crepe/ScriptSystem.h>
+#include <crepe/util/log.h>
#include <crepe/api/BehaviorScript.h>
@@ -14,9 +14,7 @@ using namespace crepe;
using namespace std;
class MyScript : public api::BehaviorScript {
- void update() {
- dbg_trace();
- }
+ void update() { dbg_trace(); }
};
int main() {
@@ -30,4 +28,3 @@ int main() {
return 0;
}
-
diff --git a/src/readme.md b/src/readme.md
index 1c5d3a2..a4a71e7 100644
--- a/src/readme.md
+++ b/src/readme.md
@@ -2,7 +2,32 @@
This folder contains the crêpe engine source files, unit tests, and some toy
examples. The only target built by default by the CMakeLists.txt in this folder
-is the crêpe shared library object. Unit tests can be built by explicitly
-specifying the target `test_main` when running the build command. Each source
-file in the example/ folder corresponds to a CMake target as well.
+is the crêpe shared library object.
+
+Examples (using Ninja):
+
+```
+$ cmake -B build -G Ninja
+$ ninja -C build
+```
+
+Unit tests can be built by explicitly specifying the target `test_main` when
+running the build command:
+
+```
+$ ninja -C build test_main
+```
+
+Each source file in the example/ folder corresponds to a CMake target as well:
+
+```
+$ ninja -C build audio_internal components_internal
+```
+
+For installing crêpe system-wide after building (install must be run with
+elevated privileges):
+
+```
+# ninja -C build install
+```