diff options
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 |