Search
lxdream.org :: lxdream/src/pvr2/texcache.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/texcache.c
changeset 870:8d4deb2bc1ea
prev860:b429964761c8
next886:2bc6d2329cce
author nkeynes
date Sun Oct 19 05:09:31 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Remove unused fields from vertex_struct
file annotate diff log raw
1.1 --- a/src/pvr2/texcache.c Sun Sep 28 00:29:37 2008 +0000
1.2 +++ b/src/pvr2/texcache.c Sun Oct 19 05:09:31 2008 +0000
1.3 @@ -653,16 +653,12 @@
1.4 }
1.5
1.6 texcache_entry_t entry = &texcache_active_list[slot];
1.7 - if( entry->width != width || entry->height != height ) {
1.8 - glBindTexture(GL_TEXTURE_2D, entry->texture_id );
1.9 - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
1.10 - if( entry->buffer != NULL ) {
1.11 - texcache_release_render_buffer(entry->buffer);
1.12 - }
1.13 +
1.14 + if( entry->buffer == NULL ) {
1.15 entry->buffer = pvr2_create_render_buffer( texture_addr, width, height, entry->texture_id );
1.16 - } else {
1.17 - if( entry->buffer == NULL )
1.18 - entry->buffer = pvr2_create_render_buffer( texture_addr, width, height, entry->texture_id );
1.19 + } else if( entry->buffer->width != width || entry->buffer->height != height ) {
1.20 + texcache_release_render_buffer(entry->buffer);
1.21 + entry->buffer = pvr2_create_render_buffer( texture_addr, width, height, entry->texture_id );
1.22 }
1.23
1.24 return entry->buffer;
.