Skip to content

Commit

Permalink
Refactor again some definitions to be more common between OpenAL and …
Browse files Browse the repository at this point in the history
…FMod libs
  • Loading branch information
damiencarol committed Mar 4, 2024
1 parent 57c6a26 commit 9f2e1c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 11 additions & 2 deletions src/engine/audio/defines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

Uint32 numsounds = 0;

bool levelmusicplaying = false; // seems to be common to all sound libraries

#ifdef USE_FMOD
FMOD::System* fmod_system = nullptr;

Expand Down Expand Up @@ -55,7 +57,6 @@ FMOD::Sound* hamletmusic = nullptr;
FMOD::Sound* tutorialmusic = nullptr;
FMOD::Sound* gameovermusic = nullptr;
FMOD::Sound* introstorymusic = nullptr;
bool levelmusicplaying = false;

FMOD::Channel* music_channel = nullptr;
FMOD::Channel* music_channel2 = nullptr;
Expand All @@ -78,6 +79,14 @@ bool sfxUseDynamicAmbientVolume = true;
bool sfxUseDynamicEnvironmentVolume = true;

void* fmod_extraDriverData = nullptr;
#elif defined OPENAL_ENABLED
#elif defined USE_OPENAL

OPENAL_BUFFER** intromusic = nullptr;
OPENAL_BUFFER** minesmusic = NULL;
OPENAL_BUFFER** swampmusic = NULL;
OPENAL_BUFFER** labyrinthmusic = NULL;
OPENAL_BUFFER** ruinsmusic = NULL;
OPENAL_BUFFER** underworldmusic = NULL;
OPENAL_BUFFER** hellmusic = NULL;

#endif
10 changes: 2 additions & 8 deletions src/engine/audio/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,7 @@ ALCdevice *openal_device = nullptr;
//#define openal_maxchannels 100

OPENAL_BUFFER** sounds = nullptr;
OPENAL_BUFFER** minesmusic = NULL;
OPENAL_BUFFER** swampmusic = NULL;
OPENAL_BUFFER** labyrinthmusic = NULL;
OPENAL_BUFFER** ruinsmusic = NULL;
OPENAL_BUFFER** underworldmusic = NULL;
OPENAL_BUFFER** hellmusic = NULL;

OPENAL_BUFFER* intermissionmusic = NULL;
OPENAL_BUFFER* minetownmusic = NULL;
OPENAL_BUFFER* splashmusic = NULL;
Expand All @@ -517,7 +512,6 @@ OPENAL_BUFFER* hamletmusic = NULL;
OPENAL_BUFFER* tutorialmusic = nullptr;
OPENAL_BUFFER* gameovermusic = nullptr;
OPENAL_BUFFER* introstorymusic = nullptr;
bool levelmusicplaying = false;

OPENAL_SOUND* music_channel = nullptr;
OPENAL_SOUND* music_channel2 = nullptr;
Expand Down Expand Up @@ -1237,7 +1231,7 @@ void physfsReloadMusic(bool &introMusicChanged, bool reloadAll) //TODO: This sho
{
return;
}
#ifdef SOUNDsdfdsf
#ifdef MUSIC

std::vector<std::string> themeMusic;
themeMusic.push_back("music/introduction.ogg");
Expand Down

0 comments on commit 9f2e1c2

Please sign in to comment.