/* ============= WriteGLView_r ============= */ void WriteGLView_r(node_t *node, FILE *glview) { portal_t *p, *nextp; if (node->planenum != PLANENUM_LEAF) { WriteGLView_r(node->children[0], glview); WriteGLView_r(node->children[1], glview); return; } // write all the portals for (p = node->portals ; p ; p = nextp) { if (p->nodes[0] == node) { OutputPortal(p, glview); nextp = p->next[0]; } else { nextp = p->next[1]; } } }
/* ============= WriteGLView ============= */ void WriteGLView( tree_t *tree, char *source ) { idFile *glview; c_glfaces = 0; common->Printf( "Writing %s\n", source ); glview = fileSystem->OpenExplicitFileWrite( source ); if ( !glview ) { common->Error( "Couldn't open %s", source ); } WriteGLView_r( tree->headnode, glview ); fileSystem->CloseFile( glview ); common->Printf( "%5i c_glfaces\n", c_glfaces ); }
/* ============= WriteGLView ============= */ void WriteGLView (tree_t *tree, char *source) { char name[1024]; FILE *glview; c_glfaces = 0; sprintf (name, "%s%s.gl",outbase, source); _printf ("Writing %s\n", name); glview = fopen (name, "w"); if (!glview) Error ("Couldn't open %s", name); WriteGLView_r (tree->headnode, glview); fclose (glview); _printf ("%5i c_glfaces\n", c_glfaces); }
/* ============= WriteGLView ============= */ void WriteGLView (tree_t *tree, char *source) { char name[1024]; FileHandle_t glview; c_glfaces = 0; sprintf (name, "%s%s.gl",outbase, source); Msg("Writing %s\n", name); glview = g_pFileSystem->Open( name, "w" ); if (!glview) Error ("Couldn't open %s", name); WriteGLView_r (tree->headnode, glview); g_pFileSystem->Close( glview ); Msg("%5i c_glfaces\n", c_glfaces); }