diff --git a/src/xpdev/sdlfuncs.c b/src/xpdev/sdlfuncs.c index 22ff8f526d96bc93bb10aa299f257be7c0179eef..4426a16c02fab01f470e0be7226d898119f970e6 100644 --- a/src/xpdev/sdlfuncs.c +++ b/src/xpdev/sdlfuncs.c @@ -1,6 +1,7 @@ #include <stdio.h> /* NULL */ #include "gen_defs.h" +#undef main #include "sdlfuncs.h" #ifndef _WIN32 @@ -34,6 +35,7 @@ int load_sdl_funcs(struct sdlfuncs *sdlf) sdlf->BlitSurface=SDL_UpperBlit; sdlf->UpdateRects=SDL_UpdateRects; sdlf->SDL_CreateSemaphore=SDL_CreateSemaphore; + sdlf->SDL_DestroySemaphore=SDL_DestroySemaphore; sdlf->SDL_CreateMutex=SDL_CreateMutex; sdlf->CreateThread=SDL_CreateThread; sdlf->WaitEvent=SDL_WaitEvent; @@ -48,6 +50,9 @@ int load_sdl_funcs(struct sdlfuncs *sdlf) sdlf->GetError=SDL_GetError; sdlf->InitSubSystem=SDL_InitSubSystem; sdlf->QuitSubSystem=SDL_QuitSubSystem; + sdlf->OpenAudio=SDL_OpenAudio; + sdlf->CloseAudio=SDL_CloseAudio; + sdlf->PauseAudio=SDL_PauseAudio; sdlf->gotfuncs=1; sdl_funcs_loaded=1; return(0); @@ -131,6 +136,10 @@ int load_sdl_funcs(struct sdlfuncs *sdlf) FreeLibrary(sdl_dll); return(-1); } + if((sdlf->SDL_DestroySemaphore=GetProcAddress(sdl_dll, "SDL_DestroySemaphore"))==NULL) { + FreeLibrary(sdl_dll); + return(-1); + } if((sdlf->SDL_CreateMutex=GetProcAddress(sdl_dll, "SDL_CreateMutex"))==NULL) { FreeLibrary(sdl_dll); return(-1); @@ -187,6 +196,18 @@ int load_sdl_funcs(struct sdlfuncs *sdlf) FreeLibrary(sdl_dll); return(-1); } + if((sdlf->OpenAudio=GetProcAddress(sdl_dll, "SDL_OpenAudio"))==NULL) { + FreeLibrary(sdl_dll); + return(-1); + } + if((sdlf->CloseAudio=GetProcAddress(sdl_dll, "SDL_CloseAudio"))==NULL) { + FreeLibrary(sdl_dll); + return(-1); + } + if((sdlf->PauseAudio=GetProcAddress(sdl_dll, "SDL_PauseAudio"))==NULL) { + FreeLibrary(sdl_dll); + return(-1); + } sdlf->gotfuncs=1; sdl_funcs_loaded=1; return(0); @@ -264,6 +285,10 @@ int load_sdl_funcs(struct sdlfuncs *sdlf) dlclose(sdl_dll); return(-1); } + if((sdlf->SDL_DestroySemaphore=dlsym(sdl_dll, "SDL_DestroySemaphore"))==NULL) { + dlclose(sdl_dll); + return(-1); + } if((sdlf->SDL_CreateMutex=dlsym(sdl_dll, "SDL_CreateMutex"))==NULL) { dlclose(sdl_dll); return(-1); diff --git a/src/xpdev/sdlfuncs.h b/src/xpdev/sdlfuncs.h index fb1a6a3b23552d4f4120e8757b992f5c97cf007a..5525e6069e212c1e463b81cac4693966098ba94e 100644 --- a/src/xpdev/sdlfuncs.h +++ b/src/xpdev/sdlfuncs.h @@ -25,6 +25,7 @@ struct sdlfuncs { SDL_Surface *dst, SDL_Rect *dstrect); void (*UpdateRects) (SDL_Surface *screen, int numrects, SDL_Rect *rects); SDL_sem *(*SDL_CreateSemaphore) (Uint32 initial_value); + void (*SDL_DestroySemaphore) (SDL_sem *semaphore); SDL_mutex *(*SDL_CreateMutex) (void); struct SDL_Thread *(*CreateThread) (int (*fn)(void *), void *data); int (*WaitEvent) (SDL_Event *event); @@ -39,6 +40,9 @@ struct sdlfuncs { char *(*GetError) (void); int (*InitSubSystem)(Uint32 flags); void (*QuitSubSystem)(Uint32 flags); + int (*OpenAudio)(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); + void (*CloseAudio)(void); + void (*PauseAudio)(int pause_on); int gotfuncs; };