Search
lxdream.org :: lxdream :: r1142:fd82bfba61c4
lxdream 0.9.1
released Jun 29
Download Now
changeset1142:fd82bfba61c4
parent1141:dc60a0987db9
child1143:8ec0f1f990aa
authornkeynes
dateTue Oct 26 18:41:01 2010 +1000 (9 years ago)
Fix call to isGLMultitextureSuppported() in texcache
Add debug helper to print idx4 textures on console
Change pvr2_scene_dump() to just dump to stdout
src/pvr2/scene.c
src/pvr2/texcache.c
1.1 --- a/src/pvr2/scene.c Tue Oct 26 09:22:22 2010 +1000
1.2 +++ b/src/pvr2/scene.c Tue Oct 26 18:41:01 2010 +1000
1.3 @@ -936,7 +936,7 @@
1.4 /**
1.5 * Dump the current scene to file in a (mostly) human readable form
1.6 */
1.7 -void pvr2_scene_dump( FILE *f )
1.8 +void pvr2_scene_print( FILE *f )
1.9 {
1.10 int i,j;
1.11
1.12 @@ -974,3 +974,8 @@
1.13 }
1.14
1.15 }
1.16 +
1.17 +void pvr2_scene_dump()
1.18 +{
1.19 + pvr2_scene_print(stdout);
1.20 +}
2.1 --- a/src/pvr2/texcache.c Tue Oct 26 09:22:22 2010 +1000
2.2 +++ b/src/pvr2/texcache.c Tue Oct 26 18:41:01 2010 +1000
2.3 @@ -94,7 +94,7 @@
2.4 int i;
2.5 GLuint texids[MAX_TEXTURES];
2.6
2.7 - if( glsl_is_supported() && isGLMultitextureSupported ) {
2.8 + if( glsl_is_supported() && isGLMultitextureSupported() ) {
2.9 texcache_have_palette_shader = TRUE;
2.10 texcache_palette_valid = FALSE;
2.11 glGenTextures(1, &texcache_palette_texid );
2.12 @@ -898,3 +898,19 @@
2.13 }
2.14 }
2.15 }
2.16 +
2.17 +void texcache_print_idx4( uint32_t texture_addr, int width )
2.18 +{
2.19 + unsigned x,y;
2.20 + int src_bytes = (width*width>>1);
2.21 + char tmp[src_bytes];
2.22 + char data[width*width];
2.23 + pvr2_vram64_read_twiddled_4( tmp, texture_addr, width, width );
2.24 + decode_pal4_to_pal8( data, tmp, src_bytes );
2.25 + for( y=0; y<width; y++ ) {
2.26 + for( x=0; x<width; x++ ) {
2.27 + printf( "%1x", data[y*width+x] );
2.28 + }
2.29 + printf( "\n" );
2.30 + }
2.31 +}
.