Search
lxdream.org :: lxdream/src/pvr2/texcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/texcache.c
changeset 1142:fd82bfba61c4
prev1140:7dc1c71ece76
next1165:13406c35849b
author nkeynes
date Tue Oct 26 18:41:01 2010 +1000 (10 years ago)
permissions -rw-r--r--
last change Fix call to isGLMultitextureSuppported() in texcache
Add debug helper to print idx4 textures on console
Change pvr2_scene_dump() to just dump to stdout
file annotate diff log raw
1.1 --- a/src/pvr2/texcache.c Tue Oct 26 08:39:02 2010 +1000
1.2 +++ b/src/pvr2/texcache.c Tue Oct 26 18:41:01 2010 +1000
1.3 @@ -94,7 +94,7 @@
1.4 int i;
1.5 GLuint texids[MAX_TEXTURES];
1.6
1.7 - if( glsl_is_supported() && isGLMultitextureSupported ) {
1.8 + if( glsl_is_supported() && isGLMultitextureSupported() ) {
1.9 texcache_have_palette_shader = TRUE;
1.10 texcache_palette_valid = FALSE;
1.11 glGenTextures(1, &texcache_palette_texid );
1.12 @@ -898,3 +898,19 @@
1.13 }
1.14 }
1.15 }
1.16 +
1.17 +void texcache_print_idx4( uint32_t texture_addr, int width )
1.18 +{
1.19 + unsigned x,y;
1.20 + int src_bytes = (width*width>>1);
1.21 + char tmp[src_bytes];
1.22 + char data[width*width];
1.23 + pvr2_vram64_read_twiddled_4( tmp, texture_addr, width, width );
1.24 + decode_pal4_to_pal8( data, tmp, src_bytes );
1.25 + for( y=0; y<width; y++ ) {
1.26 + for( x=0; x<width; x++ ) {
1.27 + printf( "%1x", data[y*width+x] );
1.28 + }
1.29 + printf( "\n" );
1.30 + }
1.31 +}
.