- gboolean done = FALSE;
- while (!done) {
- /* Only draw children if possible */
- gboolean draw_parent = FALSE;
- grits_tile_foreach(tile, child)
- if (!child || !child->data || GRITS_OBJECT(child)->hidden)
- draw_parent = TRUE;
-
- /* Draw parent tile underneath */
- if (draw_parent) {
- GList *triangles = roam_sphere_get_intersect(opengl->sphere, FALSE,
- tile->edge.n, tile->edge.s, tile->edge.e, tile->edge.w);
- grits_tile_draw_one(tile, opengl, triangles);
- g_list_free(triangles);
- }
-
- /* Draw child tiles */
- gboolean drew_all_children = TRUE;
- grits_tile_foreach(tile, child)
- if (!grits_tile_draw_rec(child, opengl))
- drew_all_children = FALSE;