浏览代码

[Issue #14] fixed: multiple sounds cannot played at the same time (kinghtt)
- this is a simple hackfix which should work most of the time

Wei Mingzhi 9 年之前
父节点
当前提交
31208d01c8
共有 2 个文件被更改,包括 9 次插入0 次删除
  1. 4 0
      sound.c
  2. 5 0
      sound.h

+ 4 - 0
sound.c

@@ -48,6 +48,10 @@ static BOOL  g_fUseWav = FALSE;
 INT          g_iVolume  = SDL_MIX_MAXVOLUME * 0.1;
 #endif
 
+#ifdef PAL_CLASSIC
+int          g_iCurrChannel = 0;
+#endif
+
 typedef struct tagSNDPLAYER
 {
    FILE                     *mkf;

+ 5 - 0
sound.h

@@ -72,7 +72,12 @@ SOUND_PlayCDA(
    INT    iNumTrack
 );
 
+#ifdef PAL_CLASSIC
+extern int g_iCurrChannel;
+#define SOUND_Play(i) SOUND_PlayChannel((i), (g_iCurrChannel ^= 1))
+#else
 #define SOUND_Play(i) SOUND_PlayChannel((i), 0)
+#endif
 
 extern BOOL       g_fNoSound;
 extern BOOL       g_fNoMusic;