diff options
author | BogDan Vatra <bogdan@kdab.com> | 2016-12-06 11:30:59 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-12-07 13:22:11 +0000 |
commit | 886594c2b75c02e06269dc1c265b5422f8ccb4a0 (patch) | |
tree | 2ca37fbaee54e3af1e491c99b065af6801c53963 | |
parent | 22f6718ec4da3851de913d2de18dc0375574a458 (diff) |
Handle Android assets
Allow the user to load textures from Android's assets
Change-Id: Ia6cb67419345c0120f9a8af3c22bdce22b02c930
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/texture/qtexture.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/render/texture/qtexture.cpp b/src/render/texture/qtexture.cpp index a566ecc36..4aa28aa1c 100644 --- a/src/render/texture/qtexture.cpp +++ b/src/render/texture/qtexture.cpp @@ -626,7 +626,11 @@ QTextureImageDataPtr setDdsFile(const QString &source) QTextureImageDataPtr TextureLoadingHelper::loadTextureData(const QUrl &url, bool allow3D, bool mirrored) { QTextureImageDataPtr textureData; - if (url.isLocalFile() || url.scheme() == QLatin1String("qrc")) { + if (url.isLocalFile() || url.scheme() == QLatin1String("qrc") +#ifdef Q_OS_ANDROID + || url.scheme() == QLatin1String("assets") +#endif + ) { const QString source = Qt3DRender::QUrlHelper::urlToLocalFileOrQrc(url); const CompressedFormatExtension formatExtension = texturedCompressedFormat(source); switch (formatExtension) { |