In the middle of multithreading parsers.
This commit is contained in:
29
source/assets/fallback_data/default_texture_data.cpp
Normal file
29
source/assets/fallback_data/default_texture_data.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "assets/fallback_data/fallback_texture.hpp"
|
||||
|
||||
assets::texture_data assets::generate_fallback_texture(
|
||||
const int width,
|
||||
const int height,
|
||||
const std::span<const fallback_color> colors
|
||||
) {
|
||||
const auto pixel_count = width * height;
|
||||
|
||||
auto data = std::make_unique<texture_data::value_type[]>(pixel_count * sizeof(fallback_color));
|
||||
|
||||
auto pixels = reinterpret_cast<fallback_color*>(data.get());
|
||||
|
||||
for (int y{}; y != height; ++y)
|
||||
{
|
||||
for (int x{}; x != width; ++x)
|
||||
{
|
||||
const auto index = (x + y) % colors.size();
|
||||
*pixels++ = colors[index];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
std::move(data),
|
||||
width,
|
||||
height,
|
||||
fallback_color::components
|
||||
};
|
||||
}
|
||||
8
source/assets/fallback_data/fallback_material.cpp
Normal file
8
source/assets/fallback_data/fallback_material.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "assets/fallback_data/fallback_material.hpp"
|
||||
|
||||
assets::material_data generate_fallback_material()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user