Mercurial > sdl-ios-xcode
diff src/audio/SDL_audio.c @ 1190:173c063d4f55
OS/2 port!
This was mostly, if not entirely, written by "Doodle" and "Caetano":
doodle@scenergy.dfmk.hu
daniel@caetano.eng.br
--ryan.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 23 Nov 2005 07:29:56 +0000 |
parents | d74fbf56f2f6 |
children | f9794ee91dfc |
line wrap: on
line diff
--- a/src/audio/SDL_audio.c Wed Nov 23 07:23:48 2005 +0000 +++ b/src/audio/SDL_audio.c Wed Nov 23 07:29:56 2005 +0000 @@ -38,6 +38,12 @@ #include "SDL_audiomem.h" #include "SDL_sysaudio.h" +#ifdef __OS2__ +// We'll need the DosSetPriority() API! +#define INCL_DOSPROCESS +#include <os2.h> +#endif + /* Available audio drivers */ static AudioBootStrap *bootstrap[] = { #ifdef OPENBSD_AUDIO_SUPPORT @@ -108,6 +114,9 @@ #ifdef DRENDERER_SUPPORT &DRENDERER_bootstrap, #endif +#ifdef __OS2__ + &DART_bootstrap, +#endif NULL }; SDL_AudioDevice *current_audio = NULL; @@ -181,6 +190,16 @@ D(bug("Entering audio loop...\n")); #endif +#ifdef __OS2__ + // Increase the priority of this thread to make sure that + // the audio will be continuous all the time! +#ifdef USE_DOSSETPRIORITY +#ifdef DEBUG_BUILD + printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID()); +#endif + DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0); +#endif +#endif /* Loop, filling the audio buffers */ while ( audio->enabled ) { @@ -249,6 +268,11 @@ D(bug("CloseAudio..Done, subtask exiting...\n")); audio_configured = 0; #endif +#ifdef __OS2__ +#ifdef DEBUG_BUILD + printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID()); +#endif +#endif return(0); }