simplify texture load
This commit is contained in:
parent
44c50717c3
commit
aac5027ec6
|
|
@ -441,21 +441,7 @@ std::tuple<std::optional<img::texture>, fs::resolve_result, fs::data> load_textu
|
||||||
|
|
||||||
if (auto pos = fs::where(p, options.filepriority.value() == settings::search_priority_t::LOOSE)) {
|
if (auto pos = fs::where(p, options.filepriority.value() == settings::search_priority_t::LOOSE)) {
|
||||||
if (auto data = fs::load(pos)) {
|
if (auto data = fs::load(pos)) {
|
||||||
std::optional<img::texture> texture;
|
if (auto texture = ext.loader(name.data(), data, meta_only, game)) {
|
||||||
|
|
||||||
switch (ext.id) {
|
|
||||||
case img::ext::TGA:
|
|
||||||
texture = img::load_tga(name.data(), data, meta_only, game);
|
|
||||||
break;
|
|
||||||
case img::ext::WAL:
|
|
||||||
texture = img::load_wal(name.data(), data, meta_only, game);
|
|
||||||
break;
|
|
||||||
case img::ext::MIP:
|
|
||||||
texture = img::load_mip(name.data(), data, meta_only, game);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture) {
|
|
||||||
return {texture, pos, data};
|
return {texture, pos, data};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue