mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Don't process empty images
This commit is contained in:
parent
398b37ffe9
commit
1fb125f67f
1 changed files with 4 additions and 0 deletions
|
@ -265,6 +265,10 @@ gpu::TexturePointer getFallbackTextureForType(image::TextureUsage::Type type) {
|
||||||
/// Returns a texture version of an image file
|
/// Returns a texture version of an image file
|
||||||
gpu::TexturePointer TextureCache::getImageTexture(const QString& path, image::TextureUsage::Type type, QVariantMap options) {
|
gpu::TexturePointer TextureCache::getImageTexture(const QString& path, image::TextureUsage::Type type, QVariantMap options) {
|
||||||
QImage image = QImage(path);
|
QImage image = QImage(path);
|
||||||
|
if (image.isNull()) {
|
||||||
|
qCWarning(networking) << "Unable to load required resource texture" << path;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
auto loader = image::TextureUsage::getTextureLoaderForType(type, options);
|
auto loader = image::TextureUsage::getTextureLoaderForType(type, options);
|
||||||
return gpu::TexturePointer(loader(std::move(image), path.toStdString(), false));
|
return gpu::TexturePointer(loader(std::move(image), path.toStdString(), false));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue