Lines 1-7
Link Here
|
1 |
// Emacs style mode select -*- C++ -*- |
1 |
// Emacs style mode select -*- C++ -*- |
2 |
//----------------------------------------------------------------------------- |
2 |
//----------------------------------------------------------------------------- |
3 |
// |
3 |
// |
4 |
// $Id: i_sound.c,v 1.12 2004/04/18 12:53:42 hurdler Exp $ |
4 |
// $Id: i_sound.c,v 1.13 2006/07/22 15:38:07 hurdler Exp $ |
5 |
// |
5 |
// |
6 |
// Copyright (C) 1993-1996 by id Software, Inc. |
6 |
// Copyright (C) 1993-1996 by id Software, Inc. |
7 |
// |
7 |
// |
Lines 15-20
Link Here
|
15 |
// for more details. |
15 |
// for more details. |
16 |
// |
16 |
// |
17 |
// $Log: i_sound.c,v $ |
17 |
// $Log: i_sound.c,v $ |
|
|
18 |
// Revision 1.13 2006/07/22 15:38:07 hurdler |
19 |
// Quick fix for SDL_mixer compiling issue |
20 |
// |
18 |
// Revision 1.12 2004/04/18 12:53:42 hurdler |
21 |
// Revision 1.12 2004/04/18 12:53:42 hurdler |
19 |
// fix Heretic issue with SDL and OS/2 |
22 |
// fix Heretic issue with SDL and OS/2 |
20 |
// |
23 |
// |
Lines 517-528
Link Here
|
517 |
// Mixing channel index. |
520 |
// Mixing channel index. |
518 |
int chan; |
521 |
int chan; |
519 |
|
522 |
|
520 |
extern void music_mixer(void *udata, Uint8 * stream, int len); |
|
|
521 |
|
522 |
if (nosound) |
523 |
if (nosound) |
523 |
return; |
524 |
return; |
524 |
// Mix in the music |
525 |
// Mix in the music |
525 |
music_mixer(NULL, stream, len); |
526 |
//music_mixer(NULL, stream, len); // TODO: see what we have to do |
526 |
|
527 |
|
527 |
if (nosound) |
528 |
if (nosound) |
528 |
return; |
529 |
return; |
Lines 705-722
Link Here
|
705 |
|
706 |
|
706 |
void I_ShutdownMusic(void) |
707 |
void I_ShutdownMusic(void) |
707 |
{ |
708 |
{ |
708 |
|
|
|
709 |
/* |
710 |
Should this be exposed in mixer.h? |
711 |
*/ |
712 |
extern void close_music(void); |
713 |
if (nomusic) |
709 |
if (nomusic) |
714 |
return; |
710 |
return; |
715 |
|
711 |
|
716 |
if (!musicStarted) |
712 |
if (!musicStarted) |
717 |
return; |
713 |
return; |
718 |
|
714 |
|
719 |
close_music(); |
715 |
Mix_CloseAudio(); |
720 |
|
716 |
|
721 |
CONS_Printf("I_ShutdownMusic: shut down\n"); |
717 |
CONS_Printf("I_ShutdownMusic: shut down\n"); |
722 |
musicStarted = false; |
718 |
musicStarted = false; |
Lines 725-735
Link Here
|
725 |
|
721 |
|
726 |
void I_InitMusic(void) |
722 |
void I_InitMusic(void) |
727 |
{ |
723 |
{ |
728 |
/* |
|
|
729 |
Should this be exposed in mixer.h? |
730 |
*/ |
731 |
extern int open_music(SDL_AudioSpec *); |
732 |
|
733 |
if (nosound) |
724 |
if (nosound) |
734 |
{ |
725 |
{ |
735 |
// FIXME: workaround for shitty programming undoc'ed features |
726 |
// FIXME: workaround for shitty programming undoc'ed features |
Lines 740-746
Link Here
|
740 |
if (nomusic) |
731 |
if (nomusic) |
741 |
return; |
732 |
return; |
742 |
|
733 |
|
743 |
if (open_music(&audio) < 0) |
734 |
if (Mix_OpenAudio(audio.freq, audio.format, audio.channels, audio.samples) < 0) |
744 |
{ |
735 |
{ |
745 |
CONS_Printf("Unable to open music: %s\n", Mix_GetError()); |
736 |
CONS_Printf("Unable to open music: %s\n", Mix_GetError()); |
746 |
nomusic = true; |
737 |
nomusic = true; |