summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89e2500)
raw | patch | inline | side by side (parent: 89e2500)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 30 Mar 2020 07:49:44 +0000 (11:49 +0400) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 30 Mar 2020 07:49:44 +0000 (11:49 +0400) |
src/CMakeLists.txt | patch | blob | history | |
src/stubsnd/sound.c | [new file with mode: 0644] | patch | blob |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fcbd51ad9a14ecab8613a20008e412e35d9ffd67..67832e8f0ef27ead2e1e601b6c26f872a0f02de4 100644 (file)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
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)
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)
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}")
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
--- /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) {
+
+}