<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">+21</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-22</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">078a2202958a -> 4799d64b3478</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file2">pvr2.h</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+3</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">078a2202958a -> 4799d64b3478</td></tr>
<tr><td><tt><a href="#file3">rendsort.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">-4</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">078a2202958a -> 4799d64b3478</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+30</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-28</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >3 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;" >
Change forced-depth-function lists (autosort, punchout) to just set the
depth once at the start of the list
Remove unused parameter from render_set_tsp_context
</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;" >078a2202958a -> 4799d64b3478</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glrender.c
+++ lxdream/src/pvr2/glrender.c
@@ -131,12 +131,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >  * Setup the basic context that's shared between normal and modified modes -
  * depth, culling
  */
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-static void render_set_base_context( uint32_t poly1, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GLint depth_mode</span> )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static void render_set_base_context( uint32_t poly1, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gboolean set_depth</span> )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    if( depth_mode == 0 ) {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( set_depth ) {
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         glDepthFunc( POLY1_DEPTH_MODE(poly1) );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    } else {
-        glDepthFunc(depth_mode);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
     glDepthMask( POLY1_DEPTH_WRITE(poly1) ? GL_TRUE : GL_FALSE );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -145,7 +143,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /**
  * Setup the texture/shading settings (TSP) which vary between mod/unmod modes.
  */
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-static void render_set_tsp_context( uint32_t poly1, uint32_t poly2, uint32_t texture )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void render_set_tsp_context( uint32_t poly1, uint32_t poly2 )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     glShadeModel( POLY1_SHADE_MODEL(poly1) );
     if( POLY1_TEXTURED(poly1) ) {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -179,10 +177,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >  * @param depth_mode force depth mode, or 0 to use the polygon's
  * depth mode.
  */
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void render_set_context( uint32_t *context, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GLint depth_mode</span> )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void render_set_context( uint32_t *context, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gboolean set_depth</span> )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    render_set_base_context(context[0], depth_mode);
-    render_set_tsp_context(context[0],context[1],context[2]);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    render_set_base_context(context[0], set_depth);
+    render_set_tsp_context(context[0],context[1]);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 static inline void gl_draw_vertexes( struct polygon_struct *poly )
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -201,7 +199,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     } while( poly != NULL );
 }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-static void gl_render_poly( struct polygon_struct *poly, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GLint depth_mode </span>)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static void gl_render_poly( struct polygon_struct *poly, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gboolean set_depth</span>)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     if( poly->vertex_count == 0 )
         return; /* Culled */
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -210,12 +208,12 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         glBindTexture(GL_TEXTURE_2D, poly->tex_id);
     }
     if( poly->mod_vertex_index == -1 ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        render_set_context( poly->context, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >depth_mode</span> );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        render_set_context( poly->context, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >set_depth</span> );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         gl_draw_vertexes(poly);
     }  else {
         glEnable( GL_STENCIL_TEST );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        render_set_base_context( poly->context[0], depth_mode );
-        render_set_tsp_context( poly->context[0], poly->context[1], poly->context[2] );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        render_set_base_context( poly->context[0], set_depth );
+        render_set_tsp_context( poly->context[0], poly->context[1] );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         glStencilFunc(GL_EQUAL, 0, 2);
         gl_draw_vertexes(poly);
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -223,7 +221,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             if( poly->mod_tex_id != -1 ) {
                 glBindTexture(GL_TEXTURE_2D, poly->mod_tex_id);
             }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            render_set_tsp_context( poly->context[0], poly->context[3]<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >, poly->context[4]</span> );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            render_set_tsp_context( poly->context[0], poly->context[3] );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         }
         glStencilFunc(GL_EQUAL, 2, 2);
         gl_draw_mod_vertexes(poly);
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -236,14 +234,14 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( poly->tex_id != -1 ) {
         glBindTexture(GL_TEXTURE_2D, poly->tex_id);
     }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    render_set_context( poly->context, 0 );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    render_set_tsp_context( poly->context[0], poly->context[1] );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glDisable( GL_DEPTH_TEST );
     glBlendFunc( GL_ONE, GL_ZERO );
     gl_draw_vertexes(poly);
     glEnable( GL_DEPTH_TEST );
 }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void gl_render_tilelist( pvraddr_t tile_entry, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GLint depth_mode</span> )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void gl_render_tilelist( pvraddr_t tile_entry, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gboolean set_depth</span> )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     uint32_t *tile_list = (uint32_t *)(pvr2_main_ram+tile_entry);
     int strip_count;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -265,7 +263,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             poly = pvr2_scene.buf_to_poly_map[entry&0x000FFFFF];
             while( strip_count > 0 ) {
                 assert( poly != NULL );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-                gl_render_poly( poly, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >depth_mode</span> );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+                gl_render_poly( poly, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >set_depth</span> );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                 poly = poly->next;
                 strip_count--;
             }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -273,7 +271,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         default:
             if( entry & 0x7E000000 ) {
                 poly = pvr2_scene.buf_to_poly_map[entry&0x000FFFFF];
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-                gl_render_poly( poly, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >depth_mode</span> );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+                gl_render_poly( poly, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >set_depth</span> );
</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;" >@@ -306,7 +304,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             poly = pvr2_scene.buf_to_poly_map[entry&0x000FFFFF];
             while( strip_count > 0 ) {
                 if( poly->vertex_count != 0 ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-                    render_set_base_context(poly->context[0],<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >0</span>);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+                    render_set_base_context(poly->context[0],<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >TRUE</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                     gl_draw_vertexes(poly);
                 }
                 poly = poly->next;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -317,7 +315,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             if( entry & 0x7E000000 ) {
                 poly = pvr2_scene.buf_to_poly_map[entry&0x000FFFFF];
                 if( poly->vertex_count != 0 ) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-                    render_set_base_context(poly->context[0],<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >0</span>);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+                    render_set_base_context(poly->context[0],<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >TRUE</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                     gl_draw_vertexes(poly);
                 }
             }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -530,17 +528,18 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             glClear( GL_DEPTH_BUFFER_BIT );
             glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
         }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        gl_render_tilelist(segment->opaque_ptr,<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >0</span>);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        gl_render_tilelist(segment->opaque_ptr,<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >TRUE</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         if( IS_TILE_PTR(segment->punchout_ptr) ) {
             glEnable(GL_ALPHA_TEST );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            gl_render_tilelist(segment->punchout_ptr, GL_GEQUAL );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            glDepthFunc(GL_GEQUAL);
+            gl_render_tilelist(segment->punchout_ptr, FALSE );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             glDisable(GL_ALPHA_TEST );
         }
 
         if( IS_TILE_PTR(segment->trans_ptr) ) {
             if( pvr2_scene.sort_mode == SORT_NEVER || 
                     (pvr2_scene.sort_mode == SORT_TILEFLAG && (segment->control&SEGMENT_SORT_TRANS))) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-                gl_render_tilelist(segment->trans_ptr, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >0</span>);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+                gl_render_tilelist(segment->trans_ptr, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >TRUE</span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             } else {
                 render_autosort_tile(segment->trans_ptr, RENDER_NORMAL );
             }
</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>pvr2.h</b></big> <small id="info" style="color: #888888;" >078a2202958a -> 4799d64b3478</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/pvr2.h
+++ lxdream/src/pvr2/pvr2.h
@@ -284,9 +284,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 void render_autosort_tile( pvraddr_t tile_entry, int render_mode );
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void render_set_context( uint32_t *context, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GLint depth_mode</span> );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void render_set_context( uint32_t *context, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gboolean set_depth</span> );
+void render_set_tsp_context( uint32_t poly1, uint32_t poly2 );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void gl_render_tilelist( pvraddr_t tile_entry, <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GLint depth_mode</span> );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void gl_render_tilelist( pvraddr_t tile_entry, <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >gboolean set_depth</span> );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 render_buffer_t pvr2_create_render_buffer( sh4addr_t addr, int width, int height, GLuint tex_id );
 
</pre></div>
<hr /><a name="file3" /><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;" >078a2202958a -> 4799d64b3478</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/rendsort.c
+++ lxdream/src/pvr2/rendsort.c
@@ -159,8 +159,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         if( poly->tex_id != -1 ) {
             glBindTexture(GL_TEXTURE_2D, poly->tex_id);
         }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        render_set_context( poly->context, GL_GEQUAL );
-        glDepthMask(GL_FALSE);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        render_set_tsp_context( poly->context[0], poly->context[1] );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         glDrawArrays(GL_TRIANGLE_STRIP, poly->vertex_index + triangles[i]->triangle_num, 3 );
     }
 }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -256,7 +255,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     if( num_triangles == 0 ) {
         return; /* nothing to do */
     } else if( num_triangles == 1 ) { /* Triangle can hardly overlap with itself */
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        gl_render_tilelist(tile_entry, GL_GEQUAL);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        glDepthMask(GL_FALSE);
+        glDepthFunc(GL_GEQUAL);
+        gl_render_tilelist(tile_entry, FALSE);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     } else { /* Ooh boy here we go... */
         int i;
         struct sort_triangle triangles[num_triangles+1];
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -268,8 +269,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         int extracted_triangles = sort_extract_triangles(tile_entry, triangles);
         assert( extracted_triangles <= num_triangles );
         sort_triangles( triangle_order, extracted_triangles, triangle_order );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        glDepthMask(GL_FALSE);
+        glDepthFunc(GL_GEQUAL);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         sort_render_triangles(triangle_order, extracted_triangles);
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        glCullFace(GL_BACK);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         assert( triangles[num_triangles].poly == (void *)SENTINEL );
     }
 }
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>