mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-08 08:43:51 +01:00
Reformat test/image_loader_test.cpp manually
This commit is contained in:
parent
b01a3ea781
commit
7cf801244c
@ -6,14 +6,16 @@
|
|||||||
|
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
|
|
||||||
struct ImageDesc {
|
struct ImageDesc
|
||||||
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
video::ECOLOR_FORMAT format;
|
video::ECOLOR_FORMAT format;
|
||||||
std::vector<u8> data;
|
std::vector<u8> data;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::vector<u8> to_byte_array(std::initializer_list<T> in_data) {
|
std::vector<u8> to_byte_array(std::initializer_list<T> in_data)
|
||||||
|
{
|
||||||
std::vector<u8> data;
|
std::vector<u8> data;
|
||||||
data.resize(sizeof(T) * in_data.size());
|
data.resize(sizeof(T) * in_data.size());
|
||||||
memcpy(data.data(), in_data.begin(), data.size());
|
memcpy(data.data(), in_data.begin(), data.size());
|
||||||
@ -114,7 +116,7 @@ try {
|
|||||||
throw std::runtime_error("Invalid arguments. Expected sample ID and image file name");
|
throw std::runtime_error("Invalid arguments. Expected sample ID and image file name");
|
||||||
|
|
||||||
const ImageDesc *sample = nullptr;
|
const ImageDesc *sample = nullptr;
|
||||||
for (auto &&image: test_images) {
|
for (auto &&image : test_images) {
|
||||||
if (strcmp(argv[1], image.name) == 0)
|
if (strcmp(argv[1], image.name) == 0)
|
||||||
sample = ℑ
|
sample = ℑ
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user