remove(tempPath);
- SDL_Delay(250); // wait a bit, just to be sure!
-
if (music != NULL)
{
Mix_HaltMusic();
return false;
}
- snprintf(tempPath, sizeof tempPath, "%s.tags", filename);
+ #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];
*/
#include "headers.h"
+#include <errno.h>
Engine::Engine()
{
}
}
- if ((fileType == PAK_MUSIC) || (fileType == PAK_FONT))
+ if ((fileType == PAK_MUSIC) || (fileType == PAK_FONT) || (fileType == PAK_TAGS))
{
char tempPath[PATH_MAX];
fp = fopen(tempPath, "wb");
}
+ if (fileType == PAK_TAGS)
+ {
+ snprintf(tempPath, sizeof tempPath, "%smusic.tags", userHomeDirectory);
+ fp = fopen(tempPath, "wb");
+ }
+
if (fileType == PAK_FONT)
{
snprintf(tempPath, sizeof tempPath, "%sfont.ttf", userHomeDirectory);
if (!fp)
{
+ printf("Fatal Error: could not open %s for writing: %s", tempPath, strerror(errno));
return false;
}