Skip to content

Commit 1515b58

Browse files
committed
sound queue compatibility fix
1 parent 74b88c1 commit 1515b58

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sound/sound_library.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ class SoundQueueSingleton : public SoundQueue<16>, Looper, SaberBase {
6767
void SB_Effect(EffectType effect, EffectLocation location) override {
6868
if (effect == EFFECT_CHDIR) CheckVersion();
6969
}
70+
71+
72+
// Legacy call for prop compatibility.
73+
void Poll(RefPtr<BufferedWavPlayer>& player) {
74+
static bool unlinked = false;
75+
if (!unlinked) {
76+
unlinked = true;
77+
Looper::Unlink();
78+
wav_player_.Free();
79+
}
80+
PollSoundQueue(player);
81+
}
82+
7083
private:
7184
void CheckVersion() {
7285
int found_version = 0;
@@ -98,7 +111,7 @@ class SoundLibrary {
98111
static bool Play(SoundToPlay p) { return SOUNDQ->Play(p); }
99112
static void fadeout(float len) { return SOUNDQ->fadeout(len); }
100113
static bool busy() { return SOUNDQ->busy(); }
101-
static void Poll(RefPtr<BufferedWavPlayer>& player) {}
114+
static void Poll(RefPtr<BufferedWavPlayer>& player) { SOUNDQ->Poll(player); }
102115

103116
static void init() {
104117
SOUNDQ->require_version(SoundLibraryVersion);

0 commit comments

Comments
 (0)