diff --git a/music/menu/ac-lol.it b/music/menu/ac-lol.it deleted file mode 100644 index fc61c109d..000000000 Binary files a/music/menu/ac-lol.it and /dev/null differ diff --git a/music/menu/ac-lol.it.txt b/music/menu/ac-lol.it.txt deleted file mode 100644 index f01de026d..000000000 --- a/music/menu/ac-lol.it.txt +++ /dev/null @@ -1 +0,0 @@ -http://creativecommons.org/licenses/by-nc-nd/3.0/ \ No newline at end of file diff --git a/music/menu/space_0.ogg b/music/menu/space_0.ogg new file mode 100644 index 000000000..d7d647c43 Binary files /dev/null and b/music/menu/space_0.ogg differ diff --git a/music/menu/space_0.ogg.txt b/music/menu/space_0.ogg.txt new file mode 100644 index 000000000..94e960dd0 --- /dev/null +++ b/music/menu/space_0.ogg.txt @@ -0,0 +1,4 @@ +Reencoded from Space by Alexandr Zhelanov +http://opengameart.org/content/space-1 + +http://creativecommons.org/licenses/by/3.0/ \ No newline at end of file diff --git a/src/cdogs/music.c b/src/cdogs/music.c index 03d37a6d3..b6eb3f860 100644 --- a/src/cdogs/music.c +++ b/src/cdogs/music.c @@ -39,7 +39,7 @@ int MusicPlay(SoundDevice *device, const char *path) { - if (!device->isInitialised || gConfig.Sound.MusicVolume == 0) + if (!device->isInitialised) { return 0; } @@ -65,6 +65,11 @@ int MusicPlay(SoundDevice *device, const char *path) Mix_PlayMusic(device->music, -1); device->musicStatus = MUSIC_PLAYING; + if (gConfig.Sound.MusicVolume == 0) + { + MusicPause(device); + } + return 0; } @@ -78,6 +83,24 @@ void MusicStop(SoundDevice *device) } } +void MusicPause(SoundDevice *device) +{ + if (device->musicStatus == MUSIC_PLAYING) + { + Mix_PauseMusic(); + device->musicStatus = MUSIC_PAUSED; + } +} + +void MusicResume(SoundDevice *device) +{ + if (device->musicStatus == MUSIC_PAUSED) + { + Mix_ResumeMusic(); + device->musicStatus = MUSIC_PLAYING; + } +} + int MusicGetStatus(SoundDevice *device) { return device->musicStatus; diff --git a/src/cdogs/music.h b/src/cdogs/music.h index 60d3166b2..847846981 100644 --- a/src/cdogs/music.h +++ b/src/cdogs/music.h @@ -53,6 +53,8 @@ int MusicPlay(SoundDevice *device, const char *path); void MusicStop(SoundDevice *device); +void MusicPause(SoundDevice *device); +void MusicResume(SoundDevice *device); int MusicGetStatus(SoundDevice *device); const char *MusicGetErrorMessage(SoundDevice *device); diff --git a/src/cdogs/sounds.c b/src/cdogs/sounds.c index a3c919df0..73fc2afd9 100644 --- a/src/cdogs/sounds.c +++ b/src/cdogs/sounds.c @@ -177,6 +177,14 @@ void SoundReconfigure(SoundDevice *device, SoundConfig *config) Mix_Volume(-1, config->SoundVolume); Mix_VolumeMusic(config->MusicVolume); + if (config->MusicVolume > 0) + { + MusicResume(device); + } + else + { + MusicPause(device); + } device->isInitialised = 1; } @@ -227,8 +235,6 @@ void SoundPlayAtPosition( debug(D_VERBOSE, "sound: %d distance: %d bearing: %d\n", sound, distance, bearing); - printf("sound: %d distance: %d bearing: %d\n", - sound, distance, bearing); channel = Mix_PlayChannel(-1, device->sounds[sound].data , 0); Mix_SetPosition(channel, (Sint16)bearing, (Uint8)distance);