- char string[BCTEXTLEN];
- sprintf(string, "%s\n", list_prefix);
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "# First line is always %s\n", list_prefix);
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "# Frame rate:\n");
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "%f\n", asset->frame_rate);
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "# Width:\n");
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "%d\n", asset->width);
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "# Height:\n");
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "%d\n", asset->height);
- fwrite(string, strlen(string), 1, stream);
- sprintf(string, "# List of image files follows\n");
- fwrite(string, strlen(string), 1, stream);
-
- for(int i = 0; i < path_list.total; i++)
- {
+ fprintf(stream, "%s\n", list_prefix);
+ fprintf(stream, "# First line is always %s\n", list_prefix);
+ fprintf(stream, "# Frame rate:\n");
+ fprintf(stream, "%f\n", asset->frame_rate);
+ fprintf(stream, "# Width:\n");
+ fprintf(stream, "%d\n", asset->width);
+ fprintf(stream, "# Height:\n");
+ fprintf(stream, "%d\n", asset->height);
+ fprintf(stream, "# List of image files follows\n");
+
+ char *cp = strrchr(asset->path, '/');
+ int dir_len = !cp ? 0 : cp - asset->path;
+
+ for(int i = 0; i < path_list.total; i++) {
+ const char *path = path_list.values[i];