aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-30 16:42:21 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-30 16:42:21 +0100
commit9eff2e24fa4cf0ffad2b47cc922a6558bc1a9fa1 (patch)
treee673cba5f221523d37f51b67a155abfc0c415eb3 /src/crepe/api
parentf7d70abf3fee5933034d93f594f898849c5273ad (diff)
`make format`
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/AudioSource.cpp12
-rw-r--r--src/crepe/api/AudioSource.h4
-rw-r--r--src/crepe/api/LoopManager.cpp5
-rw-r--r--src/crepe/api/LoopManager.h2
-rw-r--r--src/crepe/api/Scene.h3
-rw-r--r--src/crepe/api/Script.cpp1
-rw-r--r--src/crepe/api/Script.h4
7 files changed, 12 insertions, 19 deletions
diff --git a/src/crepe/api/AudioSource.cpp b/src/crepe/api/AudioSource.cpp
index cc70801..7b05cb1 100644
--- a/src/crepe/api/AudioSource.cpp
+++ b/src/crepe/api/AudioSource.cpp
@@ -3,17 +3,13 @@
using namespace crepe;
using namespace std;
-AudioSource::AudioSource(game_object_id_t id, const Asset & src) :
- Component(id),
- source(src)
-{ }
+AudioSource::AudioSource(game_object_id_t id, const Asset & src)
+ : Component(id),
+ source(src) {}
void AudioSource::play(bool looping) {
this->loop = looping;
this->oneshot_play = true;
}
-void AudioSource::stop() {
- this->oneshot_stop = true;
-}
-
+void AudioSource::stop() { this->oneshot_stop = true; }
diff --git a/src/crepe/api/AudioSource.h b/src/crepe/api/AudioSource.h
index 1899c22..63b4bc4 100644
--- a/src/crepe/api/AudioSource.h
+++ b/src/crepe/api/AudioSource.h
@@ -4,8 +4,8 @@
#include "../types.h"
#include "../util/Private.h"
-#include "GameObject.h"
#include "Asset.h"
+#include "GameObject.h"
namespace crepe {
@@ -20,6 +20,7 @@ protected:
AudioSource(game_object_id_t id, const Asset & source);
//! Only ComponentManager can create components
friend class ComponentManager;
+
public:
// But std::unique_ptr needs to be able to destoy this component again
virtual ~AudioSource() = default;
@@ -62,4 +63,3 @@ private:
};
} // namespace crepe
-
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp
index b277185..731cfb7 100644
--- a/src/crepe/api/LoopManager.cpp
+++ b/src/crepe/api/LoopManager.cpp
@@ -22,9 +22,7 @@ LoopManager::LoopManager() {
this->load_system<ScriptSystem>();
}
-void LoopManager::process_input() {
- this->sdl_context.handle_events(this->game_running);
-}
+void LoopManager::process_input() { this->sdl_context.handle_events(this->game_running); }
void LoopManager::start() {
this->setup();
@@ -69,4 +67,3 @@ void LoopManager::render() {
}
void LoopManager::update() {}
-
diff --git a/src/crepe/api/LoopManager.h b/src/crepe/api/LoopManager.h
index 6ea5ccc..d8910a0 100644
--- a/src/crepe/api/LoopManager.h
+++ b/src/crepe/api/LoopManager.h
@@ -2,10 +2,10 @@
#include <memory>
+#include "../facade/SDLContext.h"
#include "../manager/ComponentManager.h"
#include "../manager/SceneManager.h"
#include "../system/System.h"
-#include "../facade/SDLContext.h"
#include "LoopTimer.h"
diff --git a/src/crepe/api/Scene.h b/src/crepe/api/Scene.h
index 66dad17..9f1e8ce 100644
--- a/src/crepe/api/Scene.h
+++ b/src/crepe/api/Scene.h
@@ -2,8 +2,8 @@
#include <string>
-#include "../util/OptionalRef.h"
#include "../manager/Mediator.h"
+#include "../util/OptionalRef.h"
namespace crepe {
@@ -37,6 +37,7 @@ public:
// TODO: Late references should ALWAYS be private! This is currently kept as-is so unit tests
// keep passing, but this reference should not be directly accessible by the user!!!
+
protected:
/**
* \name Late references
diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp
index a27838e..4091fd4 100644
--- a/src/crepe/api/Script.cpp
+++ b/src/crepe/api/Script.cpp
@@ -25,4 +25,3 @@ void Script::set_next_scene(const string & name) {
SceneManager & mgr = mediator.scene_manager;
mgr.set_next_scene(name);
}
-
diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h
index e1f86b2..1b339b0 100644
--- a/src/crepe/api/Script.h
+++ b/src/crepe/api/Script.h
@@ -2,10 +2,10 @@
#include <vector>
+#include "../manager/EventManager.h"
+#include "../manager/Mediator.h"
#include "../types.h"
#include "../util/OptionalRef.h"
-#include "../manager/Mediator.h"
-#include "../manager/EventManager.h"
namespace crepe {