diff options
author | Paul Gilbert | 2019-07-05 21:34:22 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-06 15:27:09 -0700 |
commit | 2fbb8af0bcec84d6653b97edf1699e94660e62fc (patch) | |
tree | 9c5bdd7c3156ea6848b625bcafb56332a282ae91 /engines/glk | |
parent | 4c014a105cf170efa4a57ae8231e256a8eb32e90 (diff) | |
download | scummvm-rg350-2fbb8af0bcec84d6653b97edf1699e94660e62fc.tar.gz scummvm-rg350-2fbb8af0bcec84d6653b97edf1699e94660e62fc.tar.bz2 scummvm-rg350-2fbb8af0bcec84d6653b97edf1699e94660e62fc.zip |
GLK: ALAN3: Move soundChannel static to GlkIO field
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/alan3/glkio.cpp | 15 | ||||
-rw-r--r-- | engines/glk/alan3/glkio.h | 1 |
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; |