aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/AudioSource.cpp
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-11 13:21:19 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-11 13:21:19 +0100
commit357ebfc3eac1d39b02875e1bd78ae6f58b10f824 (patch)
tree7d79435fa764c0fedcc912ddaf876ff03ef8be5e /src/crepe/api/AudioSource.cpp
parent6eef90e9ffb1d8fc25161e912bc5d8aa8e4024da (diff)
parentc45b60941b82dec2097d958b396a117b1634eada (diff)
Merge remote-tracking branch 'origin/master' into max/AI
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; }