|
|
| version 1.1, 2003/11/16 16:43:45 | version 1.2, 2003/11/27 17:25:55 |
|---|---|
| Line 39 static void sdlaudio_callback(void *, un | Line 39 static void sdlaudio_callback(void *, un |
| static BOOL | static BOOL |
| sdlaudio_init(UINT rate, UINT samples) | sdlaudio_init(UINT rate, UINT samples) |
| { | { |
| SDL_AudioSpec fmt; | static SDL_AudioSpec fmt; |
| int rv; | int rv; |
| fmt.freq = rate; | fmt.freq = rate; |
| Line 239 static void | Line 239 static void |
| sdlaudio_callback(void *userdata, unsigned char *stream, int len) | sdlaudio_callback(void *userdata, unsigned char *stream, int len) |
| { | { |
| UINT samples = (UINT)userdata; | UINT samples = (UINT)userdata; |
| int nextbuf = sound_nextbuf; | |
| UNUSED(len); | UNUSED(len); |
| if (sound_event != NULL) | if (sound_event != NULL) |
| memset(sound_event, 0, samples); | memset(sound_event, 0, samples); |
| SDL_MixAudio(stream, sound_buffer[sound_nextbuf], samples, | |
| SDL_MIX_MAXVOLUME); | |
| sound_nextbuf = (sound_nextbuf + 1) % NSOUNDBUFFER; | sound_nextbuf = (sound_nextbuf + 1) % NSOUNDBUFFER; |
| sound_event = sound_buffer[sound_nextbuf]; | sound_event = sound_buffer[sound_nextbuf]; |
| SDL_MixAudio(stream, sound_buffer[nextbuf], samples, | |
| SDL_MIX_MAXVOLUME); | |
| } | } |
| #endif /* USE_SDLAUDIO || USE_SDLMIXER */ | #endif /* USE_SDLAUDIO || USE_SDLMIXER */ |