From: DeaDDooMER Date: Mon, 30 Mar 2020 07:49:44 +0000 (+0400) Subject: sound: add stub driver X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a100ff401dc739ae0e57fdbda1848f4db1a24b81;p=flatwaifu.git sound: add stub driver --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fcbd51a..67832e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,7 @@ option(SOUND_DRIVER "Build with selected sound driver" "OpenAL") string(TOUPPER "${SOUND_DRIVER}" SOUND_DRIVER) string(COMPARE EQUAL "${SOUND_DRIVER}" "OPENAL" WITH_OPENAL) string(COMPARE EQUAL "${SOUND_DRIVER}" "SDLMIXER" WITH_SDLMIXER) +string(COMPARE EQUAL "${SOUND_DRIVER}" "STUB" WITH_STUBSOUND) set(D2D_GAME_ROOT .) set(D2D_OPENGL_ROOT ${D2D_GAME_ROOT}/gl) @@ -15,6 +16,7 @@ set(D2D_SOFTWARE_ROOT ${D2D_GAME_ROOT}/soft) set(D2D_SDL_ROOT ${D2D_GAME_ROOT}/sdl) set(D2D_SDLMIXER_ROOT ${D2D_GAME_ROOT}/sdlmixer) set(D2D_OPENAL_ROOT ${D2D_GAME_ROOT}/openal) +set(D2D_STUBSOUND_ROOT ${D2D_GAME_ROOT}/stubsnd) aux_source_directory(${D2D_GAME_ROOT} D2D_GAME_SRC) aux_source_directory(${D2D_OPENGL_ROOT} D2D_OPENGL_SRC) @@ -22,10 +24,15 @@ aux_source_directory(${D2D_SOFTWARE_ROOT} D2D_SOFTWARE_SRC) aux_source_directory(${D2D_SDL_ROOT} D2D_SDL_SRC) aux_source_directory(${D2D_SDLMIXER_ROOT} D2D_SDLMIXER_SRC) aux_source_directory(${D2D_OPENAL_ROOT} D2D_OPENAL_SRC) +aux_source_directory(${D2D_STUBSOUND_ROOT} D2D_STUBSOUND_SRC) find_package(SDL REQUIRED) message(STATUS "sound::${SOUND_DRIVER}") -if(WITH_OPENAL) +if(WITH_STUBSOUND) + set(D2D_SOUND_SRC "${D2D_STUBSOUND_SRC}") + set(D2D_SOUND_INCLUDE_DIR "") + set(D2D_SOUND_LIBRARY "") +elseif(WITH_OPENAL) find_package(OpenAL REQUIRED) set(D2D_SOUND_SRC "${D2D_OPENAL_SRC}") set(D2D_SOUND_INCLUDE_DIR "${OPENAL_INCLUDE_DIR}") @@ -35,9 +42,9 @@ elseif(WITH_SDLMIXER) set(D2D_SOUND_SRC "${D2D_SDLMIXER_SRC}") set(D2D_SOUND_INCLUDE_DIR "${SDLMIXER_INCLUDE_DIR}") set(D2D_SOUND_LIBRARY "${SDLMIXER_LIBRARY}") -else(WITH_OPENAL) - message(FATAL_ERROR "Select SOUND_DRIVER as 'OPENAL' or 'SDLMIXER'") -endif(WITH_OPENAL) +else(WITH_STUBSOUND) + message(FATAL_ERROR "Select SOUND_DRIVER as 'OPENAL' or 'SDLMIXER' or 'STUB'") +endif(WITH_STUBSOUND) if (WITH_OPENGL) find_package(OpenGL REQUIRED) diff --git a/src/stubsnd/sound.c b/src/stubsnd/sound.c new file mode 100644 index 0000000..58435f1 --- /dev/null +++ b/src/stubsnd/sound.c @@ -0,0 +1,82 @@ +#include "glob.h" +#include "sound.h" +#include "music.h" + +short snd_vol; + +short mus_vol; +char music_random; +int music_time; +int music_fade; + +/* Music */ + +void S_initmusic (void) { + +} + +void S_donemusic (void) { + +} + +void S_startmusic (int time) { + +} + +void S_stopmusic (void) { + +} + +void S_volumemusic (int v) { + +} + +void F_loadmus (char n[8]) { + +} + +void F_freemus (void) { + +} + +void S_updatemusic (void) { + +} + +/* Sound */ + +snd_t *S_get (int id) { + return NULL; +} + +snd_t *S_load (const char name[8]) { + return NULL; +} + +void S_free (snd_t *s) { + +} + +void S_init (void) { + +} + +void S_done (void) { + +} + +short S_play (snd_t *s, short c, short v) { + return 0; +} + +void S_stop (short c) { + +} + +void S_volume (int v) { + +} + +void S_wait (void) { + +}