diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2018-09-20 12:05:50 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2018-09-20 09:10:38 +0000 |
commit | 411d877bd1e4068d63f2ecbd448b8c3585c3f25d (patch) | |
tree | 6006d2324d0f4955d4b6b1143c7b56d270102db0 | |
parent | dd99afd4250d922309248ee82df613ab26d0bd16 (diff) |
Fix editor crash if ktx textures are used
Task-number: QT3DS-2374
Change-Id: Icec96f4322d4e52229bfe3d1ba522bb0b8809efa
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Runtime/Source/Qt3DSRuntimeRender/ResourceManager/Qt3DSRenderLoadedTexture.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Runtime/Source/Qt3DSRuntimeRender/ResourceManager/Qt3DSRenderLoadedTexture.cpp b/src/Runtime/Source/Qt3DSRuntimeRender/ResourceManager/Qt3DSRenderLoadedTexture.cpp index ce9ed6fc..0b47a7e6 100644 --- a/src/Runtime/Source/Qt3DSRuntimeRender/ResourceManager/Qt3DSRenderLoadedTexture.cpp +++ b/src/Runtime/Source/Qt3DSRuntimeRender/ResourceManager/Qt3DSRenderLoadedTexture.cpp @@ -655,27 +655,27 @@ SLoadedTexture *SLoadedTexture::Load(const QString &inPath, NVFoundationBase &in NVRenderContextType renderContextType) { if (inPath.isEmpty()) - return NULL; + return nullptr; - SLoadedTexture *theLoadedImage = NULL; + SLoadedTexture *theLoadedImage = nullptr; NVScopedRefCounted<IRefCountedInputStream> theStream(inFactory.GetStreamForFile(inPath)); QString fileName; inFactory.GetPathForFile(inPath, fileName); if (theStream.mPtr && inPath.size() > 3) { - if (inPath.endsWith("png", Qt::CaseInsensitive)) + if (inPath.endsWith("png", Qt::CaseInsensitive) + || inPath.endsWith("jpg", Qt::CaseInsensitive) + || inPath.endsWith("peg", Qt::CaseInsensitive) + || inPath.endsWith("ktx", Qt::CaseInsensitive)) { theLoadedImage = LoadQImage(fileName, inFlipY, inFoundation, renderContextType); - else if (inPath.endsWith("jpg", Qt::CaseInsensitive) - || inPath.endsWith("peg", Qt::CaseInsensitive)) - theLoadedImage = LoadQImage(fileName, inFlipY, inFoundation, renderContextType); - else if (inPath.endsWith("dds", Qt::CaseInsensitive)) + } else if (inPath.endsWith("dds", Qt::CaseInsensitive)) { theLoadedImage = LoadDDS(*theStream, inFlipY, inFoundation, renderContextType); - else if (inPath.endsWith("gif", Qt::CaseInsensitive)) + } else if (inPath.endsWith("gif", Qt::CaseInsensitive)) { theLoadedImage = LoadGIF(*theStream, !inFlipY, inFoundation, renderContextType); - else if (inPath.endsWith("bmp", Qt::CaseInsensitive)) + } else if (inPath.endsWith("bmp", Qt::CaseInsensitive)) { theLoadedImage = LoadBMP(*theStream, !inFlipY, inFoundation, renderContextType); - else if (inPath.endsWith("hdr", Qt::CaseInsensitive)) + } else if (inPath.endsWith("hdr", Qt::CaseInsensitive)) { theLoadedImage = LoadHDR(*theStream, inFoundation, renderContextType); - else { + } else { qCCritical(INTERNAL_ERROR, "Unrecognized image extension: %s", qPrintable(inPath)); } } |