summaryrefslogtreecommitdiffhomepage
path: root/loader/error-tex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'loader/error-tex.cpp')
-rw-r--r--loader/error-tex.cpp9
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)};