aboutsummaryrefslogtreecommitdiff
path: root/src/crepe
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe')
-rw-r--r--src/crepe/api/Animator.cpp1
-rw-r--r--src/crepe/api/Animator.h2
-rw-r--r--src/crepe/api/Engine.cpp3
-rw-r--r--src/crepe/facade/SignalCatch.cpp9
-rw-r--r--src/crepe/facade/SignalCatch.h3
-rw-r--r--src/crepe/manager/SystemManager.cpp10
-rw-r--r--src/crepe/manager/SystemManager.hpp2
-rw-r--r--src/crepe/system/AnimatorSystem.cpp2
-rw-r--r--src/crepe/system/ScriptSystem.cpp12
9 files changed, 25 insertions, 19 deletions
diff --git a/src/crepe/api/Animator.cpp b/src/crepe/api/Animator.cpp
index 5ac0617..f6f2654 100644
--- a/src/crepe/api/Animator.cpp
+++ b/src/crepe/api/Animator.cpp
@@ -44,4 +44,3 @@ void Animator::set_cycle_range(int start, int end) {
this->data.cycle_start = start;
this->data.cycle_end = end;
}
-
diff --git a/src/crepe/api/Animator.h b/src/crepe/api/Animator.h
index 8be693e..bcf6379 100644
--- a/src/crepe/api/Animator.h
+++ b/src/crepe/api/Animator.h
@@ -1,7 +1,7 @@
#pragma once
-#include "../types.h"
#include "../manager/LoopTimerManager.h"
+#include "../types.h"
#include "Component.h"
#include "Sprite.h"
diff --git a/src/crepe/api/Engine.cpp b/src/crepe/api/Engine.cpp
index bf3f50c..8766aea 100644
--- a/src/crepe/api/Engine.cpp
+++ b/src/crepe/api/Engine.cpp
@@ -1,7 +1,7 @@
#include <segvcatch.h>
-#include "../util/Log.h"
#include "../facade/SignalCatch.h"
+#include "../util/Log.h"
#include "Engine.h"
@@ -77,4 +77,3 @@ void Engine::frame_update() {
this->system_manager.frame_update();
this->loop_timer.enforce_frame_rate();
}
-
diff --git a/src/crepe/facade/SignalCatch.cpp b/src/crepe/facade/SignalCatch.cpp
index ad92d28..4988047 100644
--- a/src/crepe/facade/SignalCatch.cpp
+++ b/src/crepe/facade/SignalCatch.cpp
@@ -15,11 +15,6 @@ SignalCatch::~SignalCatch() {
segvcatch::init_fpe();
}
-void SignalCatch::segv() {
- throw runtime_error("segmentation fault");
-}
-
-void SignalCatch::fpe() {
- throw domain_error("floating point exception");
-}
+void SignalCatch::segv() { throw runtime_error("segmentation fault"); }
+void SignalCatch::fpe() { throw domain_error("floating point exception"); }
diff --git a/src/crepe/facade/SignalCatch.h b/src/crepe/facade/SignalCatch.h
index 4562215..cf86b56 100644
--- a/src/crepe/facade/SignalCatch.h
+++ b/src/crepe/facade/SignalCatch.h
@@ -20,5 +20,4 @@ public:
SignalCatch & operator=(SignalCatch &&) = delete;
};
-}
-
+} // namespace crepe
diff --git a/src/crepe/manager/SystemManager.cpp b/src/crepe/manager/SystemManager.cpp
index c8f4f3d..fea59aa 100644
--- a/src/crepe/manager/SystemManager.cpp
+++ b/src/crepe/manager/SystemManager.cpp
@@ -37,7 +37,10 @@ void SystemManager::fixed_update() noexcept {
try {
entry.system.fixed_update();
} catch (const exception & e) {
- Log::logf(Log::Level::WARNING, "Uncaught exception in {} fixed update: {}", entry.name, e.what());
+ Log::logf(
+ Log::Level::WARNING, "Uncaught exception in {} fixed update: {}", entry.name,
+ e.what()
+ );
}
}
}
@@ -48,7 +51,10 @@ void SystemManager::frame_update() noexcept {
try {
entry.system.frame_update();
} catch (const exception & e) {
- Log::logf(Log::Level::WARNING, "Uncaught exception in {} frame update: {}", entry.name, e.what());
+ Log::logf(
+ Log::Level::WARNING, "Uncaught exception in {} frame update: {}", entry.name,
+ e.what()
+ );
}
}
}
diff --git a/src/crepe/manager/SystemManager.hpp b/src/crepe/manager/SystemManager.hpp
index a4c11e3..a19a253 100644
--- a/src/crepe/manager/SystemManager.hpp
+++ b/src/crepe/manager/SystemManager.hpp
@@ -38,7 +38,7 @@ void SystemManager::load_system() {
throw runtime_error(format("SystemManager: {} is already initialized", type.name()));
System * system = new T(this->mediator);
this->systems[type] = unique_ptr<System>(system);
- this->system_order.push_back(SystemEntry{
+ this->system_order.push_back(SystemEntry {
.system = *this->systems[type],
.name = type.name(),
});
diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp
index 467d2a2..6c93372 100644
--- a/src/crepe/system/AnimatorSystem.cpp
+++ b/src/crepe/system/AnimatorSystem.cpp
@@ -30,7 +30,7 @@ void AnimatorSystem::frame_update() {
if (animator.elapsed > frame_duration) {
animator.elapsed = 0ms;
animator.data.frame++;
-
+
if (animator.data.looping && animator.data.frame >= animator.data.cycle_end)
animator.data.frame = animator.data.cycle_start;
}
diff --git a/src/crepe/system/ScriptSystem.cpp b/src/crepe/system/ScriptSystem.cpp
index 411a9a3..f1e31f9 100644
--- a/src/crepe/system/ScriptSystem.cpp
+++ b/src/crepe/system/ScriptSystem.cpp
@@ -36,7 +36,11 @@ void ScriptSystem::update(
script->init();
script->initialized = true;
} catch (const exception & e) {
- Log::logf(Log::Level::WARNING, "Disabled script \"{}\" due to exception in init function: {}", behavior_script.name, e.what());
+ Log::logf(
+ Log::Level::WARNING,
+ "Disabled script \"{}\" due to exception in init function: {}",
+ behavior_script.name, e.what()
+ );
behavior_script.active = false;
}
}
@@ -45,7 +49,11 @@ void ScriptSystem::update(
(*script.*update_function)(delta_time);
} catch (const exception & e) {
// TODO: discern between fixed/frame update
- Log::logf(Log::Level::WARNING, "Disabled script \"{}\" due to exception in update function: {}", behavior_script.name, e.what());
+ Log::logf(
+ Log::Level::WARNING,
+ "Disabled script \"{}\" due to exception in update function: {}",
+ behavior_script.name, e.what()
+ );
behavior_script.active = false;
}
}