aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/alan3/glkio.cpp15
-rw-r--r--engines/glk/alan3/glkio.h1
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/glk/alan3/glkio.cpp b/engines/glk/alan3/glkio.cpp
index 61e9f180f1..c88e9fa74b 100644
--- a/engines/glk/alan3/glkio.cpp
+++ b/engines/glk/alan3/glkio.cpp
@@ -34,7 +34,8 @@ namespace Alan3 {
GlkIO *g_io;
GlkIO::GlkIO(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc),
- glkMainWin(nullptr), glkStatusWin(nullptr), onStatusLine(false), _saveSlot(-1) {
+ glkMainWin(nullptr), glkStatusWin(nullptr), onStatusLine(false), _saveSlot(-1),
+ _soundChannel(nullptr) {
g_io = this;
}
@@ -92,14 +93,12 @@ void GlkIO::playSound(int sound) {
return;
#ifdef GLK_MODULE_SOUND
- static schanid_t soundChannel = NULL;
-
if (glk_gestalt(gestalt_Sound, 0) == 1) {
- if (soundChannel == NULL)
- soundChannel = glk_schannel_create(0);
- if (soundChannel != NULL) {
- glk_schannel_stop(soundChannel);
- (void)glk_schannel_play(soundChannel, sound);
+ if (_soundChannel == nullptr)
+ _soundChannel = glk_schannel_create(0);
+ if (_soundChannel) {
+ glk_schannel_stop(_soundChannel);
+ (void)glk_schannel_play(_soundChannel, sound);
}
}
#endif
diff --git a/engines/glk/alan3/glkio.h b/engines/glk/alan3/glkio.h
index fb342d1569..333a24b055 100644
--- a/engines/glk/alan3/glkio.h
+++ b/engines/glk/alan3/glkio.h
@@ -34,6 +34,7 @@ class GlkIO : public GlkAPI {
private:
winid_t glkMainWin;
winid_t glkStatusWin;
+ schanid_t _soundChannel;
int _saveSlot;
public:
bool onStatusLine;