aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/sound.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-04-28 14:50:01 +1000
committerPaul Gilbert2019-04-28 14:50:01 +1000
commit70febd034a6ff16c2945c52198386729a75a68e2 (patch)
tree5d61675bd2634a3a1aa7f80d37b77d0aff7c98f8 /engines/glk/sound.cpp
parent401b010ef3f488601244129b93a6ea3bf5bc3fb1 (diff)
downloadscummvm-rg350-70febd034a6ff16c2945c52198386729a75a68e2.tar.gz
scummvm-rg350-70febd034a6ff16c2945c52198386729a75a68e2.tar.bz2
scummvm-rg350-70febd034a6ff16c2945c52198386729a75a68e2.zip
GLK: Add gli registration for other object types
Diffstat (limited to 'engines/glk/sound.cpp')
-rw-r--r--engines/glk/sound.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/glk/sound.cpp b/engines/glk/sound.cpp
index 70c33c27da..4f56ee2add 100644
--- a/engines/glk/sound.cpp
+++ b/engines/glk/sound.cpp
@@ -75,13 +75,16 @@ void Sounds::poll() {
SoundChannel::SoundChannel(Sounds *owner) : _owner(owner), _soundNum(0),
_rock(0), _notify(0) {
- _dispRock.num = 0;
- _dispRock.ptr = nullptr;
+ if (g_vm->gli_register_obj)
+ _dispRock = (*g_vm->gli_register_obj)(this, gidisp_Class_Schannel);
}
SoundChannel::~SoundChannel() {
stop();
_owner->removeSound(this);
+
+ if (g_vm->gli_unregister_obj)
+ (*g_vm->gli_unregister_obj)(this, gidisp_Class_Schannel, _dispRock);
}
uint SoundChannel::play(uint soundNum, uint repeats, uint notify) {