filename | src/pvr2/texcache.c |
changeset | 300:a8ae4aeb0b42 |
prev | 291:cb3e8f0ac24a |
next | 311:5be79c6b4367 |
author | nkeynes |
date | Wed Jan 17 09:21:55 2007 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Fix RGB565 format Fix miscalculation of byte size |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/texcache.c Mon Jan 15 12:57:42 2007 +00001.2 +++ b/src/pvr2/texcache.c Wed Jan 17 09:21:55 2007 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: texcache.c,v 1.14 2007-01-15 12:57:42 nkeynes Exp $1.6 + * $Id: texcache.c,v 1.15 2007-01-17 09:21:55 nkeynes Exp $1.7 *1.8 * Texture cache. Responsible for maintaining a working set of OpenGL1.9 * textures.1.10 @@ -344,9 +344,9 @@1.11 type = GL_UNSIGNED_SHORT_1_5_5_5_REV;1.12 break;1.13 case 1: /* RGB565 */1.14 - intFormat = GL_RGB;1.15 + intFormat = GL_RGB5;1.16 format = GL_RGB;1.17 - type = GL_UNSIGNED_SHORT_5_6_5_REV;1.18 + type = GL_UNSIGNED_SHORT_5_6_5;1.19 break;1.20 case 2: /* ARGB4444 */1.21 intFormat = GL_RGBA4;1.22 @@ -368,9 +368,9 @@1.23 type = GL_UNSIGNED_SHORT_1_5_5_5_REV;1.24 break;1.25 case PVR2_TEX_FORMAT_RGB565:1.26 - intFormat = GL_RGB;1.27 + intFormat = GL_RGB5;1.28 format = GL_RGB;1.29 - type = GL_UNSIGNED_SHORT_5_6_5_REV;1.30 + type = GL_UNSIGNED_SHORT_5_6_5;1.31 break;1.32 case PVR2_TEX_FORMAT_ARGB4444:1.33 intFormat = GL_RGBA4;1.34 @@ -417,7 +417,7 @@1.35 mip_height= height >> i;1.36 filter = GL_LINEAR_MIPMAP_LINEAR;1.37 }1.38 - mip_bytes = (mip_width * mip_width) << bpp_shift;1.39 + mip_bytes = (mip_width * mip_height) << bpp_shift;1.41 if( PVR2_TEX_IS_COMPRESSED(mode) ) {1.42 uint16_t tmp[VQ_CODEBOOK_SIZE];
.