make textures_dump_atlases work again and expose it as a utility function
This commit is contained in:
@ -300,31 +300,6 @@ void textures_cache_deinit(TextureCache *cache) {
|
||||
}
|
||||
|
||||
|
||||
void textures_dump_atlases(TextureCache *cache) {
|
||||
PHYSFS_mkdir("/dump");
|
||||
|
||||
const char string_template[] = "/dump/atlas%zd.png";
|
||||
char buf[2048]; /* larger than will ever be necessary */
|
||||
|
||||
size_t i = 0;
|
||||
for (; i < arrlenu(cache->atlas_surfaces); ++i) {
|
||||
SDL_snprintf(buf, sizeof buf, string_template, i);
|
||||
|
||||
SDL_RWops *handle = PHYSFSRWOPS_openWrite(buf);
|
||||
|
||||
if (handle == NULL) {
|
||||
CRY("Texture atlas dump failed.", "File could not be opened");
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO: */
|
||||
// IMG_SavePNG_RW(cache->atlas_surfaces[i], handle, true);
|
||||
CRY("Unimplemented", "textures_dump_atlases dumping is not there, sorry");
|
||||
log_info("Dumped atlas %s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static enum TextureMode infer_texture_mode(SDL_Surface *surface) {
|
||||
const uint32_t amask = surface->format->Amask;
|
||||
if (amask == 0)
|
||||
|
Reference in New Issue
Block a user