Merge pull request #97 from daleglass-overte/show-texture-filename

Show the filename when a texture fails to load
This commit is contained in:
Dale Glass 2022-06-26 18:11:39 +02:00 committed by GitHub
commit c6222144bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 } };
}