Skip to content

Commit

Permalink
Load music for GCW0 and skip txt files (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Sep 2, 2014
1 parent 4506ca8 commit d1959a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cdogs/gamedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,10 @@ void FreeSongs(struct SongDef **songList)

void LoadSongs(void)
{
#ifndef __GCWZERO__
debug(D_NORMAL, "loading game music %s\n", CDOGS_GAME_MUSIC_DIR);
LoadSongList(&gGameSongs, CDOGS_GAME_MUSIC_DIR);
debug(D_NORMAL, "loading menu music %s\n", CDOGS_MENU_MUSIC_DIR);
LoadSongList(&gMenuSongs, CDOGS_MENU_MUSIC_DIR);
#endif
}

void LoadSongList(struct SongDef **songList, const char *dirPath)
Expand Down Expand Up @@ -326,6 +324,12 @@ void LoadSongList(struct SongDef **songList, const char *dirPath)
debug(D_VERBOSE, "not a regular file %s\n", file.name);
continue;
}
if (strcmp(file.extension, "txt") == 0 ||
strcmp(file.extension, "TXT") == 0)
{
debug(D_VERBOSE, "Skipping text file %s\n", file.name);
continue;
}

m = Mix_LoadMUS(file.path);
if (m == NULL)
Expand Down

1 comment on commit d1959a9

@carstene1ns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.