Search
lxdream.org :: lxdream/src/pvr2/texcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/texcache.c
changeset 1298:d0eb2307b847
prev1282:9f445c5e252b
author nkeynes
date Wed Feb 04 08:38:23 2015 +1000 (5 years ago)
permissions -rw-r--r--
last change Fix assorted compile warnings reported by Clang
file annotate diff log raw
1.1 --- a/src/pvr2/texcache.c Tue Mar 27 08:23:52 2012 +1000
1.2 +++ b/src/pvr2/texcache.c Wed Feb 04 08:38:23 2015 +1000
1.3 @@ -261,7 +261,7 @@
1.4 int bpp = 2;
1.5 uint32_t *palette = (uint32_t *)mmio_region_PVR2PAL.mem;
1.6 uint16_t packed_palette[1024];
1.7 - char *data = (char *)palette;
1.8 + unsigned char *data = (unsigned char *)palette;
1.9
1.10 switch( texcache_palette_mode ) {
1.11 case 0: /* ARGB1555 */
1.12 @@ -290,14 +290,14 @@
1.13 for( i=0; i<1024; i++ ) {
1.14 packed_palette[i] = (uint16_t)palette[i];
1.15 }
1.16 - data = (char *)packed_palette;
1.17 + data = (unsigned char *)packed_palette;
1.18 }
1.19
1.20 glActiveTexture(GL_TEXTURE1);
1.21 if( format_changed )
1.22 - glTexImage2DBGRA(0, intFormat, 1024, 1, format, type, data, data == (char *)palette );
1.23 + glTexImage2DBGRA(0, intFormat, 1024, 1, format, type, data, data == (unsigned char *)palette );
1.24 else
1.25 - glTexSubImage2DBGRA(0, 0, 0, 1024, 1, format, type, data, data == (char *)palette);
1.26 + glTexSubImage2DBGRA(0, 0, 0, 1024, 1, format, type, data, data == (unsigned char *)palette);
1.27 glActiveTexture(GL_TEXTURE0);
1.28 texcache_palette_valid = TRUE;
1.29 }
1.30 @@ -479,16 +479,6 @@
1.31 }
1.32 }
1.33
1.34 -static gboolean is_npot_texture( int width )
1.35 -{
1.36 - while( width != 0 ) {
1.37 - if( width & 1 )
1.38 - return width != 1;
1.39 - width >>= 1;
1.40 - }
1.41 - return TRUE;
1.42 -}
1.43 -
1.44 /**
1.45 * Load texture data from the given address and parameters into the currently
1.46 * bound OpenGL texture.
1.47 @@ -704,7 +694,6 @@
1.48 {
1.49 uint32_t texture_addr = (texture_word & 0x000FFFFF)<<3;
1.50 uint32_t texture_page = texture_addr >> 12;
1.51 - texcache_entry_index next;
1.52 texcache_entry_index idx = texcache_page_lookup[texture_page];
1.53 while( idx != EMPTY_ENTRY ) {
1.54 texcache_entry_t entry = &texcache_active_list[idx];
1.55 @@ -809,6 +798,17 @@
1.56 }
1.57
1.58 #if 0
1.59 +
1.60 +static gboolean is_npot_texture( int width )
1.61 +{
1.62 + while( width != 0 ) {
1.63 + if( width & 1 )
1.64 + return width != 1;
1.65 + width >>= 1;
1.66 + }
1.67 + return TRUE;
1.68 +}
1.69 +
1.70 render_buffer_t texcache_get_render_buffer( uint32_t texture_addr, int mode, int width, int height )
1.71 {
1.72 uint32_t texture_word = ((texture_addr >> 3) & 0x000FFFFF) | PVR2_TEX_UNTWIDDLED;
1.73 @@ -910,8 +910,8 @@
1.74 {
1.75 unsigned x,y;
1.76 int src_bytes = (width*width>>1);
1.77 - char tmp[src_bytes];
1.78 - char data[width*width];
1.79 + unsigned char tmp[src_bytes];
1.80 + unsigned char data[width*width];
1.81 pvr2_vram64_read_twiddled_4( tmp, texture_addr, width, width );
1.82 decode_pal4_to_pal8( data, tmp, src_bytes );
1.83 for( y=0; y<width; y++ ) {
.