diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-23 13:55:54 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-23 13:55:54 +0200 |
| commit | d06dcbaba14ab511eedf30ae39418989f0139499 (patch) | |
| tree | aade509e608830d41bc2bdc5a99d90691efe3f53 /loader/error-tex.cpp | |
| parent | 50750ecf026d3fd382869b446d9a799525694a64 (diff) | |
b
Diffstat (limited to 'loader/error-tex.cpp')
| -rw-r--r-- | loader/error-tex.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/loader/error-tex.cpp b/loader/error-tex.cpp index dac5992c..bcb53898 100644 --- a/loader/error-tex.cpp +++ b/loader/error-tex.cpp @@ -9,13 +9,18 @@ namespace floormat::loader_detail { Trade::ImageData2D loader_impl::make_error_texture(Vector2ui size) { - fm_assert(size.product() != 0); constexpr auto magenta = Vector4ub{255, 0, 255, 255}; + return make_error_texture(size, magenta); +} + +Trade::ImageData2D loader_impl::make_error_texture(Vector2ui size, Vector4ub color) +{ + fm_assert(size.product() != 0); auto array = Array<char>{NoInit, 4uz * size.product()}; auto data = array.data(), end = data + array.size(); while (data != end) { - *(Vector4ub*)data = magenta; + *(Vector4ub*)data = color; data += 4; } auto img = Trade::ImageData2D{PixelFormat::RGBA8Unorm, Vector2i(size), move(array)}; |
