diff --git a/source/src/main.cpp b/source/src/main.cpp index 98d4c3b5..013af8aa 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -115,6 +115,8 @@ void writeinitcfg() fprintf(f, "vsync %d\n", vsync); extern int fullscreen; fprintf(f, "fullscreen %d\n", fullscreen > 0 ? 1 : 0); + extern int audio; + fprintf(f, "audio %d", audio > 0 ? 1 : 0); fclose(f); } diff --git a/source/src/sound.cpp b/source/src/sound.cpp index ecb99ce5..4e605d2a 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -13,6 +13,8 @@ #include "vorbis/vorbisfile.h" #endif +VARF(audio, 0, 1, 1, initwarning("audio")); + static bool nosound = true; static bool sourcesavail = true; ALCdevice *device = NULL; @@ -593,6 +595,12 @@ void stopsound() void initsound() { + if(!audio) + { + conoutf("audio is disabled"); + return; + } + alclearerr(); device = alcOpenDevice(NULL); if(!alerr() && device)