summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-08 23:10:11 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-08 23:10:11 (GMT)
commit62fac41edfff5e42e4c3308376cb08e5d9a10afe (patch)
treec63f92817a7f2f8cbb203fe21d61df556605ca90
parent51297287f1be5c31337203cbf5a0e3eae6047a88 (diff)
downloadQt-62fac41edfff5e42e4c3308376cb08e5d9a10afe.zip
Qt-62fac41edfff5e42e4c3308376cb08e5d9a10afe.tar.gz
Qt-62fac41edfff5e42e4c3308376cb08e5d9a10afe.tar.bz2
Fix upside down PVR compressed textures.
The "vertical flip" flag in the PVR format is the inverse of the "inverted y" state that we use in Qt. Reviewed-by: trustme
-rw-r--r--src/opengl/qgl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 967ba48..8003a29 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -5363,11 +5363,12 @@ QSize QGLTexture::bindCompressedTexturePVR(const char *buf, int len)
// Restore the default pixel alignment for later texture uploads.
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- // Set the invert flag for the texture.
+ // Set the invert flag for the texture. The "vertical flip"
+ // flag in PVR is the opposite sense to our sense of inversion.
if ((pvrHeader->flags & PVR_VERTICAL_FLIP) != 0)
- options |= QGLContext::InvertedYBindOption;
- else
options &= ~QGLContext::InvertedYBindOption;
+ else
+ options |= QGLContext::InvertedYBindOption;
return QSize(pvrHeader->width, pvrHeader->height);
}