Search
lxdream.org :: lxdream/src/pvr2/texcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/texcache.c
changeset 1221:f50407acc682
prev1210:79bbd30363f4
next1233:06923d1020de
author nkeynes
date Mon Feb 13 22:16:43 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Make palette textures 2D (1 pixel high) instead of 1D - pretty much the
same, but some systems don't support 1D textures
file annotate diff log raw
1.1 --- a/src/pvr2/texcache.c Tue Feb 07 14:27:13 2012 +1000
1.2 +++ b/src/pvr2/texcache.c Mon Feb 13 22:16:43 2012 +1000
1.3 @@ -101,10 +101,10 @@
1.4
1.5 /* Bind the texture and set the params */
1.6 glActiveTexture(GL_TEXTURE1);
1.7 - glBindTexture(GL_TEXTURE_1D, texcache_palette_texid);
1.8 - glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
1.9 - glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
1.10 - glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP );
1.11 + glBindTexture(GL_TEXTURE_2D, texcache_palette_texid);
1.12 + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
1.13 + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
1.14 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1.15 glActiveTexture(GL_TEXTURE0);
1.16
1.17 } else {
1.18 @@ -290,14 +290,10 @@
1.19 }
1.20
1.21 glActiveTexture(GL_TEXTURE1);
1.22 -// glBindTexture(GL_TEXTURE_1D, texcache_palette_texid);
1.23 if( format_changed )
1.24 - glTexImage1D(GL_TEXTURE_1D, 0, intFormat, 1024, 0, format, type, data );
1.25 + glTexImage2D(GL_TEXTURE_2D, 0, intFormat, 1024, 1, 0, format, type, data );
1.26 else
1.27 - glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 1024, format, type, data);
1.28 -// glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
1.29 -// glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
1.30 -// glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP );
1.31 + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 1024, 1, format, type, data);
1.32 glActiveTexture(GL_TEXTURE0);
1.33 texcache_palette_valid = TRUE;
1.34 }
1.35 @@ -510,7 +506,7 @@
1.36 case PVR2_TEX_FORMAT_IDX4:
1.37 case PVR2_TEX_FORMAT_IDX8:
1.38 if( texcache_have_palette_shader ) {
1.39 - intFormat = GL_ALPHA8;
1.40 + intFormat = GL_ALPHA;
1.41 format = GL_ALPHA;
1.42 type = GL_UNSIGNED_BYTE;
1.43 bpp_shift = 0;
1.44 @@ -895,7 +891,12 @@
1.45 POLY2_TEX_HEIGHT(texcache_active_list[slot].poly2_mode),
1.46 texcache_active_list[slot].poly2_mode,
1.47 texcache_active_list[slot].tex_mode,
1.48 - (glAreTexturesResident(1, &texcache_active_list[slot].texture_id, &boolresult) ? "[RESIDENT]" : "[NOT RESIDENT]") );
1.49 +#ifdef HAVE_OPENGL_TEX_RESIDENT
1.50 + (glAreTexturesResident(1, &texcache_active_list[slot].texture_id, &boolresult) ? "[RESIDENT]" : "[NOT RESIDENT]")
1.51 +#else
1.52 + ""
1.53 +#endif
1.54 + );
1.55 slot = texcache_active_list[slot].next;
1.56 }
1.57 }
.