resource/texture_loader: remove bad assert; handle r_texture_create() failure

This commit is contained in:
Andrei Alexeyev 2024-08-27 19:59:58 +02:00
parent 26959c4a1f
commit 718fc9685f
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 11 additions and 2 deletions

View file

@ -362,8 +362,6 @@ uncompressed:
}
assert(qr.supplied_pixmap_format_supported);
assert(qr.supplied_pixmap_origin_supported);
return qr.optimal_pixmap_format;
}

View file

@ -852,11 +852,22 @@ static void texture_loader_stage2(ResourceLoadState *st) {
texture = r_texture_create(&p);
if(!texture) {
texture_loader_failed(ld);
return;
}
char namebuf[strlen(st->name) + sizeof(" (transient)")];
snprintf(namebuf, sizeof(namebuf), "%s (transient)", st->name);
r_texture_set_debug_label(texture, namebuf);
} else {
texture = r_texture_create(&ld->params);
if(!texture) {
texture_loader_failed(ld);
return;
}
r_texture_set_debug_label(texture, st->name);
}