+
+ #if USEPAK
+ snprintf(tempPath, sizeof tempPath, "%smusic.tags", engine->userHomeDirectory);
+ remove(tempPath);
+ char tagfilename[PATH_MAX];
+ snprintf(tagfilename, sizeof tagfilename, "%s.tags", filename);
+ engine->unpack(tagfilename, PAK_TAGS);
+ #else
+ snprintf(tempPath, sizeof tempPath, "%s.tags", filename);
+ #endif
+ FILE *fp = fopen(tempPath, "r");
+ char line[1024];
+
+ while(fp && fgets(line, sizeof line, fp))
+ {
+ int l = strlen(line);
+ if(line[l - 1] == '\n')
+ line[l - 1] = 0;
+
+ if(!strncasecmp(line, "title=", 6))
+ strlcpy(songtitle, line + 6, sizeof songtitle);
+ else if(!strncasecmp(line, "album=", 6))
+ strlcpy(songalbum, line + 6, sizeof songalbum);
+ else if(!strncasecmp(line, "artist=", 7))
+ strlcpy(songartist, line + 7, sizeof songartist);
+ else if(!strncasecmp(line, "license=", 8))
+ {
+ if(!strncasecmp(line + 8, "CC-BY ", 6))
+ songlicense = 0;
+ else if(!strncasecmp(line + 8, "CC-BY-SA ", 9))
+ songlicense = 1;
+ }
+ }
+
+ if(fp)
+ fclose(fp);
+
+ strlcpy(levelMusicName, filename, sizeof levelMusicName);