summaryrefslogtreecommitdiff
path: root/layoutgl/texturemanager.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2014-06-03 05:55:54 +0200
committerTreeki <treeki@gmail.com>2014-06-03 05:55:54 +0200
commit7a9387269e3b123b1647cf59c78cc6c998a9a330 (patch)
tree7874647c497a6b6113f660ff27f6f79b7fc7d4aa /layoutgl/texturemanager.cpp
parentbe8b56a7f0a8f6ba5456a099b61d032fd8aa2f61 (diff)
downloadLayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.tar.gz
LayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.zip
experimental 3DS support
Diffstat (limited to '')
-rw-r--r--layoutgl/texturemanager.cpp11
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);