mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
Don't process empty images
This commit is contained in:
parent
104dbabee9
commit
e2c4af05bd
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
|
||||
gpu::TexturePointer TextureCache::getImageTexture(const QString& path, image::TextureUsage::Type type, QVariantMap options) {
|
||||
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);
|
||||
return gpu::TexturePointer(loader(std::move(image), path.toStdString(), false));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue