Long overdue removal of bgm.conf. Specify metadata in .bgm files instead.

This commit is contained in:
Andrei Alexeyev 2018-05-19 05:09:10 +03:00
parent fdfc2de543
commit f44e267188
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
2 changed files with 1 additions and 28 deletions

View file

@ -1,14 +0,0 @@
stage1 = Generic Stage 1 Theme
stage2 = Generic Stage 2 Theme
stage3 = Generic Stage 3 Theme
stage4 = Generic Stage 4 Theme
stage5 = Generic Stage 5 Theme
stage6 = Generic Stage 6 Theme
stage1boss = Stage 1 Boss Theme
stage2boss = Stage 2 Boss Theme
stage3boss = Stage 3 Boss Theme
stage4boss = Stage 4 Boss Theme
stage5boss = Stage 5 Boss Theme
stage6boss = Stage 6 Boss Theme

View file

@ -18,7 +18,6 @@
CurrentBGM current_bgm = { .name = NULL };
static char *saved_bgm;
static Hashtable *bgm_descriptions;
static Hashtable *sfx_volumes;
static struct enqueued_sound {
@ -197,7 +196,6 @@ static bool store_sfx_volume(const char *key, const char *val, void *data) {
}
static void load_config_files(void) {
bgm_descriptions = parse_keyvalue_file(BGM_PATH_PREFIX "bgm.conf");
sfx_volumes = hashtable_new_stringkeys();
parse_keyvalue_file_cb(SFX_PATH_PREFIX "volumes.conf", store_sfx_volume, sfx_volumes);
}
@ -205,12 +203,7 @@ static void load_config_files(void) {
static inline char* get_bgm_desc(char *name) {
Music *music = get_music(name);
assert(music != NULL);
if(music->title) {
return music->title;
}
return bgm_descriptions ? (char*)hashtable_get_string(bgm_descriptions, name) : NULL;
return music->title;
}
int get_default_sfx_volume(const char *sfx) {
@ -329,12 +322,6 @@ void audio_init(void) {
void audio_shutdown(void) {
audio_backend_shutdown();
if(bgm_descriptions) {
hashtable_foreach(bgm_descriptions, hashtable_iter_free_data, NULL);
hashtable_free(bgm_descriptions);
bgm_descriptions = NULL;
}
if(sfx_volumes) {
hashtable_free(sfx_volumes);
sfx_volumes = NULL;