From 5ba614a911845fd5263b390d75bdf26ac9e3973c Mon Sep 17 00:00:00 2001 From: driAn Date: Fri, 30 May 2008 19:25:33 +0000 Subject: [PATCH] audio variable git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2125 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 2 ++ source/src/sound.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) 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)