aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/AudioSource.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-11 20:12:12 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-11 20:12:12 +0100
commitc90423d5c9d38ae426c168e52994a4fd63e6f266 (patch)
treefa18eae598cf0fccbb0f2dffd3e1d76fedaed53a /src/crepe/api/AudioSource.cpp
parent9b4f6f24f29e8873a14989ba8c9fccfbc460af7f (diff)
parent194ee3f192c3343c3ccc28dfa97fed180503ffd4 (diff)
merge master
Diffstat (limited to 'src/crepe/api/AudioSource.cpp')
-rw-r--r--src/crepe/api/AudioSource.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/crepe/api/AudioSource.cpp b/src/crepe/api/AudioSource.cpp
new file mode 100644
index 0000000..7b05cb1
--- /dev/null
+++ b/src/crepe/api/AudioSource.cpp
@@ -0,0 +1,15 @@
+#include "AudioSource.h"
+
+using namespace crepe;
+using namespace std;
+
+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; }