Search
lxdream.org :: lxdream :: r300:a8ae4aeb0b42
lxdream 0.9.1
released Jun 29
Download Now
changeset300:a8ae4aeb0b42
parent299:d0c983d5ad59
child301:1ace395139c3
authornkeynes
dateWed Jan 17 09:21:55 2007 +0000 (13 years ago)
Fix RGB565 format
Fix miscalculation of byte size
src/pvr2/texcache.c
1.1 --- a/src/pvr2/texcache.c Wed Jan 17 09:21:27 2007 +0000
1.2 +++ b/src/pvr2/texcache.c Wed Jan 17 09:21:55 2007 +0000
1.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 OpenGL
1.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.40
1.41 if( PVR2_TEX_IS_COMPRESSED(mode) ) {
1.42 uint16_t tmp[VQ_CODEBOOK_SIZE];
.