- int i, x, y, refs;
- mesh_t src, *mesh;
- winding_t *w;
-
-#if 0
- /* subdivide the surface */
- src.width = ds->patchWidth;
- src.height = ds->patchHeight;
- src.verts = ds->verts;
- mesh = SubdivideMesh( src, FILTER_SUBDIVISION, 32 );
-
- /* filter each quad into the tree (fixme: use new patch x-triangulation code?) */
- refs = 0;
- for( y = 0; y < (mesh->height - 1); y++ )
- {
- for( x = 0; x < (mesh->width - 1); x++ )
- {
- /* triangle 1 */
- w = AllocWinding( 3 );
- w->numpoints = 3;
- VectorCopy( mesh->verts[ y * mesh->width + x ].xyz, w->p[ 0 ] );
- VectorCopy( mesh->verts[ y * mesh->width + x + 1 ].xyz, w->p[ 1 ] );
- VectorCopy( mesh->verts[ (y + 1) * mesh->width + x ].xyz, w->p[ 2 ] );
- refs += FilterWindingIntoTree_r( w, ds, tree->headnode );
-
- /* triangle 2 */
- w = AllocWinding( 3 );
- w->numpoints = 3;
- VectorCopy( mesh->verts[ y * mesh->width + x + 1 ].xyz, w->p[ 0 ] );
- VectorCopy( mesh->verts[ (y + 1 ) * mesh->width + x + 1 ].xyz, w->p[ 1 ] );
- VectorCopy( mesh->verts[ (y + 1 ) * mesh->width + x ].xyz, w->p[ 2 ] );
- refs += FilterWindingIntoTree_r( w, ds, tree->headnode );
- }
- }
-
- /* use point filtering as well */
- for( i = 0; i < (mesh->width * mesh->height); i++ )
- refs += FilterPointIntoTree_r( mesh->verts[ i ].xyz, ds, tree->headnode );