<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src/pvr2</tt></b></td></tr>
<tr><td><tt><a href="#file1">glrender.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+6</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-15</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">4799d64b3478 -> 3bcb705a7ebc</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file2">rendsort.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-3</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">4799d64b3478 -> 3bcb705a7ebc</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+7</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-18</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >2 modified files</small><br />
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Bind texture 0 instead of enabling/disabling texturing all the time
(marginally faster, but also simpler)
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>glrender.c</b></big> <small id="info" style="color: #888888;" >4799d64b3478 -> 3bcb705a7ebc</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glrender.c
+++ lxdream/src/pvr2/glrender.c
@@ -76,8 +76,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                 }
             }
         } else {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            poly->tex_id = -1;
-            poly->mod_tex_id = -1;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            poly->tex_id = 0;
+            poly->mod_tex_id = 0;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         }
     }
 }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -147,10 +147,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     glShadeModel( POLY1_SHADE_MODEL(poly1) );
     if( POLY1_TEXTURED(poly1) ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-         glEnable(GL_TEXTURE_2D);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, pvr2_poly_texblend[POLY2_TEX_BLEND(poly2)] );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-     } else {
-         glDisable( GL_TEXTURE_2D );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      }
 
      switch( POLY2_FOG_MODE(poly2) ) {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -204,9 +201,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( poly->vertex_count == 0 )
         return; /* Culled */
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    if( poly->tex_id != -1 ) {
-        glBindTexture(GL_TEXTURE_2D, poly->tex_id);
-    }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    glBindTexture(GL_TEXTURE_2D, poly->tex_id);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( poly->mod_vertex_index == -1 ) {
         render_set_context( poly->context, set_depth );
         gl_draw_vertexes(poly);
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -218,7 +213,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         gl_draw_vertexes(poly);
 
         if( pvr2_scene.shadow_mode == SHADOW_FULL ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            if( poly->mod_tex_id != <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >-1</span> ) {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            if( poly->mod_tex_id != <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >poly->tex_id</span> ) {
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                 glBindTexture(GL_TEXTURE_2D, poly->mod_tex_id);
             }
             render_set_tsp_context( poly->context[0], poly->context[3] );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -231,9 +226,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 static void gl_render_bkgnd( struct polygon_struct *poly )
 {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    if( poly->tex_id != -1 ) {
-        glBindTexture(GL_TEXTURE_2D, poly->tex_id);
-    }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    glBindTexture(GL_TEXTURE_2D, poly->tex_id);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     render_set_tsp_context( poly->context[0], poly->context[1] );
     glDisable( GL_DEPTH_TEST );
     glBlendFunc( GL_ONE, GL_ZERO );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -289,8 +282,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( !IS_TILE_PTR(tile_entry) )
         return;
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    glDisable( GL_TEXTURE_2D );
-    
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     while(1) {
         uint32_t entry = *tile_list++;
         switch( entry >> 28 ) {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -408,7 +399,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( !IS_TILE_PTR(tile_entry) )
         return;
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    glDisable( GL_TEXTURE_2D );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glEnable( GL_STENCIL_TEST );
     glEnable( GL_DEPTH_TEST );
     glDepthFunc( GL_LEQUAL );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -501,6 +491,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glEnable( GL_SCISSOR_TEST );
     glEnable( GL_COLOR_SUM );
     glEnable( GL_FOG );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    glEnable( GL_TEXTURE_2D );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     /* Process the segment list */
     struct tile_segment *segment = pvr2_scene.segment_list;
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>rendsort.c</b></big> <small id="info" style="color: #888888;" >4799d64b3478 -> 3bcb705a7ebc</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/rendsort.c
+++ lxdream/src/pvr2/rendsort.c
@@ -156,9 +156,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     int i;
     for( i=0; i<num_triangles; i++ ) {
         struct polygon_struct *poly = triangles[i]->poly;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        if( poly->tex_id != -1 ) {
-            glBindTexture(GL_TEXTURE_2D, poly->tex_id);
-        }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        glBindTexture(GL_TEXTURE_2D, poly->tex_id);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         render_set_tsp_context( poly->context[0], poly->context[1] );
         glDrawArrays(GL_TRIANGLE_STRIP, poly->vertex_index + triangles[i]->triangle_num, 3 );
     }
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>