diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-07 09:27:52 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-09 05:08:48 +0100 |
| commit | 459e94900d06ea79b7fb215880e336a8cba156ca (patch) | |
| tree | c099f716f75c8bbb94b77d6fcf5478ae9b72e8ca /loader/texture.cpp | |
| parent | 142a53e157d5f1f591feb2560b2e6260e4a2a249 (diff) | |
wipshit
Diffstat (limited to 'loader/texture.cpp')
| -rw-r--r-- | loader/texture.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/loader/texture.cpp b/loader/texture.cpp index 28b903c2..1e4ac709 100644 --- a/loader/texture.cpp +++ b/loader/texture.cpp @@ -12,7 +12,7 @@ namespace floormat::loader_detail { fm_noinline -Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_) noexcept(false) +Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_, bool fail_ok) noexcept(false) { ensure_plugins(); @@ -48,7 +48,10 @@ Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_) const auto path = Path::currentDirectory(); buf[len] = '\0'; char errbuf[128]; - fm_throw("can't open image '{}' (cwd '{}'): {}"_cf, buf, path ? StringView{*path} : "(null)"_s, get_error_string(errbuf)); + if (!fail_ok) + fm_throw("can't open image '{}' (cwd '{}'): {}"_cf, buf, path ? StringView{*path} : "(null)"_s, get_error_string(errbuf)); + else + return make_error_texture(); } } // namespace floormat::loader_detail |
