diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2015-01-28 14:34:26 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-02-08 15:02:02 +0000 |
commit | af3eb98b22a83275335d6ac702ed7ba0e8b394bb (patch) | |
tree | 984d41b72e18ed0448b9ecbfdda6c5ad0e27abdc /src/render/io/gltfparser.cpp | |
parent | 6ac96d11449769118dc1f5b443fc7112bed3facc (diff) |
Make ctor of QAbstractTextureProvider protected
That enforces to use one of the subclasses.
Change-Id: Idba7300ed322954ba6866c4a262ad4ee74c024e5
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/io/gltfparser.cpp')
-rw-r--r-- | src/render/io/gltfparser.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp index b135fc3b0..710170bf0 100644 --- a/src/render/io/gltfparser.cpp +++ b/src/render/io/gltfparser.cpp @@ -792,38 +792,40 @@ void GLTFParser::processJSONImage( QString id, QJsonObject jsonObj) void GLTFParser::processJSONTexture( QString id, QJsonObject jsonObj) { - int target = jsonObj.value(KEY_TARGET).toInt(); - QAbstractTextureProvider* tex = new QAbstractTextureProvider(static_cast<QAbstractTextureProvider::Target>(target)); + Q_UNUSED(id) + Q_UNUSED(jsonObj) +// int target = jsonObj.value(KEY_TARGET).toInt(); +// QAbstractTextureProvider* tex = new QAbstractTextureProvider(static_cast<QAbstractTextureProvider::Target>(target)); - // TODO: Choose suitable internal format - may vary on OpenGL context type - //int pixelFormat = jsonObj.value(KEY_FORMAT).toInt(); - //int internalFormat = jsonObj.value(KEY_INTERNAL_FORMAT).toInt(); +// // TODO: Choose suitable internal format - may vary on OpenGL context type +// //int pixelFormat = jsonObj.value(KEY_FORMAT).toInt(); +// //int internalFormat = jsonObj.value(KEY_INTERNAL_FORMAT).toInt(); - tex->setFormat(QAbstractTextureProvider::RGBA8_UNorm /* static_cast<QOpenGLTexture::TextureFormat>(internalFormat)*/); +// tex->setFormat(QAbstractTextureProvider::RGBA8_UNorm /* static_cast<QOpenGLTexture::TextureFormat>(internalFormat)*/); - QString samplerId = jsonObj.value(KEY_SAMPLER).toString(); - QString source = jsonObj.value(KEY_SOURCE).toString(); - if (!m_images.contains(source)) { - qCWarning(Render::Io) << "texture" << id << "references missing image" << source; - return; - } +// QString samplerId = jsonObj.value(KEY_SAMPLER).toString(); +// QString source = jsonObj.value(KEY_SOURCE).toString(); +// if (!m_images.contains(source)) { +// qCWarning(Render::Io) << "texture" << id << "references missing image" << source; +// return; +// } - tex->setFromQImage(m_images[source]); +// tex->setFromQImage(m_images[source]); - QJsonObject samplersDict(m_json.object().value(KEY_SAMPLERS).toObject()); - if (!samplersDict.contains(samplerId)) { - qCWarning(Render::Io) << "texture" << id << "references unknown sampler" << samplerId; - return; - } +// QJsonObject samplersDict(m_json.object().value(KEY_SAMPLERS).toObject()); +// if (!samplersDict.contains(samplerId)) { +// qCWarning(Render::Io) << "texture" << id << "references unknown sampler" << samplerId; +// return; +// } - QJsonObject sampler = samplersDict.value(samplerId).toObject(); +// QJsonObject sampler = samplersDict.value(samplerId).toObject(); - tex->setWrapMode(QTextureWrapMode(static_cast<QTextureWrapMode::WrapMode>(sampler.value(KEY_WRAP_S).toInt()))); - tex->setMinificationFilter(static_cast<QAbstractTextureProvider::Filter>(sampler.value(KEY_MIN_FILTER).toInt())); - tex->setMagnificationFilter(static_cast<QAbstractTextureProvider::Filter>(sampler.value(KEY_MAG_FILTER).toInt())); +// tex->setWrapMode(QTextureWrapMode(static_cast<QTextureWrapMode::WrapMode>(sampler.value(KEY_WRAP_S).toInt()))); +// tex->setMinificationFilter(static_cast<QAbstractTextureProvider::Filter>(sampler.value(KEY_MIN_FILTER).toInt())); +// tex->setMagnificationFilter(static_cast<QAbstractTextureProvider::Filter>(sampler.value(KEY_MAG_FILTER).toInt())); - m_textures[id] = tex; +// m_textures[id] = tex; } void GLTFParser::processJSONTechnique( QString id, QJsonObject jsonObj ) |