summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2009-09-21 22:20:33 +0000
committerSimon Howard2009-09-21 22:20:33 +0000
commit79698ecfd9e025f28350566d2b89b223688a1b45 (patch)
tree3522b64ee61aab907a27a166c9dbb83cec6e753b /src
parent38b5ee9991eda235bf67aa2260e73e755b1da081 (diff)
downloadchocolate-doom-79698ecfd9e025f28350566d2b89b223688a1b45.tar.gz
chocolate-doom-79698ecfd9e025f28350566d2b89b223688a1b45.tar.bz2
chocolate-doom-79698ecfd9e025f28350566d2b89b223688a1b45.zip
Implement pausing of music.
Subversion-branch: /branches/opl-branch Subversion-revision: 1688
Diffstat (limited to 'src')
-rw-r--r--src/i_oplmusic.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c
index 4ac52754..7bfdc04d 100644
--- a/src/i_oplmusic.c
+++ b/src/i_oplmusic.c
@@ -1363,10 +1363,28 @@ static void I_OPL_PlaySong(void *handle, int looping)
static void I_OPL_PauseSong(void)
{
+ unsigned int i;
+
if (!music_initialised)
{
return;
}
+
+ // Pause OPL callbacks.
+
+ OPL_SetPaused(1);
+
+ // Turn off all main instrument voices (not percussion).
+ // This is what Vanilla does.
+
+ for (i=0; i<OPL_NUM_VOICES; ++i)
+ {
+ if (voices[i].channel != NULL
+ && voices[i].current_instr < percussion_instrs)
+ {
+ VoiceKeyOff(&voices[i]);
+ }
+ }
}
static void I_OPL_ResumeSong(void)
@@ -1375,6 +1393,8 @@ static void I_OPL_ResumeSong(void)
{
return;
}
+
+ OPL_SetPaused(0);
}
static void I_OPL_StopSong(void)