Mercurial > repos > blastem
comparison blastem.c @ 2438:bed4d3db8a3f
More flexible loading of Pico storyware assets
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 11 Feb 2024 11:04:39 -0800 |
parents | fb8d6ebf9d5f |
children | cb62730d5c99 |
comparison
equal
deleted
inserted
replaced
2437:79a8cccb6ac1 | 2438:bed4d3db8a3f |
---|---|
171 if (!dst->dir) { | 171 if (!dst->dir) { |
172 dst->dir = path_current_dir(); | 172 dst->dir = path_current_dir(); |
173 } | 173 } |
174 dst->name = basename_no_extension(filename); | 174 dst->name = basename_no_extension(filename); |
175 dst->size = out_size; | 175 dst->size = out_size; |
176 zip_close(z); | 176 dst->zip = z; |
177 return out_size; | 177 return out_size; |
178 } | 178 } |
179 } | 179 } |
180 } | 180 } |
181 free(ext); | 181 free(ext); |
185 } | 185 } |
186 | 186 |
187 uint32_t load_media(char * filename, system_media *dst, system_type *stype) | 187 uint32_t load_media(char * filename, system_media *dst, system_type *stype) |
188 { | 188 { |
189 uint8_t header[10]; | 189 uint8_t header[10]; |
190 if (dst->zip) { | |
191 zip_close(dst->zip); | |
192 } | |
190 dst->orig_path = filename; | 193 dst->orig_path = filename; |
191 char *ext = path_extension(filename); | 194 char *ext = path_extension(filename); |
192 if (ext && !strcasecmp(ext, "zip")) { | 195 if (ext && !strcasecmp(ext, "zip")) { |
193 free(ext); | 196 free(ext); |
194 return load_media_zip(filename, dst); | 197 return load_media_zip(filename, dst); |