summaryrefslogtreecommitdiff
path: root/layoutgl/texturemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layoutgl/texturemanager.cpp')
-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);