Warn about unknown pixel format instead of throwing

This commit is contained in:
Nikita Lisitsa 2023-02-28 01:36:17 +03:00
parent ac436cb155
commit cc7135a0f4

View file

@ -1,6 +1,8 @@
#include <psemek/gfx/pixel.hpp>
#include <psemek/util/to_string.hpp>
#include <psemek/log/log.hpp>
namespace psemek::gfx
{
@ -70,7 +72,8 @@ namespace psemek::gfx
case gl::COMPRESSED_SIGNED_RED_RGTC1: return 1;
};
throw std::runtime_error(util::to_string("unknown pixel format: 0x", std::hex, internal_format));
log::warning() << "Unknown pixel format: 0x" << std::hex << internal_format;
return 0;
}
}