diff options
author | Treeki <treeki@gmail.com> | 2014-06-03 05:55:54 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-06-03 05:55:54 +0200 |
commit | 7a9387269e3b123b1647cf59c78cc6c998a9a330 (patch) | |
tree | 7874647c497a6b6113f660ff27f6f79b7fc7d4aa /layoutgl/texturemanager.cpp | |
parent | be8b56a7f0a8f6ba5456a099b61d032fd8aa2f61 (diff) | |
download | LayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.tar.gz LayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.zip |
experimental 3DS support
Diffstat (limited to 'layoutgl/texturemanager.cpp')
-rw-r--r-- | layoutgl/texturemanager.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/layoutgl/texturemanager.cpp b/layoutgl/texturemanager.cpp index 80a8186..896c40f 100644 --- a/layoutgl/texturemanager.cpp +++ b/layoutgl/texturemanager.cpp @@ -1,4 +1,5 @@ #include "texturemanager.h" +#include "ctr/image.h" LGLTextureManager::LGLTextureManager() { } @@ -16,12 +17,16 @@ void LGLTextureManager::setup(QGLWidget *gl, const LYTLayout *layout) { qDebug() << texName; QByteArray tplData = m_package->getTexture(texName); + if (tplData.isEmpty()) { + qDebug() << "[[[ NON-EXISTENT TEXTURE! ]]]"; + continue; + } QDataStream tplStream(tplData); - WiiTexPalette tpl(tplStream); + CTRImageCollection tpl(tplStream); - const QImage &image = tpl.textures.first().image; - image.save(QString("tpl/%2__%1.png").arg(texName).arg((int)tpl.textures.first().format)); + const QImage &image = tpl.images.first().image; + image.save(QString("tpl/%2__%1.png").arg(texName).arg((int)tpl.images.first().format)); // dirty, dirty hack, TODO: FIXME GLuint tex = gl->bindTexture(image, GL_TEXTURE_2D); |