summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--loader/error-tex.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/loader/error-tex.cpp b/loader/error-tex.cpp
index 7f91f032..c3a0a58b 100644
--- a/loader/error-tex.cpp
+++ b/loader/error-tex.cpp
@@ -11,9 +11,14 @@ Trade::ImageData2D loader_impl::make_error_texture(Vector2ui size)
{
fm_assert(size.product() != 0);
constexpr auto magenta = Vector4ub{255, 0, 255, 255};
- auto array = Array<Vector4ub>{DirectInit, size.product(), magenta};
- auto img = Trade::ImageData2D{PixelFormat::RGBA8Unorm, Vector2i(size), {},
- std::move(array), {}, {}};
+ auto array = Array<char>{NoInit, 4 * size.product()};
+ auto data = array.data(), end = data + array.size();
+ while (data != end)
+ {
+ *(Vector4ub*)data = magenta;
+ data += 4;
+ }
+ auto img = Trade::ImageData2D{PixelFormat::RGBA8Unorm, Vector2i(size), std::move(array)};
return img;
}