Index: ps/trunk/source/ps/GameSetup/HWDetect.cpp =================================================================== --- ps/trunk/source/ps/GameSetup/HWDetect.cpp +++ ps/trunk/source/ps/GameSetup/HWDetect.cpp @@ -20,7 +20,9 @@ #include "scriptinterface/ScriptInterface.h" #include "lib/ogl.h" +#if CONFIG2_AUDIO #include "lib/snd.h" +#endif #include "lib/svn_revision.h" #include "lib/timer.h" #include "lib/utf8.h" @@ -199,10 +201,10 @@ scriptInterface.SetProperty(settings, "gfx_card", gfx::CardName()); scriptInterface.SetProperty(settings, "gfx_drv_ver", gfx::DriverInfo()); - +#if CONFIG2_AUDIO scriptInterface.SetProperty(settings, "snd_card", snd_card); scriptInterface.SetProperty(settings, "snd_drv_ver", snd_drv_ver); - +#endif ReportSDL(scriptInterface, settings); ReportGLLimits(scriptInterface, settings); Index: ps/trunk/source/ps/Util.cpp =================================================================== --- ps/trunk/source/ps/Util.cpp +++ ps/trunk/source/ps/Util.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -21,7 +21,9 @@ #include "lib/posix/posix_utsname.h" #include "lib/ogl.h" +#if CONFIG2_AUDIO #include "lib/snd.h" +#endif #include "lib/timer.h" #include "lib/bits.h" // round_up #include "lib/allocators/shared_ptr.h" @@ -80,10 +82,6 @@ void WriteSystemInfo() { TIMER(L"write_sys_info"); - - // get_cpu_info and gfx_detect already called during init - see call site - snd_detect(); - struct utsname un; uname(&un); @@ -137,9 +135,13 @@ fprintf(f, "OpenGL Drivers : %s; %ls\n", glGetString(GL_VERSION), driverInfo.c_str()); fprintf(f, "Video Mode : %dx%d:%d\n", g_VideoMode.GetXRes(), g_VideoMode.GetYRes(), g_VideoMode.GetBPP()); - // sound +#if CONFIG2_AUDIO + snd_detect(); fprintf(f, "Sound Card : %s\n", snd_card.c_str()); fprintf(f, "Sound Drivers : %s\n", snd_drv_ver.c_str()); +#else + fprintf(f, "Sound : Game was compiled without audio\n"); +#endif // OpenGL extensions (write them last, since it's a lot of text) const char* exts = ogl_ExtensionString(); Index: ps/trunk/source/soundmanager/scripting/JSInterface_Sound.cpp =================================================================== --- ps/trunk/source/soundmanager/scripting/JSInterface_Sound.cpp +++ ps/trunk/source/soundmanager/scripting/JSInterface_Sound.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -125,11 +125,11 @@ void ClearPlaylist(ScriptInterface::CxPrivate* UNUSED(pCxPrivate) ){} void StopMusic(ScriptInterface::CxPrivate* UNUSED(pCxPrivate) ){} void StartMusic(ScriptInterface::CxPrivate* UNUSED(pCxPrivate) ){} - void SetMasterGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float gain){} - void SetMusicGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float gain){} - void SetAmbientGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float gain){} - void SetActionGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float gain){} - void SetUIGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float gain){} + void SetMasterGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float UNUSED(gain)){} + void SetMusicGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float UNUSED(gain)){} + void SetAmbientGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float UNUSED(gain)){} + void SetActionGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float UNUSED(gain)){} + void SetUIGain(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), float UNUSED(gain)){} #endif Index: ps/trunk/source/soundmanager/scripting/SoundGroup.h =================================================================== --- ps/trunk/source/soundmanager/scripting/SoundGroup.h +++ ps/trunk/source/soundmanager/scripting/SoundGroup.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -83,11 +83,11 @@ #if CONFIG2_AUDIO inline u32 FastRand(); // Contains the current sound seed for the generator - u32 m_Seed; float RandFloat(float min, float max); // We store the handles so we can load now and play later std::vector m_SoundGroups; #endif + u32 m_Seed; // We need the filenames so we can reload when necessary. std::vector m_Filenames; // The file path for the list of sound file resources