From 7a8657dfe019104aced61a5b63e63f61ad919f7a Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 2 Dec 2024 16:13:08 +0100 Subject: remove `Private` --- src/crepe/facade/SoundHandle.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/crepe/facade/SoundHandle.h (limited to 'src/crepe/facade/SoundHandle.h') diff --git a/src/crepe/facade/SoundHandle.h b/src/crepe/facade/SoundHandle.h new file mode 100644 index 0000000..131d28c --- /dev/null +++ b/src/crepe/facade/SoundHandle.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace crepe { + +/** + * \brief Voice handle returned by + */ +typedef size_t SoundHandle; + +} + -- cgit v1.2.3 From 1e9e564f3806d07c7b0dc445c4ae2e738350fc83 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 5 Dec 2024 17:12:56 +0100 Subject: `make format` --- src/crepe/api/AudioSource.h | 3 +-- src/crepe/facade/SoundContext.cpp | 1 - src/crepe/facade/SoundContext.h | 3 +-- src/crepe/facade/SoundHandle.h | 3 +-- src/crepe/system/AudioSystem.cpp | 4 +--- src/test/ResourceManagerTest.cpp | 9 ++------- 6 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/crepe/facade/SoundHandle.h') diff --git a/src/crepe/api/AudioSource.h b/src/crepe/api/AudioSource.h index 7c1f161..b20e490 100644 --- a/src/crepe/api/AudioSource.h +++ b/src/crepe/api/AudioSource.h @@ -1,8 +1,8 @@ #pragma once #include "../Component.h" -#include "../types.h" #include "../facade/SoundHandle.h" +#include "../types.h" #include "Asset.h" #include "GameObject.h" @@ -69,7 +69,6 @@ private: //! \} //! This source's voice handle SoundHandle voice{}; - }; } // namespace crepe diff --git a/src/crepe/facade/SoundContext.cpp b/src/crepe/facade/SoundContext.cpp index d18afc6..b1f8cb3 100644 --- a/src/crepe/facade/SoundContext.cpp +++ b/src/crepe/facade/SoundContext.cpp @@ -34,4 +34,3 @@ void SoundContext::set_volume(const SoundHandle & handle, float volume) { void SoundContext::set_loop(const SoundHandle & handle, bool loop) { this->engine.setLooping(this->registry[handle], loop); } - diff --git a/src/crepe/facade/SoundContext.h b/src/crepe/facade/SoundContext.h index 102f928..d986c59 100644 --- a/src/crepe/facade/SoundContext.h +++ b/src/crepe/facade/SoundContext.h @@ -4,8 +4,8 @@ #include "../api/Config.h" -#include "SoundHandle.h" #include "Sound.h" +#include "SoundHandle.h" namespace crepe { @@ -76,7 +76,6 @@ private: std::unordered_map registry; //! Unique handle counter SoundHandle next_handle = 0; - }; } // namespace crepe diff --git a/src/crepe/facade/SoundHandle.h b/src/crepe/facade/SoundHandle.h index 131d28c..b7925fc 100644 --- a/src/crepe/facade/SoundHandle.h +++ b/src/crepe/facade/SoundHandle.h @@ -9,5 +9,4 @@ namespace crepe { */ typedef size_t SoundHandle; -} - +} // namespace crepe diff --git a/src/crepe/system/AudioSystem.cpp b/src/crepe/system/AudioSystem.cpp index c1cde8b..b2c1dc6 100644 --- a/src/crepe/system/AudioSystem.cpp +++ b/src/crepe/system/AudioSystem.cpp @@ -58,8 +58,6 @@ void AudioSystem::update_last(AudioSource & component) { } SoundContext & AudioSystem::get_context() { - if (this->context == nullptr) - this->context = make_unique(); + if (this->context == nullptr) this->context = make_unique(); return *this->context.get(); } - diff --git a/src/test/ResourceManagerTest.cpp b/src/test/ResourceManagerTest.cpp index 0789ef0..44a5921 100644 --- a/src/test/ResourceManagerTest.cpp +++ b/src/test/ResourceManagerTest.cpp @@ -75,12 +75,7 @@ TEST_F(ResourceManagerTest, Persistent) { } TEST_F(ResourceManagerTest, UnmatchedType) { - EXPECT_NO_THROW({ - resource_manager.get(asset_a); - }); + EXPECT_NO_THROW({ resource_manager.get(asset_a); }); - EXPECT_THROW({ - resource_manager.get(asset_a); - }, runtime_error); + EXPECT_THROW({ resource_manager.get(asset_a); }, runtime_error); } - -- cgit v1.2.3