diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 16:40:29 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 16:40:29 +0100 |
commit | ba90ba2ca91c448d80722985811fc6bddc6e9bf2 (patch) | |
tree | 2a81ee054bad7f76457be6e91359039fcc9a8780 /loader/texture.cpp | |
parent | d74df1b763979d281f76f3f30543aee8d8a638b7 (diff) |
w
Diffstat (limited to 'loader/texture.cpp')
-rw-r--r-- | loader/texture.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/loader/texture.cpp b/loader/texture.cpp index 60372d00..59e8f25a 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_, bool fail_ok) noexcept(false) +Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_) noexcept(false) { ensure_plugins(); @@ -45,13 +45,11 @@ Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_, return ret; } } + const auto path = Path::currentDirectory(); buf[len] = '\0'; char errbuf[128]; - 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({1,1}); + fm_throw("can't open image '{}' (cwd '{}'): {}"_cf, buf, path ? StringView{*path} : "(null)"_s, get_error_string(errbuf)); } } // namespace floormat::loader_detail |