aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
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/system
parentf7d70abf3fee5933034d93f594f898849c5273ad (diff)
`make format`
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/AudioSystem.cpp10
-rw-r--r--src/crepe/system/AudioSystem.h6
-rw-r--r--src/crepe/system/PhysicsSystem.cpp2
-rw-r--r--src/crepe/system/RenderSystem.cpp2
-rw-r--r--src/crepe/system/ScriptSystem.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/crepe/system/AudioSystem.cpp b/src/crepe/system/AudioSystem.cpp
index 84a101a..0696b34 100644
--- a/src/crepe/system/AudioSystem.cpp
+++ b/src/crepe/system/AudioSystem.cpp
@@ -10,7 +10,8 @@ using namespace std;
void AudioSystem::update() {
ComponentManager & component_manager = this->mediator.component_manager;
ResourceManager & resource_manager = this->mediator.resource_manager;
- RefVector<AudioSource> components = component_manager.get_components_by_type<AudioSource>();
+ RefVector<AudioSource> components
+ = component_manager.get_components_by_type<AudioSource>();
for (AudioSource & component : components) {
Sound & resource = resource_manager.get<Sound>(component.source);
@@ -28,7 +29,8 @@ void AudioSystem::update() {
}
}
-void AudioSystem::diff_update(AudioSource & component, ComponentPrivate & data, Sound & resource) {
+void AudioSystem::diff_update(AudioSource & component, ComponentPrivate & data,
+ Sound & resource) {
SoundContext & context = this->get_context();
if (component.active != data.last_active) {
@@ -64,8 +66,6 @@ void AudioSystem::update_last(const AudioSource & component, ComponentPrivate &
}
SoundContext & AudioSystem::get_context() {
- if (this->context.empty())
- this->context.set<SoundContext>();
+ if (this->context.empty()) this->context.set<SoundContext>();
return this->context.get<SoundContext>();
}
-
diff --git a/src/crepe/system/AudioSystem.h b/src/crepe/system/AudioSystem.h
index a004c60..c941470 100644
--- a/src/crepe/system/AudioSystem.h
+++ b/src/crepe/system/AudioSystem.h
@@ -1,8 +1,8 @@
#pragma once
-#include "../facade/SoundContext.h"
-#include "../facade/Sound.h"
#include "../api/AudioSource.h"
+#include "../facade/Sound.h"
+#include "../facade/SoundContext.h"
#include "System.h"
@@ -37,9 +37,9 @@ private:
protected:
virtual SoundContext & get_context();
+
private:
Private context;
};
} // namespace crepe
-
diff --git a/src/crepe/system/PhysicsSystem.cpp b/src/crepe/system/PhysicsSystem.cpp
index eba9dfa..bebcf3d 100644
--- a/src/crepe/system/PhysicsSystem.cpp
+++ b/src/crepe/system/PhysicsSystem.cpp
@@ -1,10 +1,10 @@
#include <cmath>
-#include "../manager/ComponentManager.h"
#include "../api/Config.h"
#include "../api/Rigidbody.h"
#include "../api/Transform.h"
#include "../api/Vector2.h"
+#include "../manager/ComponentManager.h"
#include "PhysicsSystem.h"
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index 4e97b3e..0ad685c 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -5,12 +5,12 @@
#include <stdexcept>
#include <vector>
-#include "../manager/ComponentManager.h"
#include "../api/Camera.h"
#include "../api/ParticleEmitter.h"
#include "../api/Sprite.h"
#include "../api/Transform.h"
#include "../facade/SDLContext.h"
+#include "../manager/ComponentManager.h"
#include "RenderSystem.h"
diff --git a/src/crepe/system/ScriptSystem.cpp b/src/crepe/system/ScriptSystem.cpp
index 2e16eb0..d6b2ca1 100644
--- a/src/crepe/system/ScriptSystem.cpp
+++ b/src/crepe/system/ScriptSystem.cpp
@@ -1,6 +1,6 @@
-#include "../manager/ComponentManager.h"
#include "../api/BehaviorScript.h"
#include "../api/Script.h"
+#include "../manager/ComponentManager.h"
#include "ScriptSystem.h"