/* ================ WriteBrushList ================ */ void WriteBrushList(char *name, bspBrush_t * brush, qboolean onlyvis) { int i; side_t *s; FILE *f; Sys_FPrintf(SYS_VRB, "writing %s\n", name); f = SafeOpenWrite(name); for(; brush; brush = brush->next) { for(i = 0; i < brush->numsides; i++) { s = &brush->sides[i]; if(!s->winding) continue; if(onlyvis && !s->visible) continue; OutputWinding(brush->sides[i].winding, f); } } fclose(f); }
/* ============= OutputPortal ============= */ void OutputPortal(portal_t *p, FILE *glview) { winding_t *w; int sides; sides = PortalVisibleSides(p); if (!sides) { return; } c_glfaces++; w = p->winding; if (sides == 2) // back side { w = ReverseWinding(w); } OutputWinding(w, glview); if (sides == 2) { FreeWinding(w); } }
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void WriteBrushList( char *name, bspbrush_t *brush, qboolean onlyvis ) { int i; side_t *s; FILE *f; qprintf( "writing %s\n", name ); f = SafeOpenWrite( name ); for ( ; brush ; brush = brush->next ) { for ( i = 0 ; i < brush->numsides ; i++ ) { s = &brush->sides[i]; if ( !s->winding ) { continue; } if ( onlyvis && !( s->flags & SFL_VISIBLE ) ) { continue; } OutputWinding( brush->sides[i].winding, f ); } } fclose( f ); } //end of the function WriteBrushList
/* ============= OutputPortal ============= */ void OutputPortal(uPortal_t *p, idFile *glview) { idWinding *w; int sides; sides = PortalVisibleSides(p); if (!sides) { return; } c_glfaces++; w = p->winding; if (sides == 2) { // back side w = w->Reverse(); } OutputWinding(w, glview); if (sides == 2) { delete w; } }
void WriteGLViewBrushList( bspbrush_t *pList, const char *pName ) { char name[1024]; FileHandle_t glview; sprintf (name, "%s%s.gl", outbase, pName ); Msg("Writing %s\n", name); glview = g_pFileSystem->Open( name, "w" ); if (!glview) Error ("Couldn't open %s", name); for ( bspbrush_t *pBrush = pList; pBrush; pBrush = pBrush->next ) { for (int i = 0; i < pBrush->numsides; i++ ) OutputWinding( pBrush->sides[i].winding, glview ); } g_pFileSystem->Close( glview ); }
/* ============= OutputPortal ============= */ void OutputPortal (portal_t *p, FileHandle_t glview) { winding_t *w; int sides; sides = PortalVisibleSides (p); if (!sides) return; c_glfaces++; w = p->winding; if (sides == 2) // back side w = ReverseWinding (w); OutputWinding (w, glview); if (sides == 2) FreeWinding(w); }
/* ================ WriteBrushList ================ */ void WriteBrushList (char *name, bspbrush_t *brush, qboolean onlyvis) { int i; side_t *s; qprintf ("writing %s\n", name); FileHandle_t f = g_pFileSystem->Open(name, "w"); for ( ; brush ; brush=brush->next) { for (i=0 ; i<brush->numsides ; i++) { s = &brush->sides[i]; if (!s->winding) continue; if (onlyvis && !s->visible) continue; OutputWinding (brush->sides[i].winding, f); } } g_pFileSystem->Close (f); }
void WriteGLViewFaces_r( node_t *node, FileHandle_t glview ) { portal_t *p, *nextp; if (node->planenum != PLANENUM_LEAF) { WriteGLViewFaces_r (node->children[0], glview); WriteGLViewFaces_r (node->children[1], glview); return; } // write all the portals for (p=node->portals ; p ; p=nextp) { int s = (p->nodes[1] == node); if ( p->face[s] ) { OutputWinding( p->face[s]->w, glview ); } nextp = p->next[s]; } }