TurningWheel / Barony

Barony Open Source Release
http://www.baronygame.com/
Other
501 stars 130 forks source link

Fix incorrect uses of `ifdef` for `USE_FMOD` [#691] #866

Open guilhermeivo opened 1 week ago

guilhermeivo commented 1 week ago

Issue #691

When compiling using the following command:

cmake -DCMAKE_BUILD_TYPE=Release -DOPENAL_ENABLED=OFF -DFMOD_ENABLED=OFF ..

Gives following error:

[ 94%] Building CXX object CMakeFiles/barony.dir/src/engine/audio/init_audio.cpp.o
repos/Barony/src/ui/MainMenu.cpp: In member function ‘int MainMenu::AllSettings::save()’:
repos/Barony/src/ui/MainMenu.cpp:2873:13: error: ‘fmod_speakermode’ was not declared in this scope; did you mean ‘speaker_mode’?
 2873 |         if (fmod_speakermode != speaker_mode) {
      |             ^~~~~~~~~~~~~~~~
      |             speaker_mode
repos/Barony/src/ui/MainMenu.cpp:2874:33: error: ‘FMOD_SPEAKERMODE’ was not declared in this scope
 2874 |             fmod_speakermode = (FMOD_SPEAKERMODE)speaker_mode;
      |                                 ^~~~~~~~~~~~~~~~
repos/Barony/src/ui/MainMenu.cpp: In static member function ‘static MainMenu::AllSettings MainMenu::AllSettings::load(bool)’:
repos/Barony/src/ui/MainMenu.cpp:2977:38: error: ‘fmod_speakermode’ was not declared in this scope; did you mean ‘speaker_mode’?
 2977 |         settings.speaker_mode = (int)fmod_speakermode;
      |                                      ^~~~~~~~~~~~~~~~
      |                                      speaker_mode
repos/Barony/src/ui/MainMenu.cpp: In function ‘void MainMenu::settingsAudio(Button&)’:
repos/Barony/src/ui/MainMenu.cpp:6445:22: error: ‘num_drivers’ was not declared in this scope
 6445 |                 if ( num_drivers > 0 )
      |