diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-01 17:27:14 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-01 17:27:14 +0200 |
commit | 65eda52aa51017f6f7aad158c4f8b6e91054cf0d (patch) | |
tree | a668f9374ef61a502bf691e3b13510d1dc9efca9 /src/crepe | |
parent | 8e67adc6828181b1df7c95da76f32962444fc7fd (diff) |
`make format`
Diffstat (limited to 'src/crepe')
-rw-r--r-- | src/crepe/Sound.cpp | 1 | ||||
-rw-r--r-- | src/crepe/Sound.h | 3 | ||||
-rw-r--r-- | src/crepe/SoundContext.cpp | 1 | ||||
-rw-r--r-- | src/crepe/SoundContext.h | 7 | ||||
-rw-r--r-- | src/crepe/api/AudioSource.cpp | 5 | ||||
-rw-r--r-- | src/crepe/api/AudioSource.h | 3 | ||||
-rw-r--r-- | src/crepe/api/Component.h | 3 | ||||
-rw-r--r-- | src/crepe/api/Resource.cpp | 9 | ||||
-rw-r--r-- | src/crepe/api/Resource.h | 5 | ||||
-rw-r--r-- | src/crepe/util/color.h | 3 | ||||
-rw-r--r-- | src/crepe/util/log.cpp | 1 | ||||
-rw-r--r-- | src/crepe/util/log.h | 20 |
12 files changed, 22 insertions, 39 deletions
diff --git a/src/crepe/Sound.cpp b/src/crepe/Sound.cpp index 1758282..e1150ac 100644 --- a/src/crepe/Sound.cpp +++ b/src/crepe/Sound.cpp @@ -58,4 +58,3 @@ void Sound::set_looping(bool looping) { if (!ctx.engine.isValidVoiceHandle(this->handle)) return; ctx.engine.setLooping(this->handle, this->looping); } - diff --git a/src/crepe/Sound.h b/src/crepe/Sound.h index 4c51188..ac93991 100644 --- a/src/crepe/Sound.h +++ b/src/crepe/Sound.h @@ -79,5 +79,4 @@ private: bool looping = false; }; -} - +} // namespace crepe diff --git a/src/crepe/SoundContext.cpp b/src/crepe/SoundContext.cpp index cfb7d82..72047d2 100644 --- a/src/crepe/SoundContext.cpp +++ b/src/crepe/SoundContext.cpp @@ -18,4 +18,3 @@ SoundContext::~SoundContext() { dbg_trace(); engine.deinit(); } - diff --git a/src/crepe/SoundContext.h b/src/crepe/SoundContext.h index d361d83..090966d 100644 --- a/src/crepe/SoundContext.h +++ b/src/crepe/SoundContext.h @@ -15,13 +15,12 @@ private: static SoundContext & get_instance(); SoundContext(const SoundContext &) = delete; SoundContext(SoundContext &&) = delete; - SoundContext &operator=(const SoundContext &) = delete; - SoundContext &operator=(SoundContext &&) = delete; + SoundContext & operator=(const SoundContext &) = delete; + SoundContext & operator=(SoundContext &&) = delete; private: SoLoud::Soloud engine; friend class Sound; }; -} - +} // namespace crepe diff --git a/src/crepe/api/AudioSource.cpp b/src/crepe/api/AudioSource.cpp index cbde79f..4d1b093 100644 --- a/src/crepe/api/AudioSource.cpp +++ b/src/crepe/api/AudioSource.cpp @@ -9,9 +9,7 @@ AudioSource::AudioSource(std::unique_ptr<Resource> audio_clip) { this->_sound = std::make_unique<crepe::Sound>(std::move(audio_clip)); } -void AudioSource::play() { - return this->play(false); -} +void AudioSource::play() { return this->play(false); } void AudioSource::play(bool looping) { this->_sound->set_looping(looping); @@ -22,4 +20,3 @@ void AudioSource::stop() { this->_sound->pause(); this->_sound->rewind(); } - diff --git a/src/crepe/api/AudioSource.h b/src/crepe/api/AudioSource.h index 6a038be..4300c48 100644 --- a/src/crepe/api/AudioSource.h +++ b/src/crepe/api/AudioSource.h @@ -38,5 +38,4 @@ private: std::unique_ptr<crepe::Sound> _sound; }; -} - +} // namespace crepe::api diff --git a/src/crepe/api/Component.h b/src/crepe/api/Component.h index 2abb461..d5e0499 100644 --- a/src/crepe/api/Component.h +++ b/src/crepe/api/Component.h @@ -7,5 +7,4 @@ public: bool active; }; -} - +} // namespace crepe::api diff --git a/src/crepe/api/Resource.cpp b/src/crepe/api/Resource.cpp index 6bb081d..1a647ce 100644 --- a/src/crepe/api/Resource.cpp +++ b/src/crepe/api/Resource.cpp @@ -9,11 +9,6 @@ Resource::Resource(const std::string & src) { this->file = std::ifstream(this->src, std::ios::in | std::ios::binary); } -const std::istream & Resource::read() { - return this->file; -} - -const char * Resource::canonical() { - return this->src.c_str(); -} +const std::istream & Resource::read() { return this->file; } +const char * Resource::canonical() { return this->src.c_str(); } diff --git a/src/crepe/api/Resource.h b/src/crepe/api/Resource.h index 2b62ff9..f2b2a0e 100644 --- a/src/crepe/api/Resource.h +++ b/src/crepe/api/Resource.h @@ -1,8 +1,8 @@ #pragma once -#include <string> #include <fstream> #include <iostream> +#include <string> namespace crepe::api { @@ -21,5 +21,4 @@ private: std::ifstream file; }; -} - +} // namespace crepe::api diff --git a/src/crepe/util/color.h b/src/crepe/util/color.h index 1af6c8f..066c9d3 100644 --- a/src/crepe/util/color.h +++ b/src/crepe/util/color.h @@ -38,5 +38,4 @@ constexpr const char * BG_MAGENTA_BRIGHT = "\e[105m"; constexpr const char * BG_CYAN_BRIGHT = "\e[106m"; constexpr const char * BG_WHITE_BRIGHT = "\e[107m"; -} - +} // namespace crepe::util::color diff --git a/src/crepe/util/log.cpp b/src/crepe/util/log.cpp index 796df49..6829ec3 100644 --- a/src/crepe/util/log.cpp +++ b/src/crepe/util/log.cpp @@ -48,4 +48,3 @@ void crepe::util::logf(log_level level, const char * fmt, ...) { va_logf(level, args, fmt); va_end(args); } - diff --git a/src/crepe/util/log.h b/src/crepe/util/log.h index 5295cb9..4cab338 100644 --- a/src/crepe/util/log.h +++ b/src/crepe/util/log.h @@ -8,12 +8,9 @@ // utility macros #define _crepe_logf_here(fmt, ...) \ crepe::util::logf(util::log_level::debug, "%s%s (%s:%d)" fmt "\n", \ - crepe::util::color::FG_WHITE, \ - __PRETTY_FUNCTION__, \ - __FILE_NAME__, \ - __LINE__, \ - crepe::util::color::RESET, \ - __VA_ARGS__) + crepe::util::color::FG_WHITE, __PRETTY_FUNCTION__, \ + __FILE_NAME__, __LINE__, crepe::util::color::RESET, \ + __VA_ARGS__) #define dbg_logf(fmt, ...) _crepe_logf_here(": " fmt, __VA_ARGS__) #define dbg_log(str) _crepe_logf_here(": %s", str) @@ -23,11 +20,14 @@ namespace crepe::util { -enum log_level { debug, info, warning, error, }; +enum log_level { + debug, + info, + warning, + error, +}; void logf(const char * fmt, ...); void logf(enum log_level level, const char * fmt, ...); -} - - +} // namespace crepe::util |