Show the filename when a texture fails to load

This commit is contained in:
Dale Glass 2022-06-20 23:12:58 +02:00
parent 95ebe6bab0
commit 2fb3a10262

View file

@ -353,7 +353,7 @@ std::pair<gpu::TexturePointer, glm::ivec2> processImage(std::shared_ptr<QIODevic
// Validate that the image loaded
if (imageWidth == 0 || imageHeight == 0 || image.getFormat() == Image::Format_Invalid) {
QString reason(image.getFormat() == Image::Format_Invalid ? "(Invalid Format)" : "(Size is invalid)");
qCWarning(imagelogging) << "Failed to load:" << qPrintable(reason);
qCWarning(imagelogging) << "Failed to load" << QString::fromStdString(filename) << ":" << qPrintable(reason);
return { nullptr, { imageWidth, imageHeight } };
}