X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fsound.c;h=6db2f63329a54bab3a1575982463ac276abd13ec;hp=d2cdbc724d0e9d781aa664bd7d03d8f60e199b4c;hb=74b5b6c19587f93c45b72b1153154030dc99b50d;hpb=9dcf51eadcd8fb8e1ba937b6a8db76096cc09b05 diff --git a/src/sound.c b/src/sound.c index d2cdbc72..6db2f633 100644 --- a/src/sound.c +++ b/src/sound.c @@ -23,7 +23,7 @@ static struct SoundControl emptySoundControl = -1,0,0, FALSE,FALSE,FALSE,FALSE,FALSE, 0,0L,0L,NULL }; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) static int stereo_volume[PSND_MAX_LEFT2RIGHT+1]; static char premix_first_buffer[SND_BLOCKSIZE]; #ifdef VOXWARE @@ -32,21 +32,22 @@ static char premix_right_buffer[SND_BLOCKSIZE]; static int premix_last_buffer[SND_BLOCKSIZE]; #endif /* VOXWARE */ static unsigned char playing_buffer[SND_BLOCKSIZE]; -#endif /* MSDOS */ +#endif /* !MSDOS && !WIN32 */ /* forward declaration of internal functions */ #ifdef VOXWARE static void SoundServer_InsertNewSound(struct SoundControl); #endif -#ifndef VOXWARE -#ifndef MSDOS + +#if !defined(VOXWARE) && !defined(MSDOS) && !defined(WIN32) static unsigned char linear_to_ulaw(int); static int ulaw_to_linear(unsigned char); #endif -#endif + #ifdef HPUX_AUDIO static void HPUX_Audio_Control(); #endif + #ifdef MSDOS static void SoundServer_InsertNewSound(struct SoundControl); static void SoundServer_StopSound(int); @@ -56,7 +57,7 @@ static void SoundServer_StopAllSounds(); void SoundServer() { int i; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) struct SoundControl snd_ctrl; fd_set sound_fdset; @@ -67,7 +68,7 @@ void SoundServer() playlist[i] = emptySoundControl; playing_sounds = 0; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) stereo_volume[PSND_MAX_LEFT2RIGHT] = 0; for(i=0;i=0) { @@ -347,7 +352,9 @@ void SoundServer() #endif /* !VOXWARE */ } -#endif /* !MSDOS */ + +#endif /* !MSDOS && !WIN32 */ + } #ifdef MSDOS @@ -403,6 +410,7 @@ static void sound_handler(struct SoundControl snd_ctrl) } #endif /* MSDOS */ +#ifndef WIN32 static void SoundServer_InsertNewSound(struct SoundControl snd_ctrl) { int i, k; @@ -511,6 +519,7 @@ static void SoundServer_InsertNewSound(struct SoundControl snd_ctrl) } } } +#endif /* !WIN32 */ /* void SoundServer_FadeSound(int nr) @@ -526,6 +535,7 @@ void SoundServer_FadeSound(int nr) } */ +#ifndef WIN32 #ifdef MSDOS static void SoundServer_StopSound(int nr) { @@ -570,6 +580,7 @@ static void SoundServer_StopAllSounds() #endif } #endif /* MSDOS */ +#endif /* !WIN32 */ #ifdef HPUX_AUDIO static void HPUX_Audio_Control() @@ -594,8 +605,8 @@ static void HPUX_Audio_Control() } #endif /* HPUX_AUDIO */ -#ifndef VOXWARE -#ifndef MSDOS +#if !defined(VOXWARE) && !defined(MSDOS) && !defined(WIN32) + /* these two are stolen from "sox"... :) */ /* @@ -699,8 +710,7 @@ static int ulaw_to_linear(unsigned char ulawbyte) return(sample); } -#endif /* !MSDOS */ -#endif /* !VOXWARE */ +#endif /* !VOXWARE && !MSDOS && !WIN32 */ /*** THE STUFF ABOVE IS ONLY USED BY THE SOUND SERVER CHILD PROCESS ***/