From d06dcbaba14ab511eedf30ae39418989f0139499 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 23 May 2024 13:55:54 +0200 Subject: b --- loader/error-tex.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'loader/error-tex.cpp') 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{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)}; -- cgit v1.2.3